[1] "USDJPY"
Date Open High Low Close Center Index CloseToOpen HighToLow MA25 DeviationRate Close:Diff(lag=1) Close:Ratio(lag=1)
868 2019-08-23 106.47 106.67 106.43 106.65 106.55 109.07 0.169 0.226 107.1032 -0.42 0.20 0.188
869 2019-08-26 104.85 105.95 104.46 105.74 105.25 108.65 0.849 1.426 107.0268 -1.20 -0.91 -0.853
870 2019-08-27 105.97 106.15 105.60 105.74 105.84 109.13 -0.217 0.521 106.9416 -1.12 0.00 0.000
871 2019-08-28 105.75 105.89 105.65 105.74 105.79 108.85 -0.009 0.227 106.8468 -1.04 0.00 0.000
872 2019-08-29 106.09 106.17 105.83 106.11 105.92 108.32 0.019 0.321 106.7696 -0.62 0.37 0.350
873 2019-08-30 106.46 106.54 106.29 106.52 106.43 108.72 0.056 0.235 106.7080 -0.18 0.41 0.386
874 2019-09-02 106.14 106.28 105.94 106.26 106.16 108.98 0.113 0.321 106.6132 -0.33 -0.26 -0.244
875 2019-09-03 106.20 106.38 105.93 105.99 106.30 109.21 -0.198 0.425 106.5068 -0.49 -0.27 -0.254
876 2019-09-04 105.86 106.25 105.83 106.24 105.99 108.28 0.359 0.397 106.4104 -0.16 0.25 0.236
877 2019-09-05 106.35 106.75 106.33 106.52 106.40 107.70 0.160 0.395 106.3288 0.18 0.28 0.264
878 2019-09-06 107.07 107.10 106.92 106.98 107.05 107.45 -0.084 0.168 106.2420 0.69 0.46 0.432
879 2019-09-09 106.95 107.02 106.76 106.97 106.95 107.12 0.019 0.244 106.2440 0.68 -0.01 -0.009
880 2019-09-10 107.33 107.50 107.19 107.33 107.43 106.77 0.000 0.289 106.2992 0.97 0.36 0.337
881 2019-09-11 107.60 107.85 107.50 107.81 107.64 106.54 0.195 0.326 106.3564 1.37 0.48 0.447
882 2019-09-12 108.02 108.17 107.79 107.91 108.03 NA -0.102 0.353 106.4208 1.40 0.10 0.093
[1] "NIKKEI"
Date Open High Low Close CloseToOpen HighToLow MA25 DeviationRate Close:Diff(lag=1) Close:Ratio(lag=1)
868 2019-08-23 20579.98 20719.31 20579.98 20710.91 0.636 0.677 21013.52 -1.44 82.90 0.402
869 2019-08-26 20325.44 20329.01 20173.76 20261.04 -0.317 0.770 20965.28 -3.36 -449.87 -2.172
870 2019-08-27 20467.22 20529.94 20439.92 20456.08 -0.054 0.440 20926.85 -2.25 195.04 0.963
871 2019-08-28 20474.31 20511.21 20433.31 20479.42 0.025 0.381 20881.19 -1.92 23.34 0.114
872 2019-08-29 20500.50 20520.68 20361.12 20460.93 -0.193 0.784 20831.25 -1.78 -18.49 -0.090
873 2019-08-30 20641.49 20748.35 20633.30 20704.37 0.305 0.558 20789.16 -0.41 243.44 1.190
874 2019-09-02 20625.75 20667.56 20614.29 20620.19 -0.027 0.258 20747.64 -0.61 -84.18 -0.407
875 2019-09-03 20581.58 20662.23 20578.02 20625.16 0.212 0.409 20707.98 -0.40 4.97 0.024
876 2019-09-04 20578.67 20694.35 20554.16 20649.14 0.342 0.682 20665.57 -0.08 23.98 0.116
877 2019-09-05 20800.29 21164.61 20787.93 21085.94 1.373 1.812 20648.15 2.12 436.80 2.115
878 2019-09-06 21201.83 21241.29 21145.81 21199.57 -0.011 0.452 20634.49 2.74 113.63 0.539
879 2019-09-09 21214.56 21333.51 21182.26 21318.42 0.490 0.714 20643.74 3.27 118.85 0.561
880 2019-09-10 21363.57 21438.35 21350.35 21392.10 0.134 0.412 20670.61 3.49 73.68 0.346
881 2019-09-11 21466.66 21619.21 21437.82 21597.76 0.611 0.846 20711.11 4.28 205.66 0.961
882 2019-09-12 21761.09 21825.92 21743.96 21759.61 -0.007 0.377 20760.83 4.81 161.85 0.749
単位根検定・共和分検定
Analysis period: 2019-06-19 ~ 2019-09-12,60days
$USDJPY_CloseToOpen
ADF test
data: x
ADF(1) = -8.6388, p-value = 0.00000000598
alternative hypothesis: true delta is less than 0
sample estimates:
delta
-1.678313
$NIKKEI_CloseToOpen
ADF test
data: x
ADF(0) = -10.325, p-value = 0.0000000001107
alternative hypothesis: true delta is less than 0
sample estimates:
delta
-1.293477
Analysis period: 2019-06-19 ~ 2019-09-12,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.43763 -0.15127 -0.01163 0.08489 0.90853
Coefficients:
Estimate Std. Error t value Pr(>|t|)
z[, -1] 0.18780 0.05229 3.591 0.000671 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2169 on 59 degrees of freedom
Multiple R-squared: 0.1794, Adjusted R-squared: 0.1655
F-statistic: 12.9 on 1 and 59 DF, p-value: 0.0006713
Value of test-statistic is: 36.6741
Critical values of Pu are:
10pct 5pct 1pct
critical values 20.3933 25.9711 38.3413
最小二乗法
# 切片項 ≠ 0
Analysis period: 2019-06-19 ~ 2019-09-12,60days
Call:
lm(formula = USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen, data = USDJPY_NIKKEI)
Residuals:
Min 1Q Median 3Q Max
-0.42673 -0.14070 0.00163 0.09574 0.92203
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01194 0.02892 -0.413 0.681298
NIKKEI_CloseToOpen 0.19273 0.05400 3.569 0.000728 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2185 on 58 degrees of freedom
Multiple R-squared: 0.1801, Adjusted R-squared: 0.1659
F-statistic: 12.74 on 1 and 58 DF, p-value: 0.0007278
-----------------------------------------------------------------------------
Durbin-Watson test
data: OLS_Model
DW = 2.2494, p-value = 0.8441
alternative hypothesis: true autocorrelation is greater than 0
-----------------------------------------------------------------------------
One-sample Kolmogorov-Smirnov test
data: ResidualsOLS
D = 0.11844, p-value = 0.3419
alternative hypothesis: two-sided
-----------------------------------------------------------------------------
2.5 % 97.5 %
(Intercept) -0.06983422 0.04595719
NIKKEI_CloseToOpen 0.08462926 0.30083094
-----------------------------------------------------------------------------
Box-Ljung test
data: ResidualsOLS
X-squared = 14.408, df = 10, p-value = 0.1552
# 切片項 = 0
Analysis period: 2019-06-19 ~ 2019-09-12,60days
Call:
lm(formula = USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen - 1, data = USDJPY_NIKKEI)
Residuals:
Min 1Q Median 3Q Max
-0.43763 -0.15127 -0.01163 0.08489 0.90853
Coefficients:
Estimate Std. Error t value Pr(>|t|)
NIKKEI_CloseToOpen 0.18780 0.05229 3.591 0.000671 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2169 on 59 degrees of freedom
Multiple R-squared: 0.1794, Adjusted R-squared: 0.1655
F-statistic: 12.9 on 1 and 59 DF, p-value: 0.0006713
-----------------------------------------------------------------------------
Durbin-Watson test
data: OLS_Model_no_intercept
DW = 2.2437, p-value = 0.8675
alternative hypothesis: true autocorrelation is greater than 0
-----------------------------------------------------------------------------
One-sample Kolmogorov-Smirnov test
data: ResidualsOLS_no_intercept
D = 0.13137, p-value = 0.2306
alternative hypothesis: two-sided
-----------------------------------------------------------------------------
2.5 % 97.5 %
NIKKEI_CloseToOpen 0.08315798 0.292438
-----------------------------------------------------------------------------
Box-Ljung test
data: ResidualsOLS_no_intercept
X-squared = 14.576, df = 10, p-value = 0.1483
一般化最小二乗法
# 切片項 ≠ 0
Analysis period: 2019-06-19 ~ 2019-09-12,60days
Generalized least squares fit by REML
Model: USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen
Data: USDJPY_NIKKEI
AIC BIC logLik
1.04558 7.226909 2.47721
Coefficients:
Value Std.Error t-value p-value
(Intercept) -0.01193852 0.02892302 -0.412769 0.6813
NIKKEI_CloseToOpen 0.19273010 0.05400404 3.568809 0.0007
Correlation:
(Intr)
NIKKEI_CloseToOpen -0.221
Standardized residuals:
Min Q1 Med Q3 Max
-1.953129658 -0.643972723 0.007446421 0.438210047 4.220144536
Residual standard error: 0.218484
Degrees of freedom: 60 total; 58 residual
-----------------------------------------------------------------------------
One-sample Kolmogorov-Smirnov test
data: ResidualsGLS
D = 0.11844, p-value = 0.3419
alternative hypothesis: two-sided
-----------------------------------------------------------------------------
2.5 % 97.5 %
(Intercept) -0.06862659 0.04474955
NIKKEI_CloseToOpen 0.08688412 0.29857608
-----------------------------------------------------------------------------
Box-Ljung test
data: ResidualsGLS
X-squared = 14.408, df = 10, p-value = 0.1552
# 切片項 = 0
Analysis period: 2019-06-19 ~ 2019-09-12,60days
Generalized least squares fit by REML
Model: USDJPY_CloseToOpen ~ NIKKEI_CloseToOpen - 1
Data: USDJPY_NIKKEI
AIC BIC logLik
-6.448552 -0.21594 6.224276
Correlation Structure: ARMA(0,1)
Formula: ~1
Parameter estimate(s):
Theta1
-0.2756409
Coefficients:
Value Std.Error t-value p-value
NIKKEI_CloseToOpen 0.1770026 0.05169618 3.423901 0.0011
Standardized residuals:
Min Q1 Med Q3 Max
-1.97552320 -0.67286476 -0.05691899 0.38467445 4.10721379
Residual standard error: 0.2203708
Degrees of freedom: 60 total; 59 residual
-----------------------------------------------------------------------------
One-sample Kolmogorov-Smirnov test
data: ResidualsGLS_no_intercept
D = 0.11799, p-value = 0.3464
alternative hypothesis: two-sided
-----------------------------------------------------------------------------
2.5 % 97.5 %
NIKKEI_CloseToOpen 0.07567995 0.2783252
-----------------------------------------------------------------------------
Box-Ljung test
data: ResidualsGLS_no_intercept
X-squared = 14.938, df = 10, p-value = 0.1343