How to get the OLS estimate from a regression based on a vector?
8 次查看(过去 30 天)
显示 更早的评论
I have a vector y of dimension nx1. I want to get the OLS estimate of the regression of Δy on y_t-1 (t=1,2...n). How can I do it?
0 个评论
回答(1 个)
Jeff Miller
2019-9-11
编辑:Jeff Miller
2019-9-11
How about this:
deltay = diff(y);
b = regress(deltay,y(1:end-1));
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!