0

I am helping a friend with their thesis in statistics and we need to make a SVAR. I have the following output from VAR which I want to use as an input to SVAR (Not sure if that is the correct input) but any input of any dimension I send into SVAR executes but gives the following error when I try to run .fit() on it:

ValueError: shape mismatch: value array of shape (0,) could not be broadcast to indexing result of shape (0,6,6)

The code I have is displayed below, what is the issue and is there a better way to collect the data from SVAR to then visualize it? Should the input be different?

svarinput = [
 [ 1.000000, -0.587525, -0.554453, 0.306329, 0.218910, 0.013468],
 [-0.587525, 1.000000, 0.528954, -0.130117, -0.105632, -0.016493],
 [-0.554453, 0.528954, 1.000000, 0.041466, -0.103796, 0.097468],
 [ 0.306329, -0.130117, 0.041466, 1.000000, 0.265418, 0.068111],
 [ 0.218910, -0.105632, -0.103796, 0.265418, 1.000000, 0.043339],
 [ 0.013468, -0.016493, 0.097468, 0.068111, 0.043339, 1.000000]
]
# # Define your restriction matrix
A = np.array([
 [1, 0, 0, 0, 0, 0], # Housing Index
 [0, 1, 0, 0, 0, 0], # Policy Rate
 [0, 1, 1, 0, 0, 0], # Mortgage Rates
 [0, 0, 0, 1, 0, 0], # Inflation
 [0, 0, 0, 0, 1, 0], # Household Debt
 [0, 0, 0, 0, 0, 1] # Covered Bonds
])
# # # Create SVAR model with the VAR fit and your restriction matrix
# # svar_model = SVAR(var_fit, A=restriction_matrix, svar_type='A')
svar_model = SVAR(svarinput, svar_type='A',A=A)
svar_results = svar_model.fit()

I have a research question where the aim in to see how Housing Index is affected by a Central Banks purchases of covered bonds. My data consists of, Housing Index, Policy rate, Mortgage rates, Covered Bonds, Household Debt-to-GDP ratio and Inflation.

I planned to do the analysis in the following order and have finished only step 1-4.

  1. Akaike Information Criterion (selection lag - chose 1)
  2. Augmented Dickey Fuller test (test for stationary - did not have stationary in any variable except covered bonds)
  3. Johansen Cointegration test - Test for cointegration since the variables were not stationary
  4. Vector Error Correction Model - Since there was cointegration
  5. Structural Vector Autoregression Model
  6. Impulse Response Function - I understand this part but haven't come this far
  7. Forecast Error Variance Decomposition
asked May 24, 2024 at 11:31
2
  • Interesting question, but it's off topic here since it's conceptual in nature; try stats.stackexchange.com instead. Commented May 24, 2024 at 17:13
  • If you found statistical evidencie that your system is cointegrated, a SVAR would be mispecified most likely Commented Sep 19, 2024 at 16:35

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.