Perform statablility test on var (n) (n>2)

2 ビュー (過去 30 日間)
Nino C
Nino C 2023 年 10 月 18 日
コメント済み: Nino C 2023 年 10 月 20 日
I'd like to know if there is a way to recover the companion-form matrix from the estimation using "varm" from econometric toolbox? or I have to recover it using each matrix lag on the AR object. I need it to test stability of the var model
Thanks in advance!

回答 (1 件)

akshatsood
akshatsood 2023 年 10 月 19 日
Hi Nino,
As per my understanding, to recover the companion-form matrix from the estimation using the "varm" function in the Econometrics Toolbox, you can have direct access the estimated var model's coefficient matrix. The companion-form matrix is a rearrangement of the coefficient matrix where the lagged endogenous variables are stacked in a vertical manner. Here is a code snippet for your reference
model = varm(2, 2); % 2 lags and 2 endogenous variables
estModel = estimate(model, <input_data>);
% extract coefficient matrix for the first lag
coefficientMatrix = estModel.AR{1};
companionMatrix = [coefficientMatrix' eye(size(coefficientMatrix, 1) * (model.NumSeries - 1))];
In the approach demonstrated above, "estModel.AR{1}" returns the coefficient matrix for the first lag. The companion-form matrix is then constructed by stacking the transpose of the coefficient matrix vertically, followed by an identity matrix multiplied by the number of endogenous variables minus one.
I hope this helps.
  1 件のコメント
Nino C
Nino C 2023 年 10 月 20 日
Thanks for your quick response. I was wondering if there is a built-in way to do it in the toolbox, there isn't apparently. I would take your advice :]

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeVector Autoregression Models についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by