Imposing constraints on coefficient matrix in VAR

44 views
Skip to first unread message
Message has been deleted

saywhat

unread,
May 22, 2021, 7:38:07 PM5/22/21
to pystatsmodels

https://www.statsmodels.org/stable/generated/statsmodels.tsa.vector_ar.var_model.VAR.html

I want to impose constraints on the coefficient matrix. For example, in VAR(1), Yt = (A1) (Yt-1) + E, A1= [a11, a12; a21, a22], how to impose submatrix a21 = 0 since I already know one granger cause the other, but not the other way around before running the model? I also want granger causality test to reflect that too, e.g. give me 0 for those coefficients and NaN for the grangers_causation_matrix. In an economic scene, the number of patients will have a position influence on the price of a medicine, but the price of a medicine will not affect the number of patients in any way. I want to incorporate this information into the model before I run it. Does anyone know how to do it? Thanks

Chad Fulton

unread,
May 23, 2021, 11:21:55 AM5/23/21
to Statsmodels Mailing List
Hello,

As far as I know, we do not have the option for constraints in the VAR models. One option would be to estimate the coefficients using the SUR model from linearmodels (https://bashtage.github.io/linearmodels/system/system/linearmodels.system.model.SUR.html#linearmodels.system.model.SUR).

Best,
Chad

On Sat, May 22, 2021 at 7:38 PM saywhat <saint...@gmail.com> wrote:

https://www.statsmodels.org/stable/generated/statsmodels.tsa.vector_ar.var_model.VAR.html

I want to impose constraints on the coefficient matrix. For example, in VAR(1), Yt = (A1) (Yt-1) + E, A1= [a11, a12; a21, a22], how to impose submatrix a21 = 0 since I already know one granger cause the other, but not the other way around before running the model? I also want granger causality test to reflect that too, e.g. give me 0 for those coefficients and NaN for the grangers_causation_matrix. In an economic scene, the number of patients will have a position influence on the price of a medicine, but the price of a medicine will not affect the number of patients in any way. I want to incorporate this information into the model before I run it. Does anyone know how to do it? Thanks

--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/0fdb97e7-92f5-4974-8f70-c20acb0c9cc4n%40googlegroups.com.

saywhat

unread,
May 24, 2021, 4:26:20 PM5/24/21
to pystatsmodels
Hello,

Thanks for the reply. I'm thinking of a solution where I run the VAR on the subset of the variables Y', where they are Y' t=  (a22') (Y't-1) + E. Then run VAR on all the variables Yt = (A1) (Yt-1) + E. Then just take the coefficients from the first run to replace the coefficients from the second run. i.e. the new A1= [ a11, a12; 0, a22' ] . Then to calculate the predictions, I will use the coefficients to manually calculate the value, rolling forward. My concern is that if this method is mathematically consistent with the algorithm calculating the coefficients? e.g. whether mathematically the calculation of a11, a12 is affected by a21, a22?
Reply all
Reply to author
Forward
0 new messages