Analysis

2019年8月23日の結果
  • 日経平均株価の終値対始値比(\(x\))と東京市場ドル円レートの終値対始値比(\(y\))との線形モデル、その回帰係数が\(a\)であった場合(\(y=ax\)、切片は0)、15時時点(大引け時点)の日経平均株価が始値比で仮に1%上昇(下落)したとすると、その2時間後17時点のドル円レートは9時時点のドル円レートより\(a\)%上昇(下落)することを意味します。*終値対始値比:%。分母が始値、分子は終値。
  • 過去の解説動画
  • Ljung-Box 検定のラグは10としている。

時系列チャート 単位根検定 共和分検定 最小二乗法 一般化最小二乗法 散布図・QQプロット・残差の時系列推移

時系列チャート

[1] "USDJPY"
          Date   Open   High    Low  Close Center  Index CloseToOpen HighToLow    MA:25 DeviationRate Close:Diff(lag=1) Close:Ratio(lag=1)
854 2019-08-02 107.45 107.56 106.84 106.92 107.11 106.82      -0.493     0.674 108.1928         -1.18             -2.23             -2.043
855 2019-08-05 106.57 106.68 105.79 105.95 106.03 108.13      -0.582     0.841 108.1252         -2.01             -0.97             -0.907
856 2019-08-06 105.62 107.08 105.52 106.38 105.60 107.39       0.720     1.478 108.0472         -1.54              0.43              0.406
857 2019-08-07 106.33 106.45 105.94 106.30 106.15 107.79      -0.028     0.481 107.9684         -1.55             -0.08             -0.075
858 2019-08-08 106.11 106.32 106.00 106.11 106.11 107.80       0.000     0.302 107.9028         -1.66             -0.19             -0.179
859 2019-08-09 105.89 106.07 105.77 105.95 105.98 108.36       0.057     0.284 107.8284         -1.74             -0.16             -0.151
860 2019-08-13 105.38 105.58 105.13 105.20 105.43 107.17      -0.171     0.428 107.7140         -2.33             -0.75             -0.708
861 2019-08-14 106.61 106.70 106.24 106.45 106.36 108.24      -0.150     0.433 107.6380         -1.10              1.25              1.188
862 2019-08-15 105.92 106.77 105.76 106.25 105.93 108.02       0.312     0.955 107.5352         -1.20             -0.20             -0.188
863 2019-08-16 106.10 106.27 106.03 106.17 106.15 107.78       0.066     0.226 107.4236         -1.17             -0.08             -0.075
864 2019-08-19 106.43 106.47 106.25 106.41 106.38 107.69      -0.019     0.207 107.3576         -0.88              0.24              0.226
865 2019-08-20 106.57 106.69 106.40 106.47 106.56 108.03      -0.094     0.273 107.2816         -0.76              0.06              0.056
866 2019-08-21 106.28 106.60 106.25 106.55 106.47 107.61       0.254     0.329 107.2208         -0.63              0.08              0.075
867 2019-08-22 106.60 106.65 106.30 106.45 106.45 107.98      -0.141     0.329 107.1480         -0.65             -0.10             -0.094
868 2019-08-23 106.47 106.67 106.43 106.65 106.55     NA       0.169     0.226 107.1032         -0.42              0.20              0.188
[1] "NIKKEI"
          Date     Open     High      Low    Close CloseToOpen HighToLow    MA:25 DeviationRate Close:Diff(lag=1) Close:Ratio(lag=1)
