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],

plt.rcParams['figure.figsize'] = (20, 40)
num_periods = 10
ir = mod.irf(periods=num_periods)

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.

  • $\begingroup$ From a quick look, the function BaseIRAnalysis.plot_cum_effects reads the property lr_effects, but it is not set at all in the constructor of BaseIRAnalysis when the parameter vecm is True. 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.