I am using the following code to conduct a SVAR estimation but it keeps crashing, always the same kind of error:
len(A_guess) != n_masked_a: TypeError: object of type 'int' has no len().
CAN ANYONE HELP?
`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()`
I tried to use the optional parameteres A_guess myself and trying to only using A or B, also using NAN and NONE instead of 'E'.
svar_model.fit(2)is interpreted as A_guess which is an integer instead of array and has the wrong length. A has (n_masked_a=) 6 free parameters so A_guess should be a 1 dim array with 6 elements.svar_results = svar_model.fit(maxlags=5), however, the issue i encounter now isself.summary = self.make() buf.write(self._coef_table() + '\n'), _coef_table dim = k * model.k_ar + model.k_trend + model.k_exog_user