Analysis

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

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

時系列チャート

[1] "USDJPY"
          Date   Open   High    Low  Close Center  Index CloseToOpen HighToLow    MA:25 DeviationRate Close:Diff(lag=1) Close:Ratio(lag=1)
824 2019-06-20 108.11 108.14 107.47 107.68 107.65 104.81      -0.398     0.623 108.9300         -1.15             -0.71             -0.655
825 2019-06-21 107.31 107.53 107.05 107.46 107.10 104.80       0.140     0.448 108.8392         -1.27             -0.22             -0.204
826 2019-06-24 107.31 107.48 107.27 107.42 107.40 104.70       0.103     0.196 108.7312         -1.21             -0.04             -0.037
827 2019-06-25 107.34 107.41 106.78 107.05 107.00 104.93      -0.270     0.590 108.6080         -1.43             -0.37             -0.344
828 2019-06-26 107.18 107.50 107.11 107.46 107.36 104.30       0.261     0.364 108.4916         -0.95              0.41              0.383
829 2019-06-27 107.75 108.15 107.64 108.05 108.08 104.24       0.278     0.474 108.4016         -0.32              0.59              0.549
830 2019-06-28 107.76 107.81 107.57 107.64 107.68 104.11      -0.111     0.223 108.3256         -0.63             -0.41             -0.379
831 2019-07-01 108.38 108.53 108.11 108.33 108.24 103.66      -0.046     0.388 108.2756          0.05              0.69              0.641
832 2019-07-02 108.38 108.47 108.24 108.27 108.42 104.32      -0.101     0.212 108.2296          0.04             -0.06             -0.055
833 2019-07-03 107.84 107.90 107.54 107.75 107.60 104.46      -0.083     0.335 108.1712         -0.39             -0.52             -0.480
834 2019-07-11 108.34 108.38 107.86 108.06 108.14 103.81      -0.258     0.482 108.1036         -0.04              0.31              0.288
835 2019-07-12 108.61 108.61 108.29 108.37 108.40 104.39      -0.221     0.296 108.0872          0.26              0.31              0.287
836 2019-07-16 107.91 108.10 107.83 108.07 107.95 104.17       0.148     0.250 108.0800         -0.01             -0.30             -0.277
837 2019-07-17 108.20 108.33 108.12 108.27 108.17 104.43       0.065     0.194 108.0888          0.17              0.20              0.185
838 2019-07-18 107.94 107.97 107.62 107.77 107.70     NA      -0.157     0.325 108.0696         -0.28             -0.50             -0.462
[1] "NIKKEI"
          Date     Open     High      Low    Close CloseToOpen HighToLow    MA:25 DeviationRate Close:Diff(lag=1) Close:Ratio(lag=1)
824 2019-06-20 21417.74 21491.39 21377.27 21462.86       0.211     0.534 21045.23          1.98            128.99              0.605
825 2019-06-21 21487.67 21497.82 21221.70 21258.64      -1.066     1.301 21045.58          1.01           -204.22             -0.952
826 2019-06-24 21223.56 21317.86 21185.67 21285.99       0.294     0.624 21044.95          1.15             27.35              0.129
827 2019-06-25 21238.07 21313.77 21114.47 21193.81      -0.208     0.944 21041.80          0.72            -92.18             -0.433
828 2019-06-26 21067.68 21129.64 21035.84 21086.59       0.090     0.446 21033.93          0.25           -107.22             -0.506
829 2019-06-27 21156.88 21338.17 21123.97 21338.17       0.857     1.014 21041.41          1.41            251.58              1.193
830 2019-06-28 21282.22 21324.93 21199.85 21275.92      -0.030     0.590 21047.76          1.08            -62.25             -0.292
831 2019-07-01 21566.27 21758.34 21559.17 21729.97       0.759     0.924 21069.65          3.13            454.05              2.134
832 2019-07-02 21699.43 21784.22 21697.31 21754.27       0.253     0.401 21089.42          3.15             24.30              0.112
833 2019-07-03 21684.07 21708.72 21566.65 21638.16      -0.212     0.659 21114.81          2.48           -116.11             -0.534
834 2019-07-11 21547.19 21649.93 21532.57 21643.53       0.447     0.545 21347.29          1.39            110.05              0.511
835 2019-07-12 21720.14 21720.14 21589.83 21685.90      -0.158     0.604 21379.34          1.43             42.37              0.196
836 2019-07-16 21644.38 21655.52 21514.89 21535.25      -0.504     0.654 21395.37          0.65           -150.65             -0.695
837 2019-07-17 21474.63 21488.27 21380.55 21469.18      -0.025     0.504 21405.97          0.30            -66.07             -0.307
838 2019-07-18 21336.80 21347.84 20993.44 21046.24      -1.362     1.688 21402.63         -1.67           -422.94             -1.970

単位根検定
  • CADFtest {CADFtest}
Analysis period: 2019-04-10 ~ 2019-07-18,60days

$USDJPY_CloseToOpen

    ADF test

data:  x
ADF(0) = -8.1487, p-value = 0.00000002517
alternative hypothesis: true delta is less than 0
sample estimates:
    delta 
-1.091416 


$NIKKEI_CloseToOpen

    ADF test

