0

I am using the following code to conduct a SVAR estimation:

data_q = pd.DataFrame({'GDP': GDP,
                       'CPI': CPI_q, 
                       'Interest_rate': Interest_rate_q, 
                       'Unemployment_rate': Unemployment_rate_q, 
                       'Yearly_inflation': Yearly_inflation_q}).dropna()

#SVAR model
A = np.array([
    [1, 0, 0, 0],
    ['E', 1, 0, 0],
    ['E', 'E', 1, 0],
    ['E', 'E', 'E', 1]
])
B = np.array([
    [1, 0, 0, 0],
    ['E', 1, 0, 0],
    ['E', 'E', 1, 0],
    ['E', 'E', 'E', 1]
])

endogenous_vars = ['GDP', 'Interest_rate', 'Unemployment_rate', 'Yearly_inflation']
exogenous_vars=["CPI"]

svar_model = SVAR(data_q[endogenous_vars], svar_type='AB', A=A, B=B)
svar_results = svar_model.fit(2)
print(svar_results.summary(), '\n')

irf_svar = svar_results.irf(10)
irf_svar.plot(orth=True)
plt.show()

but it keeps crashing, always the same kind of error:

`self.summary = self.make()`

buf.write(self._coef_table() + '\n')

dim = k * model.k_ar + model.k_trend + model.k_exog_user

AttributeError: 'SVARResults' object has no attribute 'k_exog_user'

I tried to change the matrices A and B, the type of SVAR and including optional parameters, but stil does not work.

1

1 Answer 1

0

This is currently a bug in statsmodels.

work around: assign svar_results.k_exog_user = 0 before calling summary

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.