854 2019-08-02 21211.06 21211.06 20960.09 21087.16      -0.584     1.197 21558.60         -2.19           -453.83             -2.107
855 2019-08-05 20909.98 20941.83 20514.19 20720.29      -0.907     2.085 21536.37         -3.79           -366.87             -1.740
856 2019-08-06 20325.52 20607.83 20110.76 20585.31       1.278     2.472 21490.59         -4.21           -134.98             -0.651
857 2019-08-07 20548.07 20570.19 20406.52 20516.56      -0.153     0.802 21441.08         -4.31            -68.75             -0.334
858 2019-08-08 20529.29 20682.24 20462.98 20593.35       0.312     1.071 21399.29         -3.77             76.79              0.374
859 2019-08-09 20758.15 20782.06 20676.92 20684.82      -0.353     0.508 21358.58         -3.15             91.47              0.444
860 2019-08-13 20432.68 20503.38 20369.27 20455.44       0.111     0.658 21306.94         -4.00           -229.38             -1.109
861 2019-08-14 20669.99 20697.42 20581.17 20655.13      -0.072     0.565 21271.77         -2.90            199.69              0.976
862 2019-08-15 20324.25 20419.88 20184.85 20405.65       0.401     1.164 21225.39         -3.86           -249.48             -1.208
863 2019-08-16 20323.97 20465.71 20300.35 20418.81       0.467     0.815 21180.81         -3.60             13.16              0.064
864 2019-08-19 20590.47 20633.90 20502.66 20563.16      -0.133     0.640 21137.59         -2.72            144.35              0.707
865 2019-08-20 20605.35 20684.06 20582.01 20677.22       0.349     0.496 21097.25         -1.99            114.06              0.555
866 2019-08-21 20489.97 20626.05 20482.62 20618.57       0.628     0.700 21060.58         -2.10            -58.65             -0.284
867 2019-08-22 20706.07 20731.19 20584.29 20628.01      -0.377     0.714 21026.93         -1.90              9.44              0.046
868 2019-08-23 20579.98 20719.31 20579.98 20710.91       0.636     0.677 21013.52         -1.44             82.90              0.402

単位根検定
  • CADFtest {CADFtest}
Analysis period: 2019-05-30 ~ 2019-08-23,60days

$USDJPY_CloseToOpen

    ADF test

data:  x
ADF(1) = -7.9161, p-value = 0.00000005146
alternative hypothesis: true delta is less than 0
sample estimates:
    delta 
-1.523435 


$NIKKEI_CloseToOpen

    ADF test

data:  x
ADF(0) = -10.189, p-value = 0.0000000001433
alternative hypothesis: true delta is less than 0
sample estimates:
    delta 
-1.321351 

共和分検定
  • ca.po {urca}
Analysis period: 2019-05-30 ~ 2019-08-23,60days


######################################## 
# Phillips and Ouliaris Unit Root Test # 
######################################## 

Test of type Pu 
detrending of series none 


Call:
lm(formula = z[, 1] ~ z[, -1] - 1)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.44710 -0.16150 -0.02629  0.07275  0.42258 

Coefficients:
        Estimate Std. Error t value   Pr(>|t|)    
z[, -1]  0.23272    0.04502    5.17 0.00000293 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1828 on 59 degrees of freedom
Multiple R-squared:  0.3118,    Adjusted R-squared:  0.3001 
F-statistic: 26.72 on 1 and 59 DF,  p-value: 0.000002929


Value of test-statistic is: 40.4387 

Critical values of Pu are:
                  10pct    5pct    1pct
critical values 20.3933 25.9711 38.3413

最小二乗法
  • lm {stats}
  • dwtest {lmtest}
  • ks.test {stats}
  • confint {stats}
  • Box.test {stats}
  • 切片項\(\neq0\)
Analysis period: 2019-05-30 ~ 2019-08-23,60days


Call:
lm(formula = USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen, data = USDJPY_NIKKEI)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.40979 -0.12368  0.01014  0.11113  0.44666 

Coefficients:
                   Estimate Std. Error t value   Pr(>|t|)    
(Intercept)        -0.03993    0.02355  -1.696     0.0953 .  
NIKKEI_CloseToOpen  0.24513    0.04492   5.457 0.00000105 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.18 on 58 degrees of freedom
Multiple R-squared:  0.3393,    Adjusted R-squared:  0.3279 
F-statistic: 29.78 on 1 and 58 DF,  p-value: 0.000001049


-----------------------------------------------------------------------------

    Durbin-Watson test

data:  OLS_Model
DW = 2.0842, p-value = 0.6447
alternative hypothesis: true autocorrelation is greater than 0


-----------------------------------------------------------------------------

    One-sample Kolmogorov-Smirnov test

data:  ResidualsOLS
D = 0.049729, p-value = 0.9968
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                         2.5 %      97.5 %
(Intercept)        -0.08707878 0.007210899
NIKKEI_CloseToOpen  0.15521373 0.335042489

-----------------------------------------------------------------------------

    Box-Ljung test

