I employ ordinary least squares to model the relationship between to variables.
The Durbin-Watson test shows however strong evidence of positively correlated residuals.
1) How can I access the eigenvectors of the covariance matrix? (to manually decorrelate data)
2) Is there an easy, straightforward way to decorrelate data in statsmodels?
On Thu, Jun 18, 2015 at 6:14 PM, chrims <stabi...@web.de> wrote:I employ ordinary least squares to model the relationship between to variables.
The Durbin-Watson test shows however strong evidence of positively correlated residuals.
1) How can I access the eigenvectors of the covariance matrix? (to manually decorrelate data)I don't think we have this in any of the code.The problem is that the covariance matrix for all observations is (nobs, nobs) which is usually too large, and we couldn't estimate it from the sample without additional assumptions.
On Thu, Jun 18, 2015 at 6:39 PM, <josef...@gmail.com> wrote:On Thu, Jun 18, 2015 at 6:14 PM, chrims <stabi...@web.de> wrote:I employ ordinary least squares to model the relationship between to variables.
The Durbin-Watson test shows however strong evidence of positively correlated residuals.
1) How can I access the eigenvectors of the covariance matrix? (to manually decorrelate data)I don't think we have this in any of the code.The problem is that the covariance matrix for all observations is (nobs, nobs) which is usually too large, and we couldn't estimate it from the sample without additional assumptions.To be a bit more precise:The AR filter in GLSAR represents the Cholesky decomposition of the (nobs, nobs) covariance matrix (ignoring initial conditions in our version IIRC) but never constructs the matrix. This is under the assumption that the process is an AR process.
OLS is still a consistent estimator of the mean parameters even if there is autocorrelation, but we need to use autocorrelation AC or heteroscedasticity and autocorrelation HAC robust standard errors for the parameter estimates to get those correct. (available with fit(cov_type='hac'
The point is that it doesn't matter for consistency and correct inference that there is autocorrelation, and a significant DW statistic or other autocorrelation test.
The point is that it doesn't matter for consistency and correct inference that there is autocorrelation, and a significant DW statistic or other autocorrelation test.Then if I apply (H)AC how do I decide which number of maxlags is best? Solely on the minimization of the standard errors?