I am trying to estimate the parameters in rolling window regression and then conduct a out-of sample fit forecast with realized values of predictor. I have the following data:
- The data set of the dependent variable is a vector of length T=521
- The data set predictor is a vector of length T=521
- In sample window size is denoted as r, r=400
- Forecast horizon is denoted as h, h=2
I have estimated my parameters using the following MATLAB code
1. Is this the correct way to implement a rolling window regression in MATLAB? It means my window rolls from 400(r) to 521(T) at interval of 1.
2. In order to analyze the stability of beta estimate should I plot these results? Or I should make the interval bigger such as r:10:T and than estimate the parameters?
3. I need to understand what exactly should I roll in order to perfom the regression? In sample size r already rolls from 400 to 521 so is that enough?