data:  ResidualsOLS
X-squared = 12.437, df = 10, p-value = 0.2569
  • 切片項\(=0\)
Analysis period: 2019-05-30 ~ 2019-08-23,60days


Call:
lm(formula = USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen - 1, data = USDJPY_NIKKEI)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.44710 -0.16150 -0.02629  0.07275  0.42258 

Coefficients:
                   Estimate Std. Error t value   Pr(>|t|)    
NIKKEI_CloseToOpen  0.23272    0.04502    5.17 0.00000293 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1828 on 59 degrees of freedom
Multiple R-squared:  0.3118,    Adjusted R-squared:  0.3001 
F-statistic: 26.72 on 1 and 59 DF,  p-value: 0.000002929


-----------------------------------------------------------------------------

    Durbin-Watson test

data:  OLS_Model_no_intercept
DW = 1.9917, p-value = 0.5553
alternative hypothesis: true autocorrelation is greater than 0


-----------------------------------------------------------------------------

    One-sample Kolmogorov-Smirnov test

data:  ResidualsOLS_no_intercept
D = 0.13656, p-value = 0.1944
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                       2.5 %    97.5 %
NIKKEI_CloseToOpen 0.1426435 0.3228031

-----------------------------------------------------------------------------

    Box-Ljung test

data:  ResidualsOLS_no_intercept
X-squared = 12.692, df = 10, p-value = 0.2414

一般化最小二乗法
  • 切片項\(\neq0\)
Analysis period: 2019-05-30 ~ 2019-08-23,60days

Generalized least squares fit by REML
  Model: USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen 
  Data: USDJPY_NIKKEI 
        AIC       BIC   logLik
  -21.45022 -15.26889 13.72511

Coefficients:
                         Value  Std.Error   t-value p-value
(Intercept)        -0.03993394 0.02355219 -1.695551  0.0953
NIKKEI_CloseToOpen  0.24512811 0.04491862  5.457161  0.0000

 Correlation: 
                   (Intr)
NIKKEI_CloseToOpen -0.163

Standardized residuals:
        Min          Q1         Med          Q3         Max 
-2.27662033 -0.68709796  0.05632884  0.61737766  2.48146726 

Residual standard error: 0.1799984 
Degrees of freedom: 60 total; 58 residual

-----------------------------------------------------------------------------

    One-sample Kolmogorov-Smirnov test

data:  ResidualsGLS
D = 0.049729, p-value = 0.9968
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                         2.5 %      97.5 %
(Intercept)        -0.08609539 0.006227513
NIKKEI_CloseToOpen  0.15708924 0.333166980

-----------------------------------------------------------------------------

    Box-Ljung test

data:  ResidualsGLS
X-squared = 12.437, df = 10, p-value = 0.2569
  • 切片項\(=0\)
Analysis period: 2019-05-30 ~ 2019-08-23,60days

Generalized least squares fit by REML
  Model: USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen - 1 
  Data: USDJPY_NIKKEI 
       AIC       BIC   logLik
  -26.2637 -22.10862 15.13185

Coefficients:
                       Value  Std.Error  t-value p-value
NIKKEI_CloseToOpen 0.2327233 0.04501748 5.169621       0

Standardized residuals:
       Min         Q1        Med         Q3        Max 
-2.4453855 -0.8833312 -0.1438159  0.3979117  2.3112490 

Residual standard error: 0.182836 
Degrees of freedom: 60 total; 59 residual

-----------------------------------------------------------------------------

    One-sample Kolmogorov-Smirnov test

data:  ResidualsGLS_no_intercept
D = 0.13656, p-value = 0.1944
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                       2.5 %    97.5 %
NIKKEI_CloseToOpen 0.1444907 0.3209559

-----------------------------------------------------------------------------

    Box-Ljung test

data:  ResidualsGLS_no_intercept
X-squared = 12.692, df = 10, p-value = 0.2414

散布図・QQプロット・残差の時系列推移
  • (注意)線形回帰の傾き(\(a\))、切片(\(b\))それぞれの検定統計量、p値に関わらず\(y=ax+b\)とした回帰直線やその残差を散布図、QQプロット等にプロットしています。
  • 切片項\(\neq0\)


  • 切片項\(=0\)


  • 残差の自己相関