I have run a 6 variable VAR(1) with a 7th variable which is exogenous and saved the residuals as well as the coefficient estimates. I then drew a sample of these residuals with replacement and would like to use this sample of residuals with the coefficient estimates that I saved in the first step to create synthetic time series for the 6 variables of interest.
How can I implement this last step? I thought of using "predict" to generate linear predictions for each of the variables as follows:
predict allsher_d_pred, equation(#1)
predict rr1m_d_pred, equation(#2)
predict djiba3mma_d_pred, equation(#3)
predict djiba3m_d_pred, equation(#4)
predict allshlogdp_d_pred, equation(#5)
predict spread_d_pred, equation(#6)
and then using "generate" as follows:
gen allser_d_syn = allsher_d_pred + res1
where res1 is the synthetic series of residuals created using the saved residuals of the first equation of the VAR.
However I do not think this does what I want. I think this just takes the linear prediction and adds or subtracts the residual with the same index from the synthetic series. Am I mistaken?
What I would like to do instead is start by determining the second value for the first variable in the VAR (which I named allsher) using the first value of the 6 variables in the var weighted by the corresponding VAR coefficient estimates saved in the first step and adding the residual indexed 2 (corresponding to the second period).
I would like to do this for all 6 variables and then use these synthetic values and the residuals indexed 3 (corresponding to the third period) to determine the 3rd value for the six variables and so on..
How may I do this efficiently?
Any help would be much appreciated!
How can I implement this last step? I thought of using "predict" to generate linear predictions for each of the variables as follows:
predict allsher_d_pred, equation(#1)
predict rr1m_d_pred, equation(#2)
predict djiba3mma_d_pred, equation(#3)
predict djiba3m_d_pred, equation(#4)
predict allshlogdp_d_pred, equation(#5)
predict spread_d_pred, equation(#6)
and then using "generate" as follows:
gen allser_d_syn = allsher_d_pred + res1
where res1 is the synthetic series of residuals created using the saved residuals of the first equation of the VAR.
However I do not think this does what I want. I think this just takes the linear prediction and adds or subtracts the residual with the same index from the synthetic series. Am I mistaken?
What I would like to do instead is start by determining the second value for the first variable in the VAR (which I named allsher) using the first value of the 6 variables in the var weighted by the corresponding VAR coefficient estimates saved in the first step and adding the residual indexed 2 (corresponding to the second period).
I would like to do this for all 6 variables and then use these synthetic values and the residuals indexed 3 (corresponding to the third period) to determine the 3rd value for the six variables and so on..
How may I do this efficiently?
Any help would be much appreciated!