[Returnanalytics-commits] r2962 - in pkg/PerformanceAnalytics/sandbox/pulkit: R data inst inst/doc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 1 01:21:34 CEST 2013


Author: pulkit
Date: 2013-09-01 01:21:34 +0200 (Sun, 01 Sep 2013)
New Revision: 2962

Added:
   pkg/PerformanceAnalytics/sandbox/pulkit/R/capm_aorda.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/psr_python.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/ret.R
   pkg/PerformanceAnalytics/sandbox/pulkit/data/capm_aorda.csv
   pkg/PerformanceAnalytics/sandbox/pulkit/data/psr_python.csv
   pkg/PerformanceAnalytics/sandbox/pulkit/inst/doc/
   pkg/PerformanceAnalytics/sandbox/pulkit/inst/doc/ProbSharpe.Rnw
   pkg/PerformanceAnalytics/sandbox/pulkit/man/CDaR.Rd
   pkg/PerformanceAnalytics/sandbox/pulkit/man/capm_aorda.Rd
   pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.REDD.Rd
   pkg/PerformanceAnalytics/sandbox/pulkit/man/psr_python.Rd
   pkg/PerformanceAnalytics/sandbox/pulkit/man/ret.Rd
Log:
documented data

Added: pkg/PerformanceAnalytics/sandbox/pulkit/R/capm_aorda.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/capm_aorda.R	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/capm_aorda.R	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,6 @@
+#' @name capm_aorda
+#' @title Data to test Cdar and other related functions
+#' @description This data set will be used to validate the results of the paper
+#' @docType data
+#' @usage capm_aorda
+NULL

Added: pkg/PerformanceAnalytics/sandbox/pulkit/R/psr_python.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/psr_python.R	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/psr_python.R	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,6 @@
+#' @name psr_python
+#' @title Data to test Probabilistic Sharpe Ratio
+#' @description This data set will be used to validate the results of the paper
+#' @docType data
+#' @usage psr_python
+NULL

Added: pkg/PerformanceAnalytics/sandbox/pulkit/R/ret.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/ret.R	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/ret.R	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,6 @@
+#' @name ret
+#' @title Return Series to test Rolling Economic Drawdowns
+#' @description This data set will be used to validate the results of the paper
+#' @docType data
+#' @usage ret
+NULL

Added: pkg/PerformanceAnalytics/sandbox/pulkit/data/capm_aorda.csv
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/data/capm_aorda.csv	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/data/capm_aorda.csv	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,68 @@
+Date;AORDA;Benchmark
+2008-01-01;0.0389;-0.0612
+2008-02-01;0.0713;-0.0348
+2008-03-01;0.0417;-0.006
+2008-04-01;0.0743;0.0475
+2008-05-01;0.0324;0.0107
+2008-06-01;-0.0013;-0.086
+2008-07-01;0.0849;-0.0099
+2008-08-01;-0.0283;0.0122
+2008-09-01;0.2821;-0.0921
+2008-10-01;0.0964;-0.1683
+2008-11-01;0.0055;-0.0748
+2008-12-01;-0.0288;0.0078
+2009-01-01;-0.0078;-0.0857
+2009-02-01;0.0684;-0.1099
+2009-03-01;0.0599;0.0854
+2009-04-01;-0.038;0.0939
+2009-05-01;0.0419;0.0531
+2009-06-01;-0.0489;2e-04
+2009-07-01;-0.1022;0.0741
+2009-08-01;-0.0166;0.0336
+2009-09-01;-0.0884;0.0357
+2009-10-01;-0.0284;-0.0198
+2009-11-01;-0.0103;0.0574
+2009-12-01;-0.0118;0.0178
+2010-01-01;0.0054;-0.037
+2010-02-01;-0.0224;0.0285
+2010-03-01;0.0085;0.0588
+2010-04-01;-0.0294;0.0148
+2010-05-01;0.1343;-0.082
+2010-06-01;0.0779;-0.0539
+2010-07-01;0.0661;0.0688
+2010-08-01;0.0313;-0.0474
+2010-09-01;0.0367;0.0876
+2010-10-01;0.003;0.0369
+2010-11-01;0.0361;-0.0023
+2010-12-01;-0.0042;0.0653
+2011-01-01;0.0346;0.0226
+2011-02-01;-0.0068;0.032
+2011-03-01;-0.03;-0.001
+2011-04-01;-0.0148;0.0285
+2011-05-01;0.0372;-0.0135
+2011-06-01;-0.0358;-0.0183
+2011-07-01;-0.0056;-0.0215
+2011-08-01;0.1628;-0.0568
+2011-09-01;-0.0504;-0.0718
+2011-10-01;-0.0354;0.1077
+2011-11-01;0.0011;-0.0051
+2011-12-01;-0.0204;0.0085
+2012-01-01;-1e-04;0.0436
+2012-02-01;5e-04;0.0406
+2012-03-01;0.0169;0.0313
+2012-04-01;0.029;-0.0075
+2012-05-01;-0.0634;-0.0627
+2012-06-01;0.0684;0.0396
+2012-07-01;-0.0198;0.0126
+2012-08-01;0.0399;0.0198
+2012-09-01;-0.0323;0.0242
+2012-10-01;0.006;-0.0198
+2012-11-01;-0.0074;0.0028
+2012-12-01;-0.0048;0.0071
+2013-01-01;-0.0117;0.0504
+2013-02-01;-0.0173;0.0111
+2013-03-01;0.0174;0.036
+2013-04-01;-0.0367;0.0181
+2013-05-01;0.0117;0.0208
+2013-06-01;0.005;-0.015
+2013-07-01;-0.0046;0.0495

Added: pkg/PerformanceAnalytics/sandbox/pulkit/data/psr_python.csv
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/data/psr_python.csv	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/data/psr_python.csv	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,27 @@
+Code,Mean,StDev,Phi,Sigma,t-Stat(Phi)
+HFRIFOF Index,0.005516691,0.016969081,0.35942732,0.015835089,6.246140275
+HFRIFWI Index,0.008881851,0.020176781,0.304802238,0.019216682,5.190679363
+HFRIEHI Index,0.009858566,0.026444472,0.26510117,0.025498305,4.460055655
+HFRIMI Index,0.009527016,0.021496073,0.184350274,0.021127643,3.041856755
+HFRIFOFD Index,0.005179518,0.017416384,0.353548291,0.016291569,6.129496094
+HFRIDSI Index,0.009621101,0.018800339,0.545792492,0.015753187,10.56122157
+HFRIEMNI Index,0.005182009,0.009427888,0.164396537,0.009299616,2.703456292
+HFRIFOFC Index,0.004809119,0.011620459,0.455662847,0.01034398,8.302257893
+HFRIEDI Index,0.009536151,0.019247216,0.391629021,0.01770981,6.902140563
+HFRIMTI Index,0.008528045,0.021556689,-0.0188129,0.021552874,-0.305148009
+HFRIFIHY Index,0.007177975,0.017707746,0.483806908,0.015497372,8.972011994
+HFRIFI Index,0.006855376,0.012881753,0.505908165,0.011111637,9.587381222
+HFRIRVA Index,0.008020951,0.012975483,0.452790992,0.011569158,8.242977673
+HFRIMAI Index,0.007142082,0.010437017,0.298219544,0.009962104,5.067023312
+HFRICAI Index,0.007122016,0.019973858,0.578004656,0.016299336,11.48654001
+HFRIEM Index,0.010352034,0.041000178,0.359277175,0.038262633,6.243082394
+HFRIEMA Index,0.007989882,0.038243416,0.311226738,0.036344083,5.310865179
+HFRISHSE Index,-0.001675503,0.053512968,0.090737496,0.053292219,1.477615589
+HFRIEMLA Index,0.011074013,0.05084986,0.196931418,0.04985408,3.257468873
+HFRIFOFS Index,0.006834983,0.024799788,0.323053217,0.023470043,5.536016371
+HFRIENHI Index,0.010092318,0.036682513,0.201118844,0.035932974,3.329910279
+HFRIFWIG Index,0.009382896,0.035972197,0.231372973,0.034996096,3.857301725
+HFRIFOFM Index,0.005607926,0.015907089,0.042154535,0.015892949,0.684239764
+HFRIFWIC Index,0.008947104,0.039009601,0.050499002,0.038959829,0.820004462
+HFRIFWIJ Index,0.008423965,0.03629762,0.0953987,0.036132072,1.554206093
+HFRISTI Index,0.011075118,0.046441033,0.160831261,0.04583646,2.642789417

Added: pkg/PerformanceAnalytics/sandbox/pulkit/inst/doc/ProbSharpe.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/inst/doc/ProbSharpe.Rnw	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/inst/doc/ProbSharpe.Rnw	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,101 @@
+\documentclass[12pt,letterpaper,english]{article}
+\usepackage{times}
+\usepackage[T1]{fontenc}
+\IfFileExists{url.sty}{\usepackage{url}}
+                      {\newcommand{\url}{\texttt}}
+
+\usepackage[utf8]{inputenc}
+\usepackage{babel}
+\usepackage{Rd}
+
+\usepackage{Sweave}
+\SweaveOpts{engine=R,eps = FALSE}
+%\VignetteIndexEntry{Probabilistic Sharpe Ratio}
+%\VignetteDepends{PerformanceAnalytics}
+%\VignetteKeywords{Probabilistic Sharpe Ratio,Minimum Track Record Length,risk,benchmark,portfolio}
+%\VignettePackage{PerformanceAnalytics}
+
+\begin{document}
+\SweaveOpts{concordance=TRUE}
+
+\title{ Probabilistic Sharpe Ratio Optimization }
+
+% \keywords{Probabilistic Sharpe Ratio,Minimum Track Record Length,risk,benchmark,portfolio}
+
+\makeatletter
+\makeatother
+\maketitle
+
+\begin{abstract}
+
+    This vignette gives an overview of the Probabilistic Sharpe Ratio , Minimum Track Record Length and the Probabilistic Sharpe Ratio Optimization technique used to find the optimal portfolio that maximizes the Probabilistic Sharpe Ratio. It gives an overview of the usability of the functions and its application.
+
+A probabilistic translation of Sharpe ratio, called PSR, is proposed to account for estimation errors in an IID non-Normal framework.When assessing Sharpe ratio’s ability to evaluate skill,we find that a longer track record may be able to compensate for certain statistical shortcomings of the returns probability distribution. Stated differently, despite Sharpe ratio's well-documented deficiencies, it can still provide evidence of investment skill, as long as the user learns to require the proper track record length.
+
+The portfolio of hedge fund indices that maximizes Sharpe ratio can be very different from
+the portfolio that delivers the highest PSR. Maximizing for PSR leads to better diversified and
+more balanced hedge fund allocations compared to the concentrated outcomes of Sharpe ratio
+maximization.
+
+
+
+\end{abstract}
+
+<<echo = FALSE >>=
+library(PerformanceAnalytics)
+data(edhec)
+library(noniid.pm)
+@
+
+
+\section{Probabilistic Sharpe Ratio}
+ Given a predefined benchmark Sharpe ratio $SR^\ast$ , the observed Sharpe ratio $\hat{SR}$  can be expressed in probabilistic terms as
+ 
+ \deqn{\hat{PSR}(SR^\ast) = Z\biggl[\frac{(\hat{SR}-SR^\ast)\sqrt{n-1}}{\sqrt{1-\hat{\gamma_3}SR^\ast + \frac{\hat{\gamma_4}-1}{4}\hat{SR^2}}}\biggr]}
+ 
+ Here $n$ is the track record length or the number of data points. It can be daily,weekly or yearly depending on the input given
+ 
+ \eqn{\hat{\gamma{_3}}} and \eqn{\hat{\gamma{_4}}} are the skewness and kurtosis respectively.
+ It is not unusual to find strategies with irregular trading frequencies, such as weekly strategies that may not trade for a month. This poses a problem when computing an annualized Sharpe ratio, and there is no consensus as how skill should be measured in the context of irregular bets. Because PSR measures skill in probabilistic terms, it is invariant to calendar conventions. All calculations are done in the original frequency
+of the data, and there is no annualization. The Reference Sharpe Ratio is also given in the non-annualized form and should be greater than the Observed Sharpe Ratio.
+
+<<>>=
+data(edhec)
+ProbSharpeRatio(edhec[,1],refSR = 0.23)
+@
+
+\section{Minimum Track Record Length}
+
+If a track record is shorter than Minimum Track Record Length(MinTRL), we do
+not have enough confidence that the observed \eqn{\hat{SR}} is above the designated threshold
+\eqn{SR^\ast}. Minimum Track Record Length is given by the following expression.
+
+\deqn{MinTRL = n^\ast = 1+\biggl[1-\hat{\gamma_3}\hat{SR}+\frac{\hat{\gamma_4}}{4}\hat{SR^2}\biggr]\biggl(\frac{Z_\alpha}{\hat{SR}-SR^\ast}\biggr)^2}
+
+\eqn{\gamma{_3}} and \eqn{\gamma{_4}} are the skewness and kurtosis respectively. It is important to note that MinTRL is expressed in terms of number of observations, not annual or calendar terms. All the values used in the above formula are non-annualized, in the same frequency as that of the returns.
+
+<<>>=
+data(edhec)
+MinTrackRecord(edhec[,1],refSR = 0.23)
+@
+
+\section{Probabilistic Sharpe Ratio Optimal Portfolio}
+
+We would like to find the vector of weights that maximize the expression
+
+ \deqn{\hat{PSR}(SR^\ast) = Z\biggl[\frac{(\hat{SR}-SR^\ast)\sqrt{n-1}}{\sqrt{1-\hat{\gamma_3}SR^\ast + \frac{\hat{\gamma_4}-1}{4}\hat{SR^2}}}\biggr]}
+
+where \eqn{\sigma = \sqrt{E[(r-\mu)^2]}} ,its standard deviation.\eqn{\gamma_3=\frac{E\biggl[(r-\mu)^3\biggr]}{\sigma^3}} its skewness,\eqn{\gamma_4=\frac{E\biggl[(r-\mu)^4\biggr]}{\sigma^4}} its kurtosis and \eqn{SR = \frac{\mu}{\sigma}} its Sharpe Ratio.
+
+Because \eqn{\hat{PSR}(SR^\ast)=Z[\hat{Z^\ast}]} is a monotonic increasing function of 
+\eqn{\hat{Z^\ast}} ,it suffices to compute the vector that maximizes \eqn{\hat{Z^\ast}}
+ This optimal vector is invariant of the value adopted by the parameter \eqn{SR^\ast}. 
+
+
+<<>>=
+data(edhec)
+PsrPortfolio(edhec)
+@
+
+\end{document}
+

Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/CDaR.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/CDaR.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/CDaR.Rd	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,58 @@
+\name{CDaR}
+\alias{CDaR}
+\alias{CDD}
+\title{Calculate Uryasev's proposed Conditional Drawdown at Risk (CDD or CDaR)
+measure}
+\usage{
+  CDaR(R, weights = NULL, geometric = TRUE, invert = TRUE,
+    p = 0.95, ...)
+}
+\arguments{
+  \item{R}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of asset returns}
+
+  \item{weights}{portfolio weighting vector, default NULL,
+  see Details}
+
+  \item{geometric}{utilize geometric chaining (TRUE) or
+  simple/arithmetic chaining (FALSE) to aggregate returns,
+  default TRUE}
+
+  \item{invert}{TRUE/FALSE whether to invert the drawdown
+  measure.  see Details.}
+
+  \item{p}{confidence level for calculation, default
+  p=0.95}
+
+  \item{\dots}{any other passthru parameters}
+}
+\description{
+  For some confidence level \eqn{p}, the conditional
+  drawdown is the the mean of the worst \eqn{p\%}
+  drawdowns.
+}
+\examples{
+library(lpSolve)
+data(edhec)
+t(round(CDaR(edhec),4))
+}
+\author{
+  Brian G. Peterson
+}
+\references{
+  Chekhlov, A., Uryasev, S., and M. Zabarankin. Portfolio
+  Optimization With Drawdown Constraints. B. Scherer (Ed.)
+  Asset and Liability Management Tools, Risk Books, London,
+  2003 http://www.ise.ufl.edu/uryasev/drawdown.pdf
+}
+\seealso{
+  \code{\link{ES}} \code{\link{maxDrawdown}}
+  \code{\link{CdarMultiPath}} \code{\link{AlphaDrawdown}}
+  \code{\link{MultiBetaDrawdown}}
+  \code{\link{BetaDrawdown}}
+}
+\keyword{distribution}
+\keyword{models}
+\keyword{multivariate}
+\keyword{ts}
+

Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/capm_aorda.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/capm_aorda.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/capm_aorda.Rd	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,10 @@
+\docType{data}
+\name{capm_aorda}
+\alias{capm_aorda}
+\title{Data to test Cdar and other related functions}
+\description{
+  This data set will be used to validate the results of the
+  paper
+}
+\keyword{datasets}
+

Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.REDD.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.REDD.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.REDD.Rd	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,51 @@
+\name{chart.REDD}
+\alias{chart.REDD}
+\title{Time series of Rolling Economic Drawdown}
+\usage{
+  chart.REDD(R, rf, h, geometric = TRUE, legend.loc = NULL,
+    colorset = (1:12), ...)
+}
+\arguments{
+  \item{R}{an xts, vector, matrix, data frame, timeseries,
+  or zoo object of asset return.}
+
+  \item{rf}{risk free rate can be vector such as government
+  security rate of return}
+
+  \item{h}{lookback period}
+
+  \item{geometric}{utilize geometric chaining (TRUE) or
+  simple/arithmetic chaining(FALSE) to aggregate returns,
+  default is TRUE.}
+
+  \item{legend.loc}{set the legend.loc, as in
+  \code{\link{plot}}}
+
+  \item{colorset}{set the colorset label, as in
+  \code{\link{plot}}}
+
+  \item{\dots}{any other variable}
+}
+\description{
+  This function plots the time series of Rolling Economic
+  Drawdown. For more details on rolling economic drawdown
+  see \code{rollDrawdown}.
+}
+\examples{
+data(edhec)
+chart.REDD(edhec,0.08,20)
+}
+\author{
+  Pulkit Mehrotra
+}
+\references{
+  Yang, Z. George and Zhong, Liang, Optimal Portfolio
+  Strategy to Control Maximum Drawdown - The Case of Risk
+  Based Dynamic Asset Allocation (February 25, 2012)
+}
+\seealso{
+  \code{\link{plot}} \code{\link{EconomicDrawdown}}
+  \code{\link{EDDCOPS}} \code{\link{rollDrawdown}}
+  \code{\link{REDDCOPS}} \code{\link{rollEconomicMax}}
+}
+

Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/psr_python.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/psr_python.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/psr_python.Rd	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,10 @@
+\docType{data}
+\name{psr_python}
+\alias{psr_python}
+\title{Data to test Probabilistic Sharpe Ratio}
+\description{
+  This data set will be used to validate the results of the
+  paper
+}
+\keyword{datasets}
+

Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/ret.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/ret.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/ret.Rd	2013-08-31 23:21:34 UTC (rev 2962)
@@ -0,0 +1,10 @@
+\docType{data}
+\name{ret}
+\alias{ret}
+\title{Return Series to test Rolling Economic Drawdowns}
+\description{
+  This data set will be used to validate the results of the
+  paper
+}
+\keyword{datasets}
+



More information about the Returnanalytics-commits mailing list