Stock Return Simulation
Stock Return Simulation
5. Decomposition
Eigen=eigen(correlation)
eigenvector= as.matrix(Eigen$vectors)
eigenvalue = Eigen$values
1
7. Simulation
newdata<-R %*% diag(sqrt(eigenvalue)) %*% t(eigenvector)
AAPL
QIHU
SOHU
BIDU
1.00000000 0.09622307 0.05876803 0.1056816
0.09622307 1.00000000 0.43463630 0.3705914
0.05876803 0.43463630 1.00000000 0.4167501
0.10568162 0.37059139 0.41675006 1.0000000
0.10381480 0.24225355 0.32196257 0.2985237
0.06114784 0.32929659 0.43148538 0.3911863
0.13388650 0.15493087 0.20198385 0.2075162
0.08744170 0.27985911 0.33357160 0.3586587
0.09336454 0.21061102 0.25709530 0.2810099
0.12471310 0.15247588 0.20078006 0.2255432
IBM
YHOO
AMZN
MSFT
0.1338865 0.0874417 0.09336454 0.1247131
0.1549309 0.2798591 0.21061102 0.1524759
0.2019839 0.3335716 0.25709530 0.2007801
0.2075162 0.3586587 0.28100990 0.2255432
0.3953890 0.3157743 0.27959906 0.3534442
0.1574119 0.2936927 0.18050169 0.1754273
1.0000000 0.1907733 0.22175528 0.3831316
0.1907733 1.0000000 0.32710998 0.2294383
0.2217553 0.3271100 1.00000000 0.2569132
0.3831316 0.2294383 0.25691320 1.0000000
AAPL
QIHU
SOHU
BIDU
HSBC
YOKU
IBM
YHOO
AMZN
MSFT
AAPL
QIHU
SOHU
BIDU
HSBC
YOKU
IBM
YHOO
AMZN
MSFT
HSBC
0.1038148
0.2422536
0.3219626
0.2985237
1.0000000
0.2831943
0.3953890
0.3157743
0.2795991
0.3534442
YOKU
0.06114784
0.32929659
0.43148538
0.39118632
0.28319425
1.00000000
0.15741187
0.29369271
0.18050169
0.17542728
[,5]
0.1081834
0.2475255
0.3267138
0.3020627
1.0000000
0.2884299
0.4013749
[,6]
0.06327084
0.33379897
0.43587216
0.39719169
0.28842986
1.00000000
0.16097860
new.correlation
##
##
##
##
##
##
##
##
[1,]
[2,]
[3,]
[4,]
[5,]
[6,]
[7,]
[,1]
1.00000000
0.09599929
0.05997730
0.10692410
0.10818343
0.06327084
0.13806655
[,2]
0.09599929
1.00000000
0.43812119
0.37468322
0.24752553
0.33379897
0.15976877
[,3]
0.0599773
0.4381212
1.0000000
0.4221470
0.3267138
0.4358722
0.2062883
[,4]
0.1069241
0.3746832
0.4221470
1.0000000
0.3020627
0.3971917
0.2119332
2