data:  x
ADF(0) = -7.6912, p-value = 0.0000001046
alternative hypothesis: true delta is less than 0
sample estimates:
    delta 
-1.119305 

共和分検定
  • ca.po {urca}
Analysis period: 2019-04-10 ~ 2019-07-18,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.42606 -0.13529 -0.04345  0.05086  0.35084 

Coefficients:
        Estimate Std. Error t value Pr(>|t|)   
z[, -1]  0.13300    0.04447   2.991  0.00406 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1658 on 59 degrees of freedom
Multiple R-squared:  0.1316,    Adjusted R-squared:  0.1169 
F-statistic: 8.945 on 1 and 59 DF,  p-value: 0.004055


Value of test-statistic is: 57.3856 

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-04-10 ~ 2019-07-18,60days


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

Residuals:
     Min       1Q   Median       3Q      Max 
-0.38232 -0.09179  0.00116  0.09726  0.39051 

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)   
(Intercept)        -0.04492    0.02081  -2.159  0.03502 * 
NIKKEI_CloseToOpen  0.13859    0.04323   3.206  0.00219 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1609 on 58 degrees of freedom
Multiple R-squared:  0.1505,    Adjusted R-squared:  0.1359 
F-statistic: 10.28 on 1 and 58 DF,  p-value: 0.002192


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

    Durbin-Watson test

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


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

    One-sample Kolmogorov-Smirnov test

data:  ResidualsOLS
D = 0.075338, p-value = 0.8598
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                         2.5 %       97.5 %
(Intercept)        -0.08658254 -0.003266704
NIKKEI_CloseToOpen  0.05205175  0.225121135

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

    Box-Ljung test

data:  ResidualsOLS
X-squared = 0.59791, df = 1, p-value = 0.4394
  • 切片項\(=0\)
Analysis period: 2019-04-10 ~ 2019-07-18,60days


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

Residuals:
     Min       1Q   Median       3Q      Max 
-0.42606 -0.13529 -0.04345  0.05086  0.35084 

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)   
NIKKEI_CloseToOpen  0.13300    0.04447   2.991  0.00406 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1658 on 59 degrees of freedom
Multiple R-squared:  0.1316,    Adjusted R-squared:  0.1169 
F-statistic: 8.945 on 1 and 59 DF,  p-value: 0.004055


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

    Durbin-Watson test

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


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

    One-sample Kolmogorov-Smirnov test

data:  ResidualsOLS_no_intercept
D = 0.075022, p-value = 0.8631
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                        2.5 %  97.5 %
NIKKEI_CloseToOpen 0.04401705 0.22199

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

    Box-Ljung test

data:  ResidualsOLS_no_intercept
X-squared = 0.57829, df = 1, p-value = 0.447

一般化最小二乗法
  • 切片項\(\neq0\)
Analysis period: 2019-04-10 ~ 2019-07-18,60days

Generalized least squares fit by REML
  Model: USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen 
  Data: USDJPY_NIKKEI 
        AIC       BIC   logLik
  -35.95255 -25.65034 22.97628

Correlation Structure: ARMA(1,1)
 Formula: ~1 
 Parameter estimate(s):
      Phi1     Theta1 
 0.6655783 -0.9716132 

Coefficients:
                         Value  Std.Error    t-value p-value
(Intercept)        -0.04853335 0.00369765 -13.125468   0.000
NIKKEI_CloseToOpen  0.13907596 0.04027534   3.453129   0.001

 Correlation: 
                   (Intr)
NIKKEI_CloseToOpen -0.43 

Standardized residuals:
        Min          Q1         Med          Q3         Max 
-2.37759289 -0.55431633  0.02978239  0.63391782  2.47080574 

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

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

    One-sample Kolmogorov-Smirnov test

data:  ResidualsGLS
D = 0.075369, p-value = 0.8595
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                         2.5 %     97.5 %
(Intercept)        -0.05578061 -0.0412861
NIKKEI_CloseToOpen  0.06013775  0.2180142

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

    Box-Ljung test

data:  ResidualsGLS
X-squared = 0.59964, df = 1, p-value = 0.4387
  • 切片項\(=0\)
Analysis period: 2019-04-10 ~ 2019-07-18,60days

Generalized least squares fit by REML
  Model: USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen - 1 
  Data: USDJPY_NIKKEI 
        AIC       BIC   logLik
  -37.95512 -33.80004 20.97756

Coefficients:
                       Value Std.Error  t-value p-value
NIKKEI_CloseToOpen 0.1330035 0.0444711 2.990785  0.0041

Standardized residuals:
       Min         Q1        Med         Q3        Max 
-2.5692940 -0.8158194 -0.2620058  0.3067189  2.1156942 

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

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

    One-sample Kolmogorov-Smirnov test

data:  ResidualsGLS_no_intercept
D = 0.075022, p-value = 0.8631
alternative hypothesis: two-sided


-----------------------------------------------------------------------------
                        2.5 %    97.5 %
NIKKEI_CloseToOpen 0.04584176 0.2201653

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

    Box-Ljung test

data:  ResidualsGLS_no_intercept
X-squared = 0.57829, df = 1, p-value = 0.447

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


  • 切片項\(=0\)