重要事項 Import Notes

重要事項 Import Notes
修習國際金融專題學生,
請務必參見 課程網頁維護重要事項 Import Notes
Registered students MUST see the Import Notes

2014-12-29

向量自迴歸 VAR 模型: 不連續落後期

來源:楊奕農的 using gretl in Taiwan 向量自迴歸 VAR 模型: 不連續落後期

向量自迴歸 VAR 模型有不連續落後期時,例如只有 1,2,4 (中間沒有 3), 在 gretl 1.9.13 (或 1.9.12 cvs build date 2013-05-06 以後之版本) 中指令的語法是 (目前2013/05/07 GUI 暫無法使用不連續落後期功能選項 ):
var p Ylist [; Xlist] –lagselect
p: 最大落後期數; 或不連續落後期之矩陣
Ylist: 內生變數集
Xlist: 外生變數集
–lagselect: 自動列出從落後 1-p 期之 AIC、BIC、HQC 之最小值落後期數
var 最大落後期數|{不連續整數} 自變數1  自變數2  [變數集…]  [–lagselect]
例子1:
var 4 y1 y2 y3
例子2:一部份落後期連續
 
 var {1,2,4,8} x1 x2 x3
相當於
matrix p={1,2,4,8} #數字間不加逗號好像也可以
list ylist = x1 x2 x3
var p ylist

實例:

1
2
3
4
5
6
7
8
9
10
11
open data3-6
var {1,3,4} Ct Yt
# --- 再加入參數 --lagselect 會顯示
var {1,3,4} Ct Yt --lagselect
 
# --- 或像 Allin 建議的正式語法如下, 利用矩陣來放不連續的落後期數
#     (僅適用最新版,請安裝 gretl_install.exe 才能用喔)
 matrix p = {1,3,4}
 list Ylist= Ct Yt
 var p Ylist         # give a named vector
 var {1,3,4} Ylist   # give an inline vector
執行結果 (以上 1-4行):
gretl 版本: 1.9.12cvs
Current session: 2013-05-07 10:44
? open data3-6

讀取資料檔 C:\Program Files\gretl\data\data3-6.gdt
periodicity: 1, 最大樣本數: 36
樣本區間範圍: 從 1959 到 1994

列出此檔之 3 個變數 (variables):
  0) const    1) Ct       2) Yt     

? var {1,3,4} Ct Yt

向量自我迴歸 (VAR system), 落後期數: 4
OLS 估計值, 使用中之子樣本範圍 1963-1994 (樣本總數 T = 32)
Log-likelihood = -412.49684
共變數矩陣行列式 (determinant) = 5.3903901e+008
AIC = 26.6561
BIC = 27.2973
HQC = 26.8686
Portmanteau test: LB(8) = 27.8696, 自由度 = 16 [0.0328]

方程式 (Equation) 1: Ct

             coefficient   std. error     t-值     p-value 
  --------------------------------------------------------
  const      594.104       256.644       2.315    0.0291   **
  Ct_1         1.29489       0.251793    5.143    2.58e-05 ***
  Ct_3        -0.619733      0.342839   -1.808    0.0827   *
  Ct_4        -0.181461      0.379568   -0.4781   0.6368  
  Yt_1        -0.402895      0.284435   -1.416    0.1690  
  Yt_3         0.458107      0.315506    1.452    0.1589  
  Yt_4         0.388387      0.339379    1.144    0.2633  

Mean dependent var   13053.00   S.D. dependent var   2611.769
Sum squared resid     1109617   S.E. of regression   210.6767
R-squared            0.994753   Adjusted R-squared   0.993493
F(6, 25)             789.8816   P-value(F)           3.06e-27
rho                  0.165054   Durbin-Watson        1.653857

此方程式, 係數=0 之 F檢定結果 (F-tests of zero restrictions):

Ct 變數之所有落後期                  F(3, 25) =   8.9042 [0.0003]
Yt 變數之所有落後期                  F(3, 25) =   2.0827 [0.1280]
所有變數,落後期數: 4                 F(2, 25) =   1.3760 [0.2711]

方程式 (Equation) 2: Yt

             coefficient   std. error     t-值     p-value
  -------------------------------------------------------
  const      951.990       254.219       3.745    0.0010  ***
  Ct_1         0.686912      0.249414    2.754    0.0108  **
  Ct_3        -0.674482      0.339600   -1.986    0.0581  *
  Ct_4        -0.367460      0.375982   -0.9773   0.3378 
  Yt_1         0.179534      0.281747    0.6372   0.5298 
  Yt_3         0.639429      0.312524    2.046    0.0514  *
  Yt_4         0.462694      0.336172    1.376    0.1809 

Mean dependent var   14429.75   S.D. dependent var   2742.131
Sum squared resid     1088746   S.E. of regression   208.6860
R-squared            0.995329   Adjusted R-squared   0.994208
F(6, 25)             887.9057   P-value(F)           7.15e-28
rho                 -0.046025   Durbin-Watson        2.032879

此方程式, 係數=0 之 F檢定結果 (F-tests of zero restrictions):

Ct 變數之所有落後期                  F(3, 25) =   4.7140 [0.0097]
Yt 變數之所有落後期                  F(3, 25) =   9.0709 [0.0003]
所有變數,落後期數: 4                 F(2, 25) =   1.1007 [0.3482]

對整個向量自迴歸 (VAR) 來看:

  虛無假設 H0 : VAR 之最大落後期是 3
  對立假設 H1 : VAR 之最大落後期是 4
  概似值比例檢定 (Likelihood ratio test): 卡方分配 (Chi-square)(4) = 4.42153 [0.3520]

  資訊準則 (information criteria) 之比較:
  落後期 4: AIC = 26.6561, BIC = 27.2973, HQC = 26.8686
  落後期 3: AIC = 26.5442, BIC = 27.0023, HQC = 26.6961

# --- 再加入參數 --lagselect 會顯示
? var {1,3,4} Ct Yt --lagselect
向量自我迴歸 (VAR system), 所選之最大落後期數: 4

The asterisks below indicate the best (that is, minimized) values
of the respective information criteria, AIC = Akaike criterion,
BIC = Schwarz Bayesian criterion and HQC = Hannan-Quinn criterion.

lags        loglik    p(LR)       AIC          BIC          HQC

   1    -511.19599            32.074749    32.166358    32.105115 
   2    -420.50726  0.00000   26.656704    26.931529*   26.747801 
   3    -414.70761  0.02059   26.544225*   27.002268    26.696054*
   4    -412.49684  0.35195   26.656053    27.297312    26.868612

PO 文注意事項 (Notes about your posts required for this course)

每位同學必需建立與維護 2 個網頁: (updated on 2010.9.19)
Every registered student MUST post and maintain TWO pages at this site.

1. 你的期末報告想要仿照的原始 paper 重點摘要頁, 見 [
範例]
A summary of the paper you choose to follow in your term-project. (see a suggestive [summary example ]).

2. 你的學習紀錄頁, 見 [範例]
A "learning weblog" of your progress during this course (see [example]). This example is demonstrative rather than required to conform to.

3. 記得每一頁要在頁尾處輸入你的「標籤」, 包含學號後5碼, 名字或暱稱, 和 其它你自訂的關鍵字, 例 ADF、共整合、PPP、等
When you edit your pages, be sure to write appropriate "Tags" (as many as you wish) (around the bottom of editing screen) for your posted pages to let me identify your required contributions. The tags should at least include your last 5-digit student ID and keywords about the page.

4. 請同學在你所選的 paper 加上標籤:「已選」
If you have already decided a paper to follow and post a page for it. Please be sure to attach that page a specific tag named "selected or 已選." It is of course possible that two or more students may choose the same paper to follow as their term-project. BUT only one of them can be authorized to follow the specific paper. The decision will be based on a first-come-first-serve rule. That is, the one who posts the summary page of a paper gets the first priority to follow that paper posted with a tag named"selected" paper .

5. 在你的 學習紀錄頁加上標籤:學習記事
Don't forget to stick a tag "weblog" with your "learning weblog" page in addition to your last 5-digit student ID.


== Posted on 2009.10.05 ==
請同學在你所選的 paper 加上
標籤:「已選」
在你的 學習紀錄頁加上標籤:學習記事