Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Major regression loop for residuals

1 回表示 (過去 30 日間)
Tomás Nunes
Tomás Nunes 2018 年 4 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi. I have a 7567x32 matrix with returns and another one with signals, such as 1, -1 and 0. I am supposed to compute a regression over t-30:t-1 returns every time the second matrix has a 1 or -1 (every row has four non-zeros). This means that I should do a regression over the 30 days previous to the one day when I have the 1 or -1 signal. What I want to get from the regression is the residuals, so every time I do a regression I should get 30 residuals. I believe that the best way to keep the residuals would be to have them populating a 7567*4 matrix with each cell being a 30*1 matrix.
Does anyone know how to solve this? I accept suggestions on better ways to keep the residuals.
Thank you all
  2 件のコメント
John D'Errico
John D'Errico 2018 年 4 月 17 日
What type of regression? I.e., a straight line fit?
What does t refer to? Is it an index in the first dimension of your matrix?
Tomás Nunes
Tomás Nunes 2018 年 4 月 17 日
yes, a straight line fit. I already have the predictor.
exactly, t would be the row of the signal (-1/1). And I should regress over the previous 30 days, therefore from t-30 until t-1.
thx

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by