Multivariate Regression With Lags
2 ビュー (過去 30 日間)
古いコメントを表示
Suppose I have a T-by-n vector of data called y. I generate 4 lags for it using
ym=lagmatrix(y,1:4);
I want to regress each column of y on four columns of ym (a T-by-4n matrix) that represent lags of y. That is, for i=1, y must be regressed on the 1st, the (n+1)st, the (2*n+1)st, the (3*n+1)st columns of ym, then for i=2, etc. up until i=n.
I've tried this
[b,varcoy,resid,varcob,logL] = mvregress(ym,y);
But the covariance matrix is not positive-definite and I doubt that it recognises my intention in the first place. I've tried using loops and the function 'fitlm', but the output cannot be stored within the loop.
0 件のコメント
回答 (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!