[Returnanalytics-commits] r2808 - in pkg/PerformanceAnalytics/sandbox/pulkit: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Aug 17 23:18:06 CEST 2013
Author: braverock
Date: 2013-08-17 23:18:06 +0200 (Sat, 17 Aug 2013)
New Revision: 2808
Added:
pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION
pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/BenchmarkSR.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/BetaDrawdown.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/CdarMultiPath.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/DrawdownGPD.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/EDDCOPS.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/EconomicDrawdown.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/MaxDD.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/MinTrackRecord.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/MonteSimulTriplePenance.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/MultiBetaDrawdown.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/ProbSharpeRatio.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/PsrPortfolio.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/REDDCOPS.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/TuW.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.BenchmarkSR.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.Penance.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/chart.SRIndifference.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/golden_section.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/rollDrawdown.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/rollEconomicMax.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/table.PSR.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/man/table.Penance.Rd
Modified:
pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/MinTRL.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R
Log:
- add DESCRIPTION, NAMESPACE
- additional changes so that roxygenize could work on the entire package
- additional changes so that R CMD build would work
Added: pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,46 @@
+Package: noniid.pm
+Type: Package
+Title: Non-i.i.d. GSoC 2013 Pulkit
+Version: 0.1
+Date: $Date: 2013-05-13 14:30:22 -0500 (Mon, 13 May 2013) $
+Author: Pulkit Mahotra <mehrotra.pulkit at gmail.com>
+Contributors: Peter Carl, Brian G. Peterson
+Depends:
+ xts,
+ PerformanceAnalytics
+Suggests:
+ PortfolioAnalytics
+Maintainer: Brian G. Peterson <brian at braverock.com>
+Description: GSoC 2013 project to replicate literature on drawdowns and
+ non-i.i.d assumptions in finance.
+License: GPL (>=3)
+ByteCompile: TRUE
+Collate:
+ 'BenchmarkPlots.R'
+ 'BenchmarkSR.R'
+ 'CDaRMultipath.R'
+ 'CdaR.R'
+ 'chart.Penance.R'
+ 'chart.REDD.R'
+ 'chart.SharpeEfficient.R'
+ 'Drawdownalpha.R'
+ 'DrawdownBetaMulti.R'
+ 'DrawdownBeta.R'
+ 'EDDCOPS.R'
+ 'edd.R'
+ 'Edd.R'
+ 'ExtremeDrawdown.R'
+ 'GoldenSection.R'
+ 'MaxDD.R'
+ 'MinTRL.R'
+ 'MonteSimulTriplePenance.R'
+ 'ProbSharpeRatio.R'
+ 'PSRopt.R'
+ 'REDDCOPS.R'
+ 'redd.R'
+ 'REM.R'
+ 'SRIndifferenceCurve.R'
+ 'table.Penance.R'
+ 'table.PSR.R'
+ 'TriplePenance.R'
+ 'TuW.R'
Added: pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,10 @@
+export(AlphaDrawdown)
+export(BenchmarkSR)
+export(chart.BenchmarkSR)
+export(chart.SRIndifference)
+export(EconomicDrawdown)
+export(EDDCOPS)
+export(MinTrackRecord)
+export(REDDCOPS)
+export(rollDrawdown)
+export(rollEconomicMax)
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -8,7 +8,6 @@
#' average pairwise correlation. The Returns are given as
#' the input with the benchmark Sharpe Ratio as the output.
#'
-#'@aliases BenchmarkSR
#'\deqn{SR_B = \bar{SR}\sqrt{\frac{S}{1+(S-1)\bar{\rho}}}}
#'
#'Here \eqn{\bar{SR}} is the average SR of the portfolio and \eqn{\bar{\rho}}
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -1,7 +1,7 @@
#'@title
#'Conditional Drawdown at Risk for Multiple Sample Path
#'
-#'@desctipion
+#'@description
#'
#' For a given \eqn{\alpha \epsilon [0,1]} in the multiple sample-paths setting,CDaR,
#' denoted by \eqn{D_{\alpha}(w)}, is the average of \eqn{(1-\alpha).100\%} drawdowns
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -15,7 +15,7 @@
#' \eqn{f(x_2)<f(x_1)} then the three new points are \eqn{x_2<x_1<x_u}. This process is continued until the distance between the outer point
#' is sufficiently small.
-#' @reference Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
+#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
#'
#'@param a initial point
#'@param b final point
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -43,7 +43,7 @@
#' @param confidence the confidence interval
#' @param type The type of distribution "normal" or "ar"."ar" stands for Autoregressive.
#'
-#' @reference Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
+#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
#'
#' @examples
#'
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/MinTRL.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/MinTRL.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/MinTRL.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -38,7 +38,7 @@
#'@param kr Kurtosis, in the same periodicity as the returns(non-annualized).
#'To be given in case the return series is not given.
#'
-#'@reference Bailey, David H. and Lopez de Prado, Marcos, \emph{The Sharpe Ratio
+#'@references Bailey, David H. and Lopez de Prado, Marcos, \emph{The Sharpe Ratio
#'Efficient Frontier} (July 1, 2012). Journal of Risk, Vol. 15, No. 2, Winter
#' 2012/13
#'@keywords ts multivariate distribution models
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -20,7 +20,7 @@
#' @param bets Number of bets in the cumulative process
#' @param confidence Confidence level for quantile
#'
-#' @reference Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs
+#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs
#' and the ‘Triple Penance’ Rule(January 1, 2013).
#'
#' @examples
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -27,7 +27,7 @@
#' @param confidence the confidence interval
#' @param type The type of distribution "normal" or "ar"."ar" stands for Autoregressive.
#'
-#' @reference Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
+#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
#'
#' @examples
#' TuW(edhec,0.95,"ar")
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -31,9 +31,10 @@
#'@seealso \code{\link{plot}}
#'@keywords ts multivariate distribution models hplot
#'@examples
+#'ls()
#'
#'
-#'@reference Bailey, David H. and Lopez de Prado, Marcos,Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
+#'@references Bailey, David H. and Lopez de Prado, Marcos,Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
chart.Penance<-function(R,confidence,type=c("ar","normal"),reference.grid = TRUE,main=NULL,ylab = NULL,xlab = NULL,element.color="darkgrey",lwd = 2,pch = 1,cex = 1,cex.axis=0.8,cex.lab = 1,cex.main = 1,xlim = NULL,ylim = NULL,...){
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -12,7 +12,7 @@
#'@param the confidence level
#'@param weights the weights for the portfolio
#'
-#'@reference Bailey, David H. and Lopez de Prado, Marcos, \emph{The Sharpe Ratio
+#'@references Bailey, David H. and Lopez de Prado, Marcos, \emph{The Sharpe Ratio
#'Efficient Frontier} (July 1, 2012). Journal of Risk, Vol. 15, No. 2, Winter
#' 2012/13
#'@keywords ts multivariate distribution models
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R 2013-08-17 18:01:02 UTC (rev 2807)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R 2013-08-17 21:18:06 UTC (rev 2808)
@@ -7,7 +7,7 @@
#' @param R Returns
#' @param confidence the confidence interval
#'
-#' @reference Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
+#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
table.Penance<-function(R,confidence){
# DESCRIPTION:
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,63 @@
+\name{AlphaDrawdown}
+\alias{AlphaDrawdown}
+\title{Drawdown alpha}
+\usage{
+ AlphaDrawdown(R, Rm, p = 0.95, weights = NULL,
+ geometric = TRUE, type = c("alpha", "average", "max"),
+ ...)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset returns}
+
+ \item{Rm}{Return series of the optimal portfolio an xts,
+ vector, matrix, data frame, timeSeries or zoo object of
+ asset returns}
+
+ \item{p}{confidence level for calculation
+ ,default(p=0.95)}
+
+ \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{type}{The type of BetaDrawdown if specified alpha
+ then the alpha value given is taken (default 0.95). If
+ "average" then alpha = 0 and if "max" then alpha = 1 is
+ taken.}
+
+ \item{\dots}{any passthru variable}
+}
+\description{
+ Then the difference between the actual rate of return and
+ the rate of return of the instrument estimated by
+ \eqn{\beta_DD{w_T}} is called CDaR alpha and is given by
+
+ \deqn{\alpha_DD = w_T - \beta_DD{w_T^M}}
+
+ here \eqn{\beta_DD} is the beta drawdown. The code for
+ beta drawdown can be found here \code{BetaDrawdown}.
+
+ Postive \eqn{\alpha_DD} implies that the instrument did
+ better than it was predicted, and consequently,
+ \eqn{\alpha_DD} can be used as a performance measure to
+ rank instrument and to identify those that outperformed
+ their CAPM predictions
+}
+\examples{
+AlphaDrawdown(edhec[,1],edhec[,2]) ## expected value : 0.5141929
+
+AlphaDrawdown(edhec[,1],edhec[,2],type="max") ## expected value : 0.8983177
+
+AlphaDrawdown(edhec[,1],edhec[,2],type="average") ## expected value : 1.692592
+}
+\references{
+ Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital
+ Asset Pricing Model (CAPM) with Drawdown Measure.Research
+ Report 2012-9, ISE Dept., University of Florida,September
+ 2012.
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/BenchmarkSR.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/BenchmarkSR.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/BenchmarkSR.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,34 @@
+\name{BenchmarkSR}
+\alias{BenchmarkSR}
+\title{Benchmark Sharpe Ratio}
+\usage{
+ BenchmarkSR(R)
+}
+\arguments{
+ \item{R}{a vector, matrix, data frame,timeseries or zoo
+ object of asset returns}
+}
+\description{
+ The benchmark SR is a linear function of the average SR
+ of the individual strategies, and a decreasing convex
+ function of the number of strategies and the average
+ pairwise correlation. The Returns are given as the input
+ with the benchmark Sharpe Ratio as the output.
+
+ \deqn{SR_B = \bar{SR}\sqrt{\frac{S}{1+(S-1)\bar{\rho}}}}
+
+ Here \eqn{\bar{SR}} is the average SR of the portfolio
+ and \eqn{\bar{\rho}} is the average correlation across
+ off-diagonal elements
+}
+\examples{
+data(edhec)
+BenchmarkSR(edhec) #expected 0.393797
+}
+\references{
+ Bailey, David H. and Lopez de Prado, Marcos, The Strategy
+ Approval Decision: A Sharpe Ratio Indifference Curve
+ Approach (January 2013). Algorithmic Finance, Vol. 2, No.
+ 1 (2013).
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/BetaDrawdown.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/BetaDrawdown.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/BetaDrawdown.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,76 @@
+\name{BetaDrawdown}
+\alias{BetaDrawdown}
+\title{Drawdown Beta for single path}
+\usage{
+ BetaDrawdown(R, Rm, h = 0, p = 0.95, weights = NULL,
+ geometric = TRUE, type = c("alpha", "average", "max"),
+ ...)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset returns}
+
+ \item{Rm}{Return series of the optimal portfolio an xts,
+ vector, matrix, data frame, timeSeries or zoo object of
+ asset returns}
+
+ \item{p}{confidence level for calculation
+ ,default(p=0.95)}
+
+ \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{type}{The type of BetaDrawdown if specified alpha
+ then the alpha value given is taken (default 0.95). If
+ "average" then alpha = 0 and if "max" then alpha = 1 is
+ taken.}
+
+ \item{\dots}{any passthru variable.}
+}
+\description{
+ The drawdown beta is formulated as follows
+
+ \deqn{\beta_DD =
+ \frac{{\sum_{t=1}^T}{q_t^\asterisk}{(w_{k^{\asterisk}(t)}-w_t)}}{D_{\alpha}(w^M)}}
+ here \eqn{\beta_DD} is the drawdown beta of the
+ instrument.
+ \eqn{k^{\asterisk}(t)\in{argmax_{t_{\tau}{\le}k{\le}t}}w_k^M}
+
+ \eqn{q_t^\asterisk=1/((1-\alpha)T)} if \eqn{d_t^M} is one
+ of the \eqn{(1-\alpha)T} largest drawdowns \eqn{d_1^{M}
+ ,......d_t^M} of the optimal portfolio and
+ \eqn{q_t^\asterisk = 0} otherwise. It is assumed that
+ \eqn{D_\alpha(w^M) {\neq} 0} and that \eqn{q_t^\asterisk}
+ and \eqn{k^{\asterisk}(t) are uniquely determined for all
+ \eqn{t = 1....T}
+
+ The numerator in \eqn{\beta_DD} is the average rate of
+ return of the instrument over time periods corresponding
+ to the \eqn{(1-\alpha)T} largest drawdowns of the optimal
+ portfolio, where \eqn{w_t - w_k^{\asterisk}(t)} is the
+ cumulative rate of return of the instrument from the
+ optimal portfolio#' peak time \eqn{k^\asterisk(t)} to
+ time t.
+
+ The difference in CDaR and standard betas can be
+ explained by the conceptual difference in beta
+ definitions: the standard beta accounts for the fund
+ returns over the whole return history, including the
+ periods when the market goes up, while CDaR betas focus
+ only on market drawdowns and, thus, are not affected when
+ the market performs well.
+}
+\examples{
+BetaDrawdown(edhec[,1],edhec[,2]) #expected value 0.5390431
+}
+\references{
+ Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital
+ Asset Pricing Model (CAPM) with Drawdown Measure.Research
+ Report 2012-9, ISE Dept., University of Florida,September
+ 2012.
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/CdarMultiPath.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/CdarMultiPath.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/CdarMultiPath.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,63 @@
+\name{CdarMultiPath}
+\alias{CdarMultiPath}
+\title{Conditional Drawdown at Risk for Multiple Sample Path}
+\usage{
+ CdarMultiPath(R, ps, sample, geometric = TRUE, p = 0.95,
+ ...)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix,data frame, timeSeries or
+ zoo object of multiple sample path returns}
+
+ \item{ps}{the probability for each sample path}
+
+ \item{scen}{the number of scenarios in the Return series}
+
+ \item{instr}{the number of instruments in the Return
+ series}
+
+ \item{geometric}{utilize geometric chaining (TRUE) or
+ simple/arithmetic chaining (FALSE) to aggregate returns,
+ default TRUE}
+
+ \item{p}{confidence level for calculation
+ ,default(p=0.95)}
+
+ \item{\dots}{any other passthru parameters}
+}
+\description{
+ For a given \eqn{\alpha \epsilon [0,1]} in the multiple
+ sample-paths setting,CDaR, denoted by
+ \eqn{D_{\alpha}(w)}, is the average of
+ \eqn{(1-\alpha).100\%} drawdowns of the set
+ {d_st|t=1,....T,s = 1,....S}, and is defined by
+
+ \deqn{D_\alpha(w) =
+ \max_{{q_st}{\epsilon}Q}{\sum_{s=1}^S}{\sum_{t=1}^T}{p_s}{q_st}{d_st}},
+
+ where
+
+ \deqn{Q = \left\{ \left\{ q_st\right\}_{s,t=1}^{S,T} |
+ \sum_{s = 1}^S \sum_{t = 1}^T{p_s}{q_st} = 1,
+ 0{\leq}q_st{\leq}\frac{1}{(1-\alpha)T}, s = 1....S, t =
+ 1.....T \right\}}
+
+ For \eqn{\alpha = 1} , \eqn{D_\alpha(w)} is defined by
+ (3) with the constraint
+ \eqn{0{\leq}q_st{\leq}\frac{1}{(1-\alpha)T}}, in Q
+ replaced by \eqn{q_st{\geq}0}
+
+ As in the case of a single sample-path, the CDaR
+ definition includes two special cases : (i) for
+ \eqn{\alpha = 1},\eqn{D_1(w)} is the maximum drawdown,
+ also called drawdown from peak-to-valley, and (ii) for
+ \eqn{\alpha} = 0, \eqn{D_\alpha(w)} is the average
+ drawdown
+}
+\references{
+ Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital
+ Asset Pricing Model (CAPM) with Drawdown Measure.Research
+ Report 2012-9, ISE Dept., University of Florida,
+ September 2012
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/DrawdownGPD.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/DrawdownGPD.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/DrawdownGPD.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,88 @@
+\name{DrawdownGPD}
+\alias{DrawdownGPD}
+\title{Modelling Drawdown using Extreme Value Theory
+
+It has been shown empirically that Drawdowns can be modelled using Modified Generalized Pareto
+distribution(MGPD), Generalized Pareto Distribution(GPD) and other particular cases of MGPD such
+as weibull distribution \eqn{MGPD(\gamma,0,\psi)} and unit exponential distribution\eqn{MGPD(1,0,\psi)}
+
+Modified Generalized Pareto Distribution is given by the following formula
+
+\dqeqn{G_{\eta}(m) = \begin{array}{l} 1-(1+\eta\frac{m^\gamma}{\psi})^(-1/\eta), if \eta \neq 0 \\ 1- e^{-frac{m^\gamma}{\psi}}, if \eta = 0,\end{array}}
+
+Here \eqn{\gamma{\epsilon}R} is the modifying parameter. When \eqn{\gamma<1} the corresponding densities are
+strictly decreasing with heavier tail; the GDP is recovered by setting \eqn{\gamma = 1} .\eqn{\gamma \textgreater 1}
+
+The GDP is given by the following equation. \eqn{MGPD(1,\eta,\psi)}
+
+\deqn{G_{\eta}(m) = \begin{array}{l} 1-(1+\eta\frac{m}{\psi})^(-1/\eta), if \eta \neq 0 \\ 1- e^{-frac{m}{\psi}}, if \eta = 0,\end{array}}
+
+The weibull distribution is given by the following equation \eqn{MGPD(\gamma,0,\psi)}
+
+\deqn{G(m) = 1- e^{-frac{m^\gamma}{\psi}}}
+
+The unit exponential distribution is given by the following equation \eqn{MGPD(1,0,\psi)}
+
+\deqn{G(m) = 1- e^{-m}}}
+\usage{
+ DrawdownGPD(R, type = c("gpd", "pd", "weibull"),
+ threshold = 0.9)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset return}
+
+ \item{type}{The type of distribution
+ "gpd","pd","weibull"}
+
+ \item{threshold}{The threshold beyond which the drawdowns
+ have to be modelled}
+}
+\description{
+ Modelling Drawdown using Extreme Value Theory
+
+ It has been shown empirically that Drawdowns can be
+ modelled using Modified Generalized Pareto
+ distribution(MGPD), Generalized Pareto Distribution(GPD)
+ and other particular cases of MGPD such as weibull
+ distribution \eqn{MGPD(\gamma,0,\psi)} and unit
+ exponential distribution\eqn{MGPD(1,0,\psi)}
+
+ Modified Generalized Pareto Distribution is given by the
+ following formula
+
+ \dqeqn{G_{\eta}(m) = \begin{array}{l}
+ 1-(1+\eta\frac{m^\gamma}{\psi})^(-1/\eta), if \eta \neq 0
+ \\ 1- e^{-frac{m^\gamma}{\psi}}, if \eta = 0,\end{array}}
+
+ Here \eqn{\gamma{\epsilon}R} is the modifying parameter.
+ When \eqn{\gamma<1} the corresponding densities are
+ strictly decreasing with heavier tail; the GDP is
+ recovered by setting \eqn{\gamma = 1} .\eqn{\gamma
+ \textgreater 1}
+
+ The GDP is given by the following equation.
+ \eqn{MGPD(1,\eta,\psi)}
+
+ \deqn{G_{\eta}(m) = \begin{array}{l}
+ 1-(1+\eta\frac{m}{\psi})^(-1/\eta), if \eta \neq 0 \\ 1-
+ e^{-frac{m}{\psi}}, if \eta = 0,\end{array}}
+
+ The weibull distribution is given by the following
+ equation \eqn{MGPD(\gamma,0,\psi)}
+
+ \deqn{G(m) = 1- e^{-frac{m^\gamma}{\psi}}}
+
+ The unit exponential distribution is given by the
+ following equation \eqn{MGPD(1,0,\psi)}
+
+ \deqn{G(m) = 1- e^{-m}}
+}
+\references{
+ Mendes, Beatriz V.M. and Leal, Ricardo P.C., Maximum
+ Drawdown: Models and Applications (November 2003).
+ Coppead Working Paper Series No. 359. Available at SSRN:
+ http://ssrn.com/abstract=477322 or
+ http://dx.doi.org/10.2139/ssrn.477322.
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/EDDCOPS.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/EDDCOPS.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/EDDCOPS.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,53 @@
+\name{EDDCOPS}
+\alias{EDDCOPS}
+\title{Economic Drawdown Controlled Optimal Portfolio Strategy}
+\usage{
+ EDDCOPS(R, delta, gamma, Rf, geometric = TRUE, ...)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset returns}
+
+ \item{delta}{Drawdown limit}
+
+ \item{gamma}{(1-gamma) is the investor risk aversion else
+ the return series will be used}
+
+ \item{Rf}{risk free rate can be vector such as government
+ security rate of return.}
+
+ \item{h}{Look back period}
+
+ \item{geomtric}{geometric utilize geometric chaining
+ (TRUE) or simple/arithmetic #'chaining(FALSE) to
+ aggregate returns, default is TRUE.}
+
+ \item{...}{any other variable}
+}
+\description{
+ The Economic Drawdown Controlled Optimal Portfolio
+ Strategy(EDD-COPS) has the portfolio fraction allocated
+ to single risky asset as:
+
+ \deqn{x_t = Max\left\{0,\biggl(\frac{\lambda/\sigma +
+ 1/2}{1-\delta.\gamma}\biggr).\biggl[\frac{\delta-EDD(t)}{1-EDD(t)}\biggr]\right\}}
+
+ The risk free asset accounts for the rest of the
+ portfolio allocation \eqn{x_f = 1 - x_t}.
+}
+\examples{
+# with S&P 500 data and T-bill data
+
+dt<-read.zoo("returns.csv",sep=",",header = TRUE)
+dt<-as.xts(dt)
+EDDCOPS(dt[,1],delta = 0.33,gamma = 0.7,Rf = (1+dt[,2])^(1/12)-1,geometric = TRUE)
+
+data(edhec)
+EDDCOPS(edhec,delta = 0.1,gamma = 0.7,Rf = 0)
+}
+\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)
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/EconomicDrawdown.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/EconomicDrawdown.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/EconomicDrawdown.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,74 @@
+\name{EconomicDrawdown}
+\alias{EconomicDrawdown}
+\title{Calculate the Economic Drawdown}
+\usage{
+ EconomicDrawdown(R, Rf, geometric = TRUE, ...)
+
+ EconomicDrawdown(R, Rf, geometric = TRUE, ...)
+}
+\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{geometric}{utilize geometric chaining (TRUE) or
+ simple/arithmetic chaining(FALSE) to aggregate returns,
+ default is TRUE}
+
+ \item{\dots}{any other variable}
+
+ \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{geometric}{utilize geometric chaining (TRUE) or
+ simple/arithmetic chaining(FALSE) to aggregate returns,
+ default is TRUE}
+
+ \item{\dots}{any other variable}
+}
+\description{
+ \code{EconomicDrawdown} calculates the Economic
+ Drawdown(EDD) for a return series.To calculate the
+ economic drawdown cumulative return and economic max is
+ calculated for each point. The risk free return(rf) is
+ taken as the input.
+
+ Economic Drawdown is given by the equation
+
+ \deqn{EDD(t)=1-\frac{W_t}/{EM(t)}}
+
+ Here EM stands for Economic Max and is the code
+ \code{\link{EconomicMax}}
+
+ \code{EconomicDrawdown} calculates the Economic
+ Drawdown(EDD) for a return series.To calculate the
+ economic drawdown cumulative return and economic max is
+ calculated for each point. The risk free return(rf) is
+ taken as the input.
+
+ Economic Drawdown is given by the equation
+
+ \deqn{EDD(t)=1-\frac{W_t}/{EM(t)}}
+
+ Here EM stands for Economic Max and is the code
+ \code{\link{EconomicMax}}
+}
+\examples{
+EconomicDrawdown(edhec,0.08,100)
+EconomicDrawdown(edhec,0.08,100)
+}
+\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)
+
+ Yang, Z. George and Zhong, Liang, Optimal Portfolio
+ Strategy to Control Maximum Drawdown - The Case of Risk
+ Based Dynamic Asset Allocation (February 25, 2012)
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/MaxDD.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/MaxDD.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/MaxDD.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,72 @@
+\name{MaxDD}
+\alias{MaxDD}
+\title{Triple Penance Rule}
+\usage{
+ MaxDD(R, confidence, type = c("ar", "normal"), ...)
+}
+\arguments{
+ \item{R}{Returns}
+
+ \item{confidence}{the confidence interval}
+
+ \item{type}{The type of distribution "normal" or
+ "ar"."ar" stands for Autoregressive.}
+}
+\description{
+ \code{MaxDD} calculates the Maximum drawdown for a
+ particular confidence interval. Maximum Drawdown tells us
+ Up to how much could a particular strategy lose with a
+ given confidence level ?. This function calculated
+ Maximum Drawdown for two underlying processes normal and
+ autoregressive. For a normal process Maximum Drawdown is
+ given by the formula When the distibution is normal
+
+ \deqn{MaxDD_{\alpha}=max\left\{0,\frac{(z_{\alpha}\sigma)^2}{4\mu}\right\}}
+
+ The time at which the Maximum Drawdown occurs is given by
+ \deqn{t^\ast=\biggl(\frac{Z_{\alpha}\sigma}{2\mu}\biggr)^2}
+ Here $Z_{\alpha}$ is the critical value of the Standard
+ Normal Distribution associated with a probability
+ $\alpha$.$\sigma$ and $\mu$ are the Standard Distribution
+ and the mean respectively. When the distribution is
+ non-normal and time dependent, Autoregressive process.
+
+ \deqn{Q_{\alpha,t}=\frac{\phi^{(t+1)}-\phi}{\phi-1}(\triangle\pi_0-\mu)+{\mu}t+Z_{\alpha}\frac{\sigma}{|\phi-1|}\biggl(\frac{\phi^{2(t+1)}-1}{\phi^2-1}-2\frac{\phi^(t+1)-1}{\phi-1}+t+1\biggr)^{1/2}}
+
+ $\phi$ is estimated as
+
+ \deqn{\hat{\phi} =
+ Cov_0[\triangle\pi_\tau,\triangle\pi_{\tau-1}](Cov_0[\triangle\pi_{\tau-1},\triangle\pi_{\tau-1}])^{-1}}
+
+ and the Maximum Drawdown is given by.
+
+ \deqn{MaxDD_{\alpha}=max\left\{0,-MinQ_\alpha\right\}}
+
+ The non normal time dependent process is defined by
+
+ \deqn{\triangle{\pi_{\tau}}=(1-\phi)\mu +
+ \phi{\delta_{\tau-1}} + \sigma{\epsilon_{\tau}}}
+
+ The random shocks are iid distributed
+ \eqn{\epsilon_{\tau}~N(0,1)}. These random shocks follow
+ an independent and identically distributed Gaussian
+ Process, however \eqn{\triangle{\pi_\tau}} is neither an
+ independent nor an identically distributed Gaussian
+ Process. This is due to the parameter \eqn{\phi}, which
+ incorporates a first-order serial-correlation effect of
+ auto-regressive form.
+
+ Golden Section Algorithm is used to calculate the Minimum
+ of the function Q.
+}
+\examples{
+data(edhec)
+MaxDD(edhec,0.95,"ar")
+MaxDD(edhec[,1],0.95,"normal") #expected values 4.241799 6.618966
+}
+\references{
+ Bailey, David H. and Lopez de Prado, Marcos,
+ Drawdown-Based Stop-Outs and the ‘Triple Penance’
+ Rule(January 1, 2013).
+}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/MinTrackRecord.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/MinTrackRecord.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/MinTrackRecord.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,80 @@
+\name{MinTrackRecord}
+\alias{MinTrackRecord}
+\title{Minimum Track Record Length}
+\usage{
+ MinTrackRecord(R = NULL, refSR, Rf = 0, p = 0.95,
+ weights = NULL, sr = NULL, sk = NULL, kr = NULL, ...)
+}
+\arguments{
+ \item{R}{an xts, vector, matrix, data frame, timeSeries
+ or zoo object of asset return}
+
+ \item{Rf}{the risk free rate of return}
+
+ \item{refSR}{the reference Sharpe Ratio, can be a single
+ value or a vector for a multicolumn return series.Should
+ be non-annualized , in the same periodicity as the
+ returns.}
+
+ \item{p}{the confidence level}
+
+ \item{weights}{the weights for the portfolio}
+
+ \item{sr}{Sharpe Ratio,in the same periodicity as the
+ returns(non-annualized). To be given in case the return
+ series is not given.}
+
+ \item{sk}{Skewness, in the same periodicity as the
+ returns(non-annualized). To be given in case the return
+ series is not given.}
+
+ \item{kr}{Kurtosis, in the same periodicity as the
+ returns(non-annualized). To be given in case the return
+ series is not given.}
+}
+\description{
+ Minimum Track Record Length tells us “How long should a
+ track record be in order to have statistical confidence
+ that its Sharpe ratio is above a given threshold? ". If a
+ track record is shorter than MinTRL, we do not have
+ enough confidence that the observed Sharpe Ratio is above
+ the designated threshold. The reference Sharpe Ratio
+ should be less than the observed Sharpe Ratio and the
+ Values should be given in non-annualized terms, in the
+ same periodicity as the return series. The Minimum Track
+ Record Length is also given in the same Periodicity as
+ the Return Series.
+
+ \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}
+
+ $\gamma{_3}$ and $\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.
+
+ The sharpe ratio , skewness and kurtosis can be directly
+ given if the return series is not available using the
+ input parameters sr,sk and kr. If the return series is
+ available these parameters can be left.
+
+ weights will be needed to be entered if a portfolio's
+ MinTRL is to be calculated else weight can be left as
+ NULL.
+}
+\examples{
+data(edhec)
+MinTrackRecord(edhec[,1],refSR=0.1,Rf = 0.04/12)
+MinTrackRecord(refSR = 1/12^0.5,Rf = 0,p=0.95,sr = 2/12^0.5,sk=-0.72,kr=5.78)
+MinTrackRecord(edhec[,1:2],refSR = c(0.28,0.24))
+}
+\references{
+ Bailey, David H. and Lopez de Prado, Marcos, \emph{The
+ Sharpe Ratio Efficient Frontier} (July 1, 2012). Journal
+ of Risk, Vol. 15, No. 2, Winter 2012/13
+}
+\keyword{distribution}
+\keyword{models}
+\keyword{multivariate}
+\keyword{ts}
+
Added: pkg/PerformanceAnalytics/sandbox/pulkit/man/MonteSimulTriplePenance.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/MonteSimulTriplePenance.Rd (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/MonteSimulTriplePenance.Rd 2013-08-17 21:18:06 UTC (rev 2808)
@@ -0,0 +1,46 @@
+\name{MonteSimulTriplePenance}
+\alias{MonteSimulTriplePenance}
+\title{Monte Carlo Simulation for the Triple Penance Rule}
+\usage{
+ MonteSimulTriplePenance(size, phi, mu, sigma, dp0, bets,
+ confidence)
+}
+\arguments{
+ \item{size}{size of the Monte Carlo experiment}
+
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/returnanalytics -r 2808
More information about the Returnanalytics-commits
mailing list