Re: Model of the US Economy: CointegratedVARModelHandbook
Posted: Thu Oct 17, 2024 5:13 am
Why?
tsay3p438.rpf: Tsay, Analysis of Financial Time Series, 3rd edition Example 8.6.5 from pp 438-442: forecasts multi-steps ahead from a Cointegrated VAR model. I see no problem the example.
Here's some advantages of forecasting from a VECM. And questions.
(a) LR Insight: VECM captures the LR equilibrium relationships between variables through cointegration.
(b) SR Dynamics: While focusing on LR relationships, VECM also accounts for SR fluctuations (via 1st diffs). This dual approach may allow for more accurate forecasts, as it considers both immediate SR reactions and gradual LR adjustments.
(c) ECM: The inclusion of ECT's helps to understand how swiftly and efficiently series return to their LR equilibrium after a shock. Potentially crucial for decision-makers.
alpha = speed of adjustment: represents how quickly the system corrects any deviation from the LR equilibrium i.e. the proportion of equilibrium error corrected in each period, thus guiding the system back to stability. To calculate alpha regress delta(Y(t)) on (beta' * Y(t-1)) in the lag=1 case.
beta = LR equilibrium relationships: betas (or generalized eigenvectors) represent the coefficients forming the cointegration vectors (ECT's = beta' * Y(t-1)) that define the LR relationships among the variables. They tell us about the equilibrium level itself, rather than how quickly deviations from that equilibrium are corrected i.e. the alphas.
alpha*beta' = PI matrix. PI matrix can also be calculated from the VAR as-well i.e. PI = ((PI1 + PI2 + ... + PIk)-I)). And it's from the PI that the generalized e-values and e-vectors are calculated. But why a generalized eigen-analysis and not standard?
(d) Enhanced Forecast Accuracy: By integrating both SR (1st diffs) and LR (levels) information a VECM may yield more accurate forecasts compared to models that focus on only one aspect e.g. a VAR in levels or a VAR in 1st diffs. VECM's are a broad-based approach that can improve planning and decision-making processes.
(e) Multivariate Capability: VECM's handle multiple time series variables simultaneously, making them ideal for analyzing systems where variables are interdependent. This multivariate analysis (as opposed to just univariate analysis) is crucial in capturing the complexity and interconnections in economic, financial, and other related data.
A disadvantage of forecasting from a VAR or VECM: is a lay-man could say "very wide fans" especially for multi-step ahead forecasts using quartley data (not so much with static one-step). Are there ways to circumvent these?
TomDoan wrote: ↑Tue Oct 15, 2024 1:52 pm Needless to say, rolling sample estimation of a model which is not designed to forecast in the first place is a bad idea. And besides that, pre-test model selection (depending upon test result, choose between models A and B) is generally a bad idea as it makes the forecasts a highly discontinuous function of the data (small change to the data can flip the test result) which increases the chances of serious forecast errors. That's not as big an issue with a univariate model since e.g. different ARMA models can produce almost identical forecasts. With a multivariate model, that's a bigger deal; rank 2 vs rank 3 may have very significant differences in the relationship among the series.
Based on those advantages, I would still like to be able to do a rolling analysis in RATS.TomDoan wrote: ↑Tue Oct 15, 2024 1:52 pm @JOHMLE has an ECT option which defines a VECT[EQUATION] which can be used on the ECT instruction when you have (potentially) more than one cointegration vector. See the SHORTANDLONGVECM.RPF example.
In SHORTANDLONGVECM.RPF to use ECT=ecteqns the assumed rank of the cointegration space needs to be set: I don't know the rank via the lambda(trace) statistics without looking at the output table as described previously. I need to set something like %%COINTRANK dynamically within the loop -- and there's also the lambda(Max) statistics.
Here's the static loop, how do I incorporate varying RANK=%%COINTRANK and ECT=ecteqns? They will affect the dimensions of the VECTORS, DUALVECTORS and LOADINGS matrices.
Code: Select all
dec vect[series] VECMFOR_S(5)
dec vect[series] VECMERRORS_S(5)
do regend = begin, end
*
@johmle(lags=5,det=rc,eigenvalues=evalues_S,vectors=evectors_S,loadings=loadings_S) regstart regend; * 5 variables no cv=cv
# series1 series2 series3 series4 series5
disp "evalues_S:" evalues_S; * eigenvalues
disp "evectors_S:" evectors_S; * beta's
disp "loadings_S:" loadings_S; * alpha's
comp PI_S = loadings_S*tr(evectors_S); disp "PI_S:" PI_S; * PI matrix
equation(coeffs=%xcol(evectors_S,1)) ect1_S *
# series1 series2 series3 series4 series5 constant
equation(coeffs=%xcol(evectors_S,2)) ect2_S *
# series1 series2 series3 series4 series5 constant
equation(coeffs=%xcol(evectors_S,3)) ect3_S *
# series1 series2 series3 series4 series5 constant
equation(coeffs=%xcol(evectors_S,4)) ect4_S *
# series1 series2 series3 series4 series5 constant
equation(coeffs=%xcol(evectors_S,5)) ect5_S *
# series1 series2 series3 series4 series5 constant
system(model=ectmodel)
variables series1 series2 series3 series4 series5; * specify the variables in levels
lags 1 2 3 4 5; * 5 lagged levels are equivalent to 4 lagged changes
ect ect1_S ect2_S; * include the error correction terms
end(system)
estimate(residuals=resids_S,noftests) regstart regend
*
*@regcrits; * CANNOT COMPARE VAR AND VECM IC
*
display "Residual covariance matrix = " ##.#### %sigma
display "Residual correlation matrix = " ##.#### %cvtocorr(%sigma)
display "Log likelihood = " %logl
display "Log determinant = " %logdet
*
*
FORECAST(MODEL=ectmodel,RESULTS=VECMFOR_S,STDERRS=VECMERRORS_S,static,steps=1) regend+1
*
end do regend