You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pystatsmodels
Is there a means of specifying a particular heteroscedastic noise model? For example, if I want a linear model with linear heteroscedastic noise such as:
Y_i = \beta*X_i + \epsilon_i
\epsilon_i ~ N(0, X_i*\gamma)
is there a way to specify that noise model within a statsmodels OLS function?
Thank you!
josef...@gmail.com
unread,
Jul 17, 2017, 5:26:09 PM7/17/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pystatsmodels
WLS has the weights option with the interpretation of inverse variance for heteroscedasticity, but it takes the weights as given and doesn't estimate any variance parameters.
There is a statsmodels.regression.feasible_gls.GLSHet model that alternates between estimating the WLS model with fixed weights and estimating the variance function `res_resid = OLS(self.link(results.resid**2), self.exog_var).fit()`
It has zero unit test coverage, mainly because at the time I didn't find any equivalent model in R or Stata. The implementation is a standard econometrics text book version. In R I only saw a full gaussian MLE version.
We currently don't have a full MLE version, MixedLM and some statespace models use MLE for variance estimation, but I think none of them would have this as special case.
abbreviated historical note
At the time (2011) my background was almost exclusively econometrics where full MLE is considered to be too restrictive.
In the mean time it became apparent that the trend is going towards heteroscedasticity robust standard errors which became higher priority
I am reading up and making plans for adding heteroscedasticity models through GLM as prototypical case, double exponential or similar models, with both full MLE and estimating equation/WLS/GLS versions, we are slowly working our way to get there. (Slow because there are many other directions for enhancements and improvements and so far there wasn't a large demand.)
Josef
Thank you!
william....@gmail.com
unread,
Jul 19, 2017, 10:06:32 AM7/19/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
Yes, there should might still be a draft version somewhere for normal mle without heteroscedasticity.
Note, computationally its easier and more robust to concentrate out the linear part with WLS and use nonlinear optimization for the variance parameters.
The complete mle would require less code.
Josef
josef...@gmail.com
unread,
Jul 27, 2017, 2:11:46 PM7/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pystat...@googlegroups.com
I just saw
New in Stata 15: hetregress with least squares and MLE (assuming normality and correct specification)