I didn't see this in the archives anywhere but I'm curious if anyone has looked at standard deviation cones to assess how an asset or manager is performing relative to expectations based on longer term volatility and returns, i.e. are they performing ahead of expectations or below. Here's a picture of a standard deviation cone created in excel which is tedious. Basically there's the expected long term return plotted as a straight line and then additional plots of 1 & 2 standard deviation bands above and below the expected return.

I'd like to be able to do this in R because it is much quicker and easier than in excel. I'm able to get the cone but the one thing I'm trying to do is plot an overlay of the cumulative returns on top of the cone. I can't get these two to play well together b/c one data set is timeseries. I'd to try and overlay something like chart.CumReturns from the performanceanalytics package. Any help is much appreciated

Here's an example plotting the cone in ggplot:

data(edhec)

vol <- StdDev.annualized(edhec[,2]) / 2 * 1:4 # 4 volatility levels

days <- 0:152 #Number of months

spot <- 1 ## starting price point

drift <- Return.cumulative(edhec[,2]) #total return

dat <- expand.grid(days, vol) # nice and long

names(dat) <- c("days", "vol")

dat$upper <- exp(log(spot) + (drift - (dat$vol^2 / 2)) * dat$days / 365 +

dat$vol * sqrt(dat$days / 365))

dat$lower <- exp(log(spot) + (drift - (dat$vol^2 / 2)) * dat$days / 365 -

dat$vol * sqrt(dat$days / 365))

ggplot(dat, aes(x = days,

ymin = lower,

ymax = upper,

group = factor(vol))) + # we need the group to tell

# which ribbons go together

geom_ribbon(alpha = 0.2, fill = "dodgerblue2", color = "gray70")

_______________________________________________

[hidden email] mailing list

https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first.

-- Also note that this is not the r-help list where general R questions should go.