Displaying 1 result from an estimated 1 matches for "volatility_20".
2009 Jul 07
1
Error in Rolling window of function - rollapply
...of outputs for Excel is 36 and for R is 18. The total number of
observations is 37. In the attachment you can find pdf of the Excel and
Excel file. Below you can find my commands in R.
> Ret<-read.csv("data.csv")
> Ret_1<-zoo((Ret))
> Ret_2<-rollapply(Ret_1,20,sd)
> Volatility_20<-sd(Ret_2)
> Volatility_20
Data
0.03802453
> Ret_2
Data
10 0.9170356
11 0.9147269
12 0.8982093
13 0.9169873
14 0.9156607
15 0.8961262
16 0.9615083
17 0.9804045
18 0.9853978
19 0.9888628
20 0.8798952
21 0.8408839
22 0.9429053
23 0.9498478
24 0.9464991
25 0.9305918
26 0.9408653...