Post by j***@gmail.comPost by rriveralIs it possible to develop, would make sense? and if it does, how long you
think it would take? just to evaluate if I can offer some help in order to
get it fully devloped...
My guess would be that it is theoretically easy, for the actual code it's
necessary to check how easy it is to wire it up, i.e. connect the pieces.
AFAIK, SVAR is just VAR with parameter restrictions. So after the SVAR
parameters have been estimated, we can just reuse the existing VAR post
estimation tools.
thinking again: SVAR is in general a simultaneous equation system, so we
might need to find the reduced form first to bring it into the VAR
representation.
I'm not sure this is just premultiplying by inv(A). but it seems like it
https://en.wikipedia.org/wiki/Vector_autoregression#Reduced-form_VAR
I haven't looked at this area since I merged VECM, so I need to check to
figure out how this can work or to answer questions about the
implementation.
For example VECM has a helper method to create the short term VAR model,
but might reestimate the model which we cannot do for SVAR.
how long it would take is difficult to tell
One day to figure out what to do. One day coding, One to five days of
getting all the pieces to work correctly and unit tests. Maybe double or
triple that if there are unforseen problems, bugs, corner cases, .... Maybe
less if all pieces fit together well.
(And possibly 3 weeks getting lost in background readings about other
things that would be useful to add. Maybe that part is just me.)
AFAICS, after browsing the code a bit:
SVARResults should have all the required intermediates as attributes If
there are some missing, then they need to be attached.
First step is to get the VAR representation, i.e. depending only on past
values.
then for forecast it looks like there are two options
- full support by creating a VARResults instance, similar to the last lines
of VAR._estimate_var or
- support only forecasting using the standalone function in var_model.py.
The predict method in VECMResults that does this is quite large because it
needs to prepare all the special arrays for the explanatory variables, I
think in SVAR it would be shorter.
one question: in-sample prediction or out of sample forecasting
in-sample prediction are just the residuals of the equivalent OLS/linear
equation
out of sample forecasting requires the handling of the new regressors and
needs to be recursive for h-step ahead prediction.
aside: I still don't find the naming in the VAR/SVAR neighborhood easy to
understand, as a casual, hit-and-run developer.
Josef
Post by j***@gmail.comJosef
Post by rriveralPost by j***@gmail.comPost by Bingjie HanI tried to do in-sample prediction of SVAR model after I fitted the
SVAR model by SVAR().fit().
'SVARResults' object has no attribute 'predict'
This is so weird because I just did the similar thing with VARX model
by using VARMAXResults.predict(). So, how should I do if I want to do
in-sample prediction of SVAR model?
I have no idea how to do prediction or forecasting in SVAR. We don't
have an issue for it and, AFAIR, it never came up. The Stata manual doesn't
mention how prediction and forecasting is done and just refers to the
general forecast function.
I'm not sure that there is anything extra in doing prediction with SVAR
compared to using VAR. The lag coefficients are the same, or maybe an
equivalent reparameterization. That is, I'm not sure whether using SVAR
changes the forecasts or just the forecast error decomposition.
Even if that's the case we need a predict function or at least some
answers in the docs. A brief google search for "forecasting with SVAR"
doesn't find anything that provides a quick answer, AFAICS.
SVAR is partially unfinished and has never been fully reviewed. There
are known problems and missing unit tests in at least some of the SVAR IRF
code.
(SVAR is one area where I never tried to figure out the theory.)
Josef