You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a generic implementation issue. I'm not sure yet how everything fits together
Main point we exploit a local quadratic approximation of the loglikelihood (objective) function or a linear approximation of the estimating equation or score function to get fast calculations for local deviations of the model.
example score tests or lm tests: Davidson MacKinnon use the GNR or it's nonlinear variants (Logit) for specification tests
we had the discussion before on other issues about using the linear approximation for diagnostic, influence and outlier measures (GLM and GEE)
The main implementation choice is which estimator for the covariance of the score (cov_params) is used, OPG (outer product of gradient), observed hessian or expected hessian
I guess using hessian is one Newton optimization step, using expected hessian is one Fisher scoring step, some of the Davidson MacKinnon auxiliary regression cases use the OPG.
variation: for the robust case we need the sandwich variant (somewhere)
related topic for my literature search: robust score tests, robust to misspecification of the alternative or of higher moments.
GNR u ~ X b + Z c assumes that we can define residuals, where X is gradient, jacobian
OPG regression 1 ~ G b works for MLE also when we don't have residuals
see Davidson/MacKinnon p.656
more general one-step regression - todo: check
implementation idea:
add get_gnr and get_opgr (or more generic that combines both) as methods to results.
extra arguments exog treated the same as exog in model, i.e. need for example score_obs(exog) or w * exog exog_raw (name ?) regressor directly included in artificial regression, without transformation fit_kwds cov_type and optimization method (qr, pinv)
alternative would be to return model instead of results of artificial regression.
This would be a cheap way of getting additional diagnostics. Fancier versions with better small sample properties and more specification robustness can be added later as score/LM, conditional moment or similar tests.
e.g. autocorrelation in Poisson or GLM: include lagged residual as exog_raw.
(Note in Davidson MacKinnon for AR regression (middle of page 276): add 0 for initial value of lagged residual so that we have the same number of observations in the artificial regression.)
The above works for testing/checking mean E(y | x) specification. Other things might need additional transformations, e.g. variance heteroscedasticity, overdispersion in Poisson (Cameron, Trivedi transformation of residuals), ...
Activity
josef-pkt commentedon Jan 12, 2016
GNR u ~ X b + Z c assumes that we can define
residuals, where X is gradient, jacobianOPG regression 1 ~ G b works for MLE also when we don't have
residualssee Davidson/MacKinnon p.656
more general one-step regression - todo: check
implementation idea:
add
get_gnrandget_opgr(or more generic that combines both) as methods to results.extra arguments
exogtreated the same as exog in model, i.e. need for example score_obs(exog) or w * exogexog_raw(name ?) regressor directly included in artificial regression, without transformationfit_kwdscov_type and optimization method (qr, pinv)alternative would be to return model instead of results of artificial regression.
This would be a cheap way of getting additional diagnostics. Fancier versions with better small sample properties and more specification robustness can be added later as score/LM, conditional moment or similar tests.
e.g. autocorrelation in Poisson or GLM: include lagged residual as
exog_raw.(Note in Davidson MacKinnon for AR regression (middle of page 276): add 0 for initial value of lagged residual so that we have the same number of observations in the artificial regression.)
The above works for testing/checking mean E(y | x) specification. Other things might need additional transformations, e.g. variance heteroscedasticity, overdispersion in Poisson (Cameron, Trivedi transformation of residuals), ...
josef-pkt commentedon Jan 12, 2016
see also #1087 which is duplicate
reference mentioned there:
Davidson and MacKinnon Econometric Theory and Methods 2004
has a good explanation starting page 236, cov_params on page 239