<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
This should be part of the PerformanceAnalytics package and big data constructs in R sharp ratio, Jensen's alpha and others would also be readily avl in R and MATLAB and bit/git for r and python<br>
<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
覧覧覧覧覧覧<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Amit Mittal <br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
PhD in Finance and Accounting (tbd) <br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
IIM Lucknow <br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<a href="http://ssrn.com/author=2665511">http://ssrn.com/author=2665511</a> <br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
*Top 10%, downloaded author since July 2017<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
覧覧覧覧覧覧<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
Sent from my Outlook for Android<br>
</div>
<div dir="auto" style="direction:ltr; margin:0; padding:0; font-family:sans-serif; font-size:11pt; color:black">
<a href="https://aka.ms/ghei36">https://aka.ms/ghei36</a></div>
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> R-SIG-Finance <r-sig-finance-bounces@r-project.org> on behalf of Jason Hart via R-SIG-Finance <r-sig-finance@r-project.org><br>
<b>Sent:</b> Saturday, September 29, 2018 8:52:41 PM<br>
<b>To:</b> r-sig-finance@r-project.org<br>
<b>Subject:</b> [R-SIG-Finance] Probability / Standard Deviation Cone</font>
<div> </div>
</div>
<div>
<div>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.</div>
<div><img src="cid:56f54b24-12b0-4278-844c-22a032b05f55@icloud.com" class="_auto-scale " alt="PastedImage-2.png" title="PastedImage-2.png" width="732" height="497" style="margin:10px 10px 10px 0px"></div>
<div><br>
</div>
<div>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</div>
<div><br>
</div>
<div>Here's an example plotting the cone in ggplot:</div>
<div>data(edhec)</div>
<div>vol <- StdDev.annualized(edhec[,2]) / 2 * 1:4 # 4 volatility levels<br>
days <- 0:152 #Number of months<br>
spot <- 1 ## starting price point<br>
drift <- Return.cumulative(edhec[,2]) #total return<br>
<br>
dat <- expand.grid(days, vol) # nice and long<br>
names(dat) <- c("days", "vol")<br>
dat$upper <- exp(log(spot) + (drift - (dat$vol^2 / 2)) * dat$days / 365 +<br>
dat$vol * sqrt(dat$days / 365))<br>
dat$lower <- exp(log(spot) + (drift - (dat$vol^2 / 2)) * dat$days / 365 -<br>
dat$vol * sqrt(dat$days / 365))<br>
<br>
ggplot(dat, aes(x = days,<br>
ymin = lower,<br>
ymax = upper,<br>
group = factor(vol))) + # we need the group to tell<br>
# which ribbons go together<br>
geom_ribbon(alpha = 0.2, fill = "dodgerblue2", color = "gray70") <br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
</div>
</body>
</html>