Description Usage Arguments Value Author(s) Examples
calculate an annualized return, stddev, turnover.
1 2 3 4 5 6 7 8 9 10 11 12 | Turnover.annualized(R, scale = scale_esti(R))
Return.annualized(R, scale = scale_esti(R), geometric = TRUE)
StdDev.annualized(R, scale = scale_esti(R))
IC.annualized(R, scale = scale_esti(R))
SharpeRatio.annualized(R, Rf = 0, scale = scale_esti(R), geometric = TRUE)
Table.Annualized(R, scale = scale_esti(R), Rf = 0, geometric = TRUE,
digits = 4)
|
R |
a return, stddev, turnover series, an object of class timeSeries,zoo or xts |
scale |
number of periods in a year (daily scale = 252, monthly scale = 12, quarterly scale = 4) |
geometric |
a logical. generate geometric (TRUE) or simple (FALSE) returns, default TRUE |
a vector or scalar depending on the dim of seri
Ruifei.Yin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #-- turnover.annulized
seri <- zoo(runif(30,0,1),seq(Sys.Date(),by="month",length.out=30))
re <- Turnover.annualized(seri)
seri <- zoo(matrix(runif(60,0,1),30,2),seq(Sys.Date(),by="month",length.out=30))
re <- Turnover.annualized(seri)
#-- return.annulized
#- monthly
rtn.long <- zoo(rnorm(100,0.001,0.02),as.Date("2010-01-01")+(1:100)*30)
rtn.short <- rtn.long + rnorm(100,-0.001,0.003)
rtn <- merge(rtn.long,rtn.short)
Return.annualized(rtn)
PerformanceAnalytics::Return.annualized(rtn)
#- 10day
rtn.long <- zoo(rnorm(100,0.001,0.02),as.Date("2010-01-01")+(1:100)*10)
rtn.short <- rtn.long + rnorm(100,-0.001,0.003)
rtn <- merge(rtn.long,rtn.short)
Return.annualized(rtn) # right
PerformanceAnalytics::Return.annualized(rtn) # wrong!
scale_esti <- 365/periodicity_Ndays(rtn)
PerformanceAnalytics::Return.annualized(rtn,scale = scale_esti) # right
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.