Hey, I am pretty new to MatLab and have to reproduce results from a Paper.
Therefore i have to do one-step-ahead recursive forecasts 1000 times for each quarter of a Vector Autoregression Model. Number of forecast period is 20. For each Forecast, i have to add random error terms multiplied by the Choleski Decomposition to the forecasts.
Coeffs=Coefficients of the VAR Model , Cons=constants of VAR, lastobservation= last historical data of the VAR Variables
The step-by-step quarter forecasts would be then:
and this for 20 forecasts.
I am pretty sure, there is a more elegant way to code this, but since this is my first Matlab experience, I am not sure what it is. Do you have any ideas for a loop or function ?
Thank you in Advance