Time dependency
price4<- span=""> read.table('price4.txt',header = T)->
Historical price
NipponSheetGlassCompany_TSE5202<- span=""> price4$x5202
PolaOrbisHoldings_TSE4927<- span=""> price4$x4927
YamahaMotor_TSE7272<- span=""> price4$x7272
TakedaPharmaceuticalCompany_TSE4502<- span=""> price4$x4502->->->->
Return on price start at time 0
Return_TSE5202<- span=""> NipponSheetGlassCompany_TSE5202/NipponSheetGlassCompany_TSE5202[1]
Return_TSE4927<- span=""> PolaOrbisHoldings_TSE4927/PolaOrbisHoldings_TSE4927[1]
Return_TSE7272<- span=""> YamahaMotor_TSE7272/YamahaMotor_TSE7272[1]
Return_TSE4502<- span=""> TakedaPharmaceuticalCompany_TSE4502/TakedaPharmaceuticalCompany_TSE4502[1]->->->->
par(mfcol=c(2,2))
plot(Return_TSE5202[1:120],Return_TSE5202[2:121])
plot(Return_TSE4927[1:120],Return_TSE4927[2:121])
plot(Return_TSE7272[1:120],Return_TSE7272[2:121])
plot(Return_TSE4502[1:120],Return_TSE4502[2:121])
cor(Return_TSE5202[1:120],Return_TSE5202[2:121])
## [1] 0.9853242
cor(Return_TSE4927[1:120],Return_TSE4927[2:121])
## [1] 0.9800802
cor(Return_TSE7272[1:120],Return_TSE7272[2:121])
## [1] 0.9893316
cor(Return_TSE4502[1:120],Return_TSE4502[2:121])
## [1] 0.9960337
acf(Return_TSE5202,plot=F)
##
## Autocorrelations of series 'Return_TSE5202', by lag
##
## 0 1 2 3 4 5 6 7 8 9 10 11
## 1.000 0.969 0.937 0.908 0.885 0.866 0.846 0.822 0.800 0.774 0.750 0.727
## 12 13 14 15 16 17 18 19 20
## 0.705 0.685 0.665 0.646 0.629 0.607 0.582 0.554 0.524
acf(Return_TSE5202)
acf(Return_TSE4927,plot=F)
##
## Autocorrelations of series 'Return_TSE4927', by lag
##
## 0 1 2 3 4 5 6 7 8 9 10 11
## 1.000 0.965 0.943 0.913 0.885 0.860 0.835 0.809 0.788 0.767 0.743 0.710
## 12 13 14 15 16 17 18 19 20
## 0.684 0.656 0.629 0.602 0.579 0.544 0.526 0.504 0.483
acf(Return_TSE4927)
acf(Return_TSE7272,plot=F)
##
## Autocorrelations of series 'Return_TSE7272', by lag
##
## 0 1 2 3 4 5 6 7 8 9 10 11
## 1.000 0.967 0.937 0.902 0.871 0.840 0.808 0.777 0.744 0.716 0.681 0.650
## 12 13 14 15 16 17 18 19 20
## 0.621 0.599 0.577 0.558 0.541 0.524 0.510 0.497 0.483
acf(Return_TSE7272)
acf(Return_TSE4502,plot=F)
##
## Autocorrelations of series 'Return_TSE4502', by lag
##
## 0 1 2 3 4 5 6 7 8 9 10 11
## 1.000 0.982 0.962 0.941 0.915 0.890 0.865 0.839 0.813 0.788 0.759 0.732
## 12 13 14 15 16 17 18 19 20
## 0.707 0.680 0.654 0.628 0.604 0.581 0.558 0.535 0.515
acf(Return_TSE4502)
acf(Return_TSE5202,plot=F,type="partial") #or type="p"
##
## Partial autocorrelations of series 'Return_TSE5202', by lag
##
## 1 2 3 4 5 6 7 8 9 10
## 0.969 -0.033 0.033 0.095 0.028 0.002 -0.074 0.039 -0.086 0.014
## 11 12 13 14 15 16 17 18 19 20
## -0.010 -0.006 0.032 -0.009 0.014 0.018 -0.079 -0.048 -0.079 -0.061
acf(Return_TSE5202,plot=T,type="partial") #or type="p"
acf(Return_TSE4927,plot=F,type="partial") #or type="p"
##
## Partial autocorrelations of series 'Return_TSE4927', by lag
##
## 1 2 3 4 5 6 7 8 9 10
## 0.965 0.159 -0.079 -0.032 0.037 0.016 -0.034 0.038 0.019 -0.045
## 11 12 13 14 15 16 17 18 19 20
## -0.180 0.042 0.028 -0.028 -0.026 0.047 -0.166 0.141 0.028 0.002
acf(Return_TSE4927,plot=T,type="partial") #or type="p"
acf(Return_TSE7272,plot=F,type="partial") #or type="p"
##
## Partial autocorrelations of series 'Return_TSE7272', by lag
##
## 1 2 3 4 5 6 7 8 9 10
## 0.967 0.024 -0.082 0.026 -0.005 -0.038 0.003 -0.044 0.055 -0.122
## 11 12 13 14 15 16 17 18 19 20
## 0.022 0.042 0.072 -0.006 0.037 0.002 0.020 -0.006 0.041 -0.039
acf(Return_TSE7272,plot=T,type="partial") #or type="p"
acf(Return_TSE4502,plot=F,type="partial") #or type="p"
##
## Partial autocorrelations of series 'Return_TSE4502', by lag
##
## 1 2 3 4 5 6 7 8 9 10
## 0.982 -0.092 -0.028 -0.116 0.004 -0.005 -0.058 0.031 -0.007 -0.134
## 11 12 13 14 15 16 17 18 19 20
## 0.070 0.009 -0.026 -0.032 -0.010 0.083 -0.039 -0.031 0.031 0.013
acf(Return_TSE4502,plot=T,type="partial") #or type="p"
Ljung=Box test for X
Box.test(Return_TSE5202,type="L")
##
## Box-Ljung test
##
## data: Return_TSE5202
## X-squared = 116.45, df = 1, p-value < 2.2e-16
Box.test(Return_TSE4927,type="L")
##
## Box-Ljung test
##
## data: Return_TSE4927
## X-squared = 115.57, df = 1, p-value < 2.2e-16
Box.test(Return_TSE7272,type="L")
##
## Box-Ljung test
##
## data: Return_TSE7272
## X-squared = 116.02, df = 1, p-value < 2.2e-16
Box.test(Return_TSE4502,type="L")
##
## Box-Ljung test
##
## data: Return_TSE4502
## X-squared = 119.7, df = 1, p-value < 2.2e-16
mean(Return_TSE5202)
## [1] 1.67994
mean(Return_TSE4927)
## [1] 1.070389
mean(Return_TSE7272)
## [1] 1.420567
mean(Return_TSE4502)
## [1] 1.168117
acf(Return_TSE5202,plot=F,type="covariance")
##
## Autocovariances of series 'Return_TSE5202', by lag
##
## 0 1 2 3 4 5 6 7 8 9
## 0.1328 0.1287 0.1244 0.1206 0.1176 0.1150 0.1124 0.1092 0.1063 0.1028
## 10 11 12 13 14 15 16 17 18 19
## 0.0997 0.0966 0.0936 0.0910 0.0884 0.0858 0.0835 0.0806 0.0773 0.0736
## 20
## 0.0697
acf(Return_TSE4927,plot=F,type="covariance")
##
## Autocovariances of series 'Return_TSE4927', by lag
##
## 0 1 2 3 4 5 6 7 8
## 0.00722 0.00697 0.00680 0.00659 0.00639 0.00620 0.00603 0.00584 0.00569
## 9 10 11 12 13 14 15 16 17
## 0.00553 0.00536 0.00513 0.00493 0.00473 0.00454 0.00435 0.00418 0.00393
## 18 19 20
## 0.00380 0.00363 0.00349
acf(Return_TSE7272,plot=F,type="covariance")
##
## Autocovariances of series 'Return_TSE7272', by lag
##
## 0 1 2 3 4 5 6 7 8 9
## 0.0748 0.0724 0.0701 0.0675 0.0652 0.0628 0.0604 0.0581 0.0557 0.0536
## 10 11 12 13 14 15 16 17 18 19
## 0.0510 0.0486 0.0465 0.0448 0.0432 0.0418 0.0405 0.0392 0.0381 0.0372
## 20
## 0.0361
acf(Return_TSE4502,plot=F,type="covariance")
##
## Autocovariances of series 'Return_TSE4502', by lag
##
## 0 1 2 3 4 5 6 7 8 9
## 0.0251 0.0246 0.0241 0.0236 0.0229 0.0223 0.0217 0.0210 0.0204 0.0198
## 10 11 12 13 14 15 16 17 18 19
## 0.0190 0.0184 0.0177 0.0170 0.0164 0.0157 0.0151 0.0146 0.0140 0.0134
## 20
## 0.0129
ar(Return_TSE5202,aic=F,order.max=1)
##
## Call:
## ar(x = Return_TSE5202, aic = F, order.max = 1)
##
## Coefficients:
## 1
## 0.969
##
## Order selected 1 sigma^2 estimated as 0.00825
(1-0.631)*mean(Return_TSE5202) #μを求める
## [1] 0.6198978
ar(Return_TSE5202,aic=T,oreder.max=1)
##
## Call:
## ar(x = Return_TSE5202, aic = T, oreder.max = 1)
##
## Coefficients:
## 1
## 0.969
##
## Order selected 1 sigma^2 estimated as 0.00825
ar(Return_TSE4927,aic=F,order.max=1)
##
## Call:
## ar(x = Return_TSE4927, aic = F, order.max = 1)
##
## Coefficients:
## 1
## 0.9653
##
## Order selected 1 sigma^2 estimated as 0.0005005
(1-0.631)*mean(Return_TSE4927) #μを求める
## [1] 0.3949736
ar(Return_TSE4927,aic=T,oreder.max=1)
##
## Call:
## ar(x = Return_TSE4927, aic = T, oreder.max = 1)
##
## Coefficients:
## 1 2
## 0.8118 0.1590
##
## Order selected 2 sigma^2 estimated as 0.000492
ar(Return_TSE7272,aic=F,order.max=1)
##
## Call:
## ar(x = Return_TSE7272, aic = F, order.max = 1)
##
## Coefficients:
## 1
## 0.9672
##
## Order selected 1 sigma^2 estimated as 0.004912
(1-0.631)*mean(Return_TSE7272) #μを求める
## [1] 0.5241891
ar(Return_TSE7272,aic=T,oreder.max=1)
##
## Call:
## ar(x = Return_TSE7272, aic = T, oreder.max = 1)
##
## Coefficients:
## 1
## 0.9672
##
## Order selected 1 sigma^2 estimated as 0.004912
ar(Return_TSE4502,aic=F,order.max=1)
##
## Call:
## ar(x = Return_TSE4502, aic = F, order.max = 1)
##
## Coefficients:
## 1
## 0.9824
##
## Order selected 1 sigma^2 estimated as 0.0008892
(1-0.631)*mean(Return_TSE4502) #μを求める
## [1] 0.4310351
ar(Return_TSE4502,aic=T,oreder.max=1)
##
## Call:
## ar(x = Return_TSE4502, aic = T, oreder.max = 1)
##
## Coefficients:
## 1
## 0.9824
##
## Order selected 1 sigma^2 estimated as 0.0008892
Dickey-Fuller test
library(tseries)
adf.test(NipponSheetGlassCompany_TSE5202)
##
## Augmented Dickey-Fuller Test
##
## data: NipponSheetGlassCompany_TSE5202
## Dickey-Fuller = -1.0795, Lag order = 4, p-value = 0.9223
## alternative hypothesis: stationary
adf.test(Return_TSE5202)
##
## Augmented Dickey-Fuller Test
##
## data: Return_TSE5202
## Dickey-Fuller = -1.0795, Lag order = 4, p-value = 0.9223
## alternative hypothesis: stationary
adf.test(PolaOrbisHoldings_TSE4927)
##
## Augmented Dickey-Fuller Test
##
## data: PolaOrbisHoldings_TSE4927
## Dickey-Fuller = -2.3731, Lag order = 4, p-value = 0.4216
## alternative hypothesis: stationary
adf.test(Return_TSE4927)
##
## Augmented Dickey-Fuller Test
##
## data: Return_TSE4927
## Dickey-Fuller = -2.3731, Lag order = 4, p-value = 0.4216
## alternative hypothesis: stationary
adf.test(YamahaMotor_TSE7272)
##
## Augmented Dickey-Fuller Test
##
## data: YamahaMotor_TSE7272
## Dickey-Fuller = -2.9204, Lag order = 4, p-value = 0.1943
## alternative hypothesis: stationary
adf.test(Return_TSE7272)
##
## Augmented Dickey-Fuller Test
##
## data: Return_TSE7272
## Dickey-Fuller = -2.9204, Lag order = 4, p-value = 0.1943
## alternative hypothesis: stationary
adf.test(TakedaPharmaceuticalCompany_TSE4502)
##
## Augmented Dickey-Fuller Test
##
## data: TakedaPharmaceuticalCompany_TSE4502
## Dickey-Fuller = -1.9524, Lag order = 4, p-value = 0.5964
## alternative hypothesis: stationary
adf.test(Return_TSE4502)
##
## Augmented Dickey-Fuller Test
##
## data: Return_TSE4502
## Dickey-Fuller = -1.9524, Lag order = 4, p-value = 0.5964
## alternative hypothesis: stationary