Heteroscedasticity and autocorrelation consistent covariance estimators for linear regression with equality constraints
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a linear regression
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1319810/image.png)
because
is not full colume rank, there is a additional equality constraint:
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1319815/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1319820/image.png)
I can solve above optimization problems easily and get the error matrix
. Because I belive the error matrix is correlated within columns (time-lag
) , I want to estimate robust covariance (i.e. Newey West method) using the error matrix
. I was wondering, is there any way to do this in MATLAB?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1319825/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1319830/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1319835/image.png)
댓글 수: 0
답변 (1개)
Zuber
2023년 3월 15일
Hi Mingyang,
I understand that you want to estimate the heteroscedasticity and autocorrelation consistent covariance estimator specifically using Newey West Method for linear regression. In order to obtain the covariance estimate, you can use the ‘hac’ function.
[EstCoeffCov,se,coeff] = hac(X,y)
where, ‘EstCoeffCov’ is the robust covariance matrix estimate.
For more information, please refer to the following documentation: https://www.mathworks.com/help/econ/hac.html
I hope this resolves your query.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Regression에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!