アットウィキロゴ

TSA010

#参考 田中孝文[2008],19章

#データは内閣府HPよりDL入手

x <- read.csv("gdp_ex_sa.csv",skip=1)
ts.x <- ts(x,start=c(1980,1),frequency=4)#log
ip_or <- ts.x[,2]
ip_sa <- ts.x[,3]
par(mfrow=c(2,1))
ts.plot(ip_or);ts.plot(ip_sa)

library(urca)
#drift付RWの可能性
suitei1 <- summary(ur.df(ip_or,type="drift",lag=4));suitei1
#drift付RWの可能性
suitei2 <- summary(ur.df(ip_or,type="drift",lag=4));suitei2
#RWの可能性
suitei3 <- summary(ur.df(ip_or,type="none",lag=4));suitei3

・結果

suitei1


###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################

Test regression drift


Call:
lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)

Residuals:
     Min       1Q   Median       3Q      Max
-20744.2  -2400.8    287.3   2888.5  15995.2

Coefficients:
              Estimate Std. Error t value Pr(>|t|)  
(Intercept)  7.878e+03  2.909e+03   2.708  0.00785 **
z.lag.1     -1.358e-02  6.026e-03  -2.254  0.02619 *
z.diff.lag1  1.392e-01  9.312e-02   1.494  0.13793  
z.diff.lag2  6.655e-02  9.291e-02   0.716  0.47534  
z.diff.lag3  1.666e-01  9.290e-02   1.793  0.07569 .
z.diff.lag4 -1.600e-01  9.321e-02  -1.716  0.08896 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4754 on 110 degrees of freedom
Multiple R-squared: 0.1305,     Adjusted R-squared: 0.09099
F-statistic: 3.302 on 5 and 110 DF,  p-value: 0.008118


Value of test-statistic is: -2.2538 6.121

Critical values for test statistics:
      1pct  5pct 10pct
tau2 -3.46 -2.88 -2.57
phi1  6.52  4.63  3.

・z.diff.lag4の係数が有意か否か判断。

有意でない場合→lagを短くする

・Value of test-statistic is:

-2.2538(T値)

6.121(F値)

・”Value of test-statistic is”と"Critical values for test statistics"を比較する。

ex. 5%の場合

→-2.88以下が(π=0の)棄却域

→t値がそれに含まれない場合棄却できない。

 

・複合仮説

6.121(F値)と"Critical values for test statistics"を比較する。

ex.5%の場合 4.63以下が棄却域

 

suitei2

###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################

Test regression drift


Call:
lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)

Residuals:
     Min       1Q   Median       3Q      Max
-20744.2  -2400.8    287.3   2888.5  15995.2

Coefficients:
              Estimate Std. Error t value Pr(>|t|)  
(Intercept)  7.878e+03  2.909e+03   2.708  0.00785 **
z.lag.1     -1.358e-02  6.026e-03  -2.254  0.02619 *
z.diff.lag1  1.392e-01  9.312e-02   1.494  0.13793  
z.diff.lag2  6.655e-02  9.291e-02   0.716  0.47534  
z.diff.lag3  1.666e-01  9.290e-02   1.793  0.07569 .
z.diff.lag4 -1.600e-01  9.321e-02  -1.716  0.08896 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4754 on 110 degrees of freedom
Multiple R-squared: 0.1305,     Adjusted R-squared: 0.09099
F-statistic: 3.302 on 5 and 110 DF,  p-value: 0.008118


Value of test-statistic is: -2.2538 6.121

Critical values for test statistics:
      1pct  5pct 10pct
tau2 -3.46 -2.88 -2.57
phi1  6.52  4.63  3.81

・Value of test-statistic is: -2.2538 6.121

-2.2538(パイハットのt値)

 6.121(複合仮説のF値)

・パイハットのt値と"tau2 -3.46 -2.88 -2.57"とを比べる。

ex.5%の場合 -2.88以下が棄却域。この場合には棄却されない。

 

・複合仮説

 F値6.121とphi1を比較する。

ex.5%の場合4.63以上が棄却域。

この場合には棄却域に含まれる。

 suitei3

###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################

Test regression none


Call:
lm(formula = z.diff ~ z.lag.1 - 1 + z.diff.lag)

Residuals:
   Min     1Q Median     3Q    Max
-20507  -2498    958   2523  17644

Coefficients:
             Estimate Std. Error t value Pr(>|t|) 
z.lag.1      0.002458   0.001140   2.155   0.0333 *
z.diff.lag1  0.180376   0.094457   1.910   0.0588 .
z.diff.lag2  0.107743   0.094231   1.143   0.2553 
z.diff.lag3  0.210759   0.094032   2.241   0.0270 *
z.diff.lag4 -0.118331   0.094519  -1.252   0.2132 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4888 on 111 degrees of freedom
Multiple R-squared: 0.2128,     Adjusted R-squared: 0.1773
F-statistic: 5.999 on 5 and 111 DF,  p-value: 5.96e-05


Value of test-statistic is: 2.1552

Critical values for test statistics:
      1pct  5pct 10pct
tau1 -2.58 -1.95 -1.62

・t値(Value of test-statistic)とtau1 -2.58 -1.95 -1.62を比較する。

→ex.5%の場合-1.95 以下が棄却域。

 →左記では棄却できない、故に単位根を持つと判断される。

・差分の単位根


###############################################
# Augmented Dickey-Fuller Test Unit Root Test #
###############################################

Test regression drift


Call:
lm(formula = z.diff ~ z.lag.1 + 1 + z.diff.lag)

Residuals:
     Min       1Q   Median       3Q      Max
-20982.4  -2480.8    722.6   2319.4  16763.6

Coefficients:
              Estimate Std. Error t value Pr(>|t|)   
(Intercept)  1.448e+03  5.659e+02   2.558   0.0119 * 
z.lag.1     -6.733e-01  1.625e-01  -4.143 6.79e-05 ***
z.diff.lag1 -1.606e-01  1.519e-01  -1.057   0.2927   
z.diff.lag2 -6.940e-02  1.431e-01  -0.485   0.6285   
z.diff.lag3  1.300e-01  1.240e-01   1.048   0.2968   
z.diff.lag4  8.719e-04  9.732e-02   0.009   0.9929   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 4875 on 109 degrees of freedom
Multiple R-squared: 0.4446,     Adjusted R-squared: 0.4191
F-statistic: 17.45 on 5 and 109 DF,  p-value: 1.158e-12


Value of test-statistic is: -4.143 8.5885

Critical values for test statistics:
      1pct  5pct 10pct
tau2 -3.46 -2.88 -2.57
phi1  6.52  4.63  3.81

・"Value of test-statistic is"と"Critical values for test statistics"を比較する。

→ex.5%の場合 -2.88以下が棄却域。

→ -4.143(t値)が棄却域に含まれる。

→差分は単位根を持たない。

 

 

 

 

 

 

最終更新:2010年10月17日 23:45
添付ファイル