Logo

statsmodels.regression.linear_model.OLSResults.compare_lr_test

OLSResults.compare_lr_test(restricted)

Likelihood ratio test to test whether restricted model is correct

Parameters :

restricted : Result instance

The restricted model is assumed to be nested in the current model. The result instance of the restricted model is required to have two attributes, residual sum of squares, ssr, residual degrees of freedom, df_resid.

Returns :

lr_stat : float

likelihood ratio, chisquare distributed with df_diff degrees of freedom

p_value : float

p-value of the test statistic

df_diff : int

degrees of freedom of the restriction, i.e. difference in df between models

Notes

D=-2\log\left(\frac{\mathcal{L}_{null}}
{\mathcal{L}_{alternative}}\right)

where \mathcal{L} is the likelihood of the model. With D distributed as chisquare with df equal to difference in number of parameters or equivalently difference in residual degrees of freedom

TODO: put into separate function, needs tests

Previous topic

statsmodels.regression.linear_model.OLSResults.compare_f_test

Next topic

statsmodels.regression.linear_model.OLSResults.conf_int

This Page