I am using statsmodels version '0.11.1'. I am trying to sum cumulative effects of using the impulse response function derived of a VECM, but I am getting an AttributeError regarding 'lr_effects'. As far as I am aware you should be able to retrieve the cumulative effects from an impulse response function derived from a VECM also right? Or am I missing something? My code:
from statsmodels.tsa.vector_ar.vecm import VECM
mod = VECM(endog=model_merged.rename(columns=rename_dict)[for_model],
k_ar_diff=3,
coint_rank=1,
deterministic='cili'
).fit()
mod.summary()`
plt.rcParams['figure.figsize'] = (20, 40)
num_periods = 10
ir = mod.irf(periods=num_periods)
ir.plot_cum_effects()
The error I receive is: AttributeError: 'IRAnalysis' object has no attribute 'lr_effects'
Plotting the regular impulse reponse function using ir.plot() does work. Thanks in advance.
BaseIRAnalysis.plot_cum_effects
reads the propertylr_effects
, but it is not set at all in the constructor ofBaseIRAnalysis
when the parametervecm
isTrue
. A comment implies that this is because "long-run effects may be infinite for VECMs". This is a bug, it should at least give a useful error, or since (from what I can tell)lr_effects
is only used for plotting, it should just not be included in the plot in that case. $\endgroup$ – Chris Haug Aug 19 '20 at 13:11