Hello everybody
I’m going to estimate an SVAR model (Model A) of 6 variables using the following code:
import statsmodels.api as sm
from statsmodels.tsa.api import SVAR
A = np.zeros((6, 6)) # Initialize A matrix
Impose constraints from theoretical restrictions
A[0,:] = [1, 0, 0, 0, 0, 0] # Oil
A[1,:] = [0, 1, 0, 1, 0, 1] # M2
A[2,:] = [1, 1, 1, 0, 0, 0] # ER
A[3,:] = [0, 1, 1, 1, 0, 1] # Inf
A[4,:] = [1, 0, 1, 0, 1, 1] # YTM
A[5,:] = [0, 1, 1, 1, 1, 1] # TPX
svar_model = SVAR(df, svar_type=“A”, A=A)
svar_results = svar_model.fit(maxlags=4, solver=‘ncg’, trend=“ct”, maxiter=10000, maxfun=1000) # the problem is here
The last line caused the following error:
ValueError: shape mismatch: value array of shape (0,) could not be broadcast to indexing result of shape (0,6,6)
Could you please help me?