[Returnanalytics-commits] r2826 - in pkg/PerformanceAnalytics/sandbox/pulkit: . R man vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Aug 19 15:08:10 CEST 2013
Author: pulkit
Date: 2013-08-19 15:08:10 +0200 (Mon, 19 Aug 2013)
New Revision: 2826
Modified:
pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION
pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/CdaR.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBeta.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBetaMulti.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/Edd.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/ExtremeDrawdown.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/PSRopt.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/ProbSharpeRatio.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/REDDCOPS.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/REM.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.REDD.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/redd.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R
pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R
pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd
pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw
pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw
pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw
Log:
check
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/DESCRIPTION 2013-08-19 13:08:10 UTC (rev 2826)
@@ -9,7 +9,8 @@
xts,
PerformanceAnalytics
Suggests:
- PortfolioAnalytics
+ PortfolioAnalytics,
+ lpSolve
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.
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE 2013-08-19 13:08:10 UTC (rev 2826)
@@ -1,5 +1,6 @@
export(AlphaDrawdown)
export(BenchmarkSR)
+export(CDaR)
export(CdarMultiPath)
export(chart.BenchmarkSR)
export(chart.Penance)
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -29,7 +29,8 @@
#'"sharpe","correlation" or "strategies"
#'@param ylim set the ylim value, as in \code{\link{plot}}
#'@param xlim set the xlim value, as in \code{\link{plot}}
-
+#'
+#'@author Pulkit Mehrotra
#'@references
#'Bailey, David H. and Lopez de Prado, Marcos, The Strategy Approval Decision:
#'A Sharpe Ratio Indifference Curve Approach (January 2013). Algorithmic Finance,
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -15,6 +15,7 @@
#'
#'@param R a vector, matrix, data frame,timeseries or zoo object of asset returns
#'
+#'@author Pulkit Mehrotra
#'@references
#'Bailey, David H. and Lopez de Prado, Marcos, The Strategy Approval Decision:
#'A Sharpe Ratio Indifference Curve Approach (January 2013). Algorithmic Finance,
@@ -66,4 +67,4 @@
#
# $Id: BenchmarkSR.R $
#
-###############################################################################
\ No newline at end of file
+###############################################################################
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/CDaRMultipath.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -29,6 +29,7 @@
#'@param p confidence level for calculation ,default(p=0.95)
#'@param \dots any other passthru parameters
#'
+#'@author Pulkit Mehrotra
#'@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
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/CdaR.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/CdaR.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/CdaR.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -1,3 +1,36 @@
+#'@title
+#' Calculate Uryasev's proposed Conditional Drawdown at Risk (CDD or CDaR)
+#' measure
+#'
+#' @description
+#' For some confidence level \eqn{p}, the conditional drawdown is the the mean
+#' of the worst \eqn{p\%} drawdowns.
+#'
+#' @aliases CDD CDaR
+#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' asset returns
+#' @param weights portfolio weighting vector, default NULL, see Details
+#' @param geometric utilize geometric chaining (TRUE) or simple/arithmetic chaining (FALSE) to aggregate returns,
+#' default TRUE
+#' @param invert TRUE/FALSE whether to invert the drawdown measure. see
+#' Details.
+#' @param p confidence level for calculation, default p=0.95
+#' @param \dots any other passthru parameters
+#' @author Brian G. Peterson
+#' @seealso \code{\link{ES}} \code{\link{maxDrawdown}}
+#' @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
+#' @keywords ts multivariate distribution models
+#' @examples
+#' library(lpSolve)
+#' data(edhec)
+#' t(round(CDaR(edhec),4))
+#'
+#' @export
+
+
CDaR<-function (R, weights = NULL, geometric = TRUE, invert = TRUE, p = 0.95, ...)
{
#p = .setalphaprob(p)
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBeta.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBeta.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBeta.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -34,6 +34,7 @@
#' alpha = 0 and if "max" then alpha = 1 is taken.
#'@param \dots any passthru variable.
#'
+#'@author Pulkit Mehrotra
#'@references
#'Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital Asset Pricing Model
#'(CAPM) with Drawdown Measure.Research Report 2012-9, ISE Dept., University
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBetaMulti.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBetaMulti.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/DrawdownBetaMulti.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -29,6 +29,7 @@
#' alpha = 0 and if "max" then alpha = 1 is taken.
#'@param \dots any passthru variable.
#'
+#'@author Pulkit Mehrotra
#'@references
#'Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital Asset Pricing Model
#'(CAPM) with Drawdown Measure.Research Report 2012-9, ISE Dept., University
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/Drawdownalpha.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -25,16 +25,19 @@
#' @param 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.
#'@param \dots any passthru variable
#'
+#'@author Pulkit Mehrotra
#'@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.
#'@examples
-#'AlphaDrawdown(edhec[,1],edhec[,2]) ## expected value : 0.5141929
+#'data(edhec)
+#'AlphaDrawdown(edhec[,1],edhec[,2])
#'
-#'AlphaDrawdown(edhec[,1],edhec[,2],type="max") ## expected value : 0.8983177
+#'AlphaDrawdown(edhec[,1],edhec[,2],type="max") # expected value : 0.8983177
#'
-#'AlphaDrawdown(edhec[,1],edhec[,2],type="average") ## expected value : 1.692592
+#'AlphaDrawdown(edhec[,1],edhec[,2],type="average") # expected value : 1.692592
+#'
#'@export
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/Edd.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/Edd.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/Edd.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -18,6 +18,7 @@
#'@param geometric utilize geometric chaining (TRUE) or simple/arithmetic chaining(FALSE)
#'to aggregate returns, default is TRUE
#'@param \dots any other variable
+#'@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)
#'@examples
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/ExtremeDrawdown.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/ExtremeDrawdown.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/ExtremeDrawdown.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -29,7 +29,8 @@
#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of asset return
#' @param type The type of distribution "gpd","pd","weibull"
#' @param threshold The threshold beyond which the drawdowns have to be modelled
-#'
+#'
+#'@author Pulkit Mehrotra
#'@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.
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/GoldenSection.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -18,6 +18,7 @@
#'@param b final point
#'@param minimum TRUE to calculate the minimum and FALSE to calculate the Maximum
#'@param function_name The name of the function
+#'@author Pulkit Mehrotra
#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
#'
#'@export
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/MaxDD.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -39,7 +39,7 @@
#' @param R Returns
#' @param confidence the confidence interval
#' @param type The type of distribution "normal" or "ar"."ar" stands for Autoregressive.
-#'
+#' @author Pulkit Mehrotra
#' @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-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/MinTRL.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -38,6 +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.
#'
+#'@author Pulkit Mehrotra
#'@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
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/MonteSimulTriplePenance.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -19,7 +19,7 @@
#' @param dp0 Bet at origin (initialization of AR(1))
#' @param bets Number of bets in the cumulative process
#' @param confidence Confidence level for quantile
-#'
+#' @author Pulkit Mehrotra
#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs
#' and the ‘Triple Penance’ Rule(January 1, 2013).
#'
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/PSRopt.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/PSRopt.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/PSRopt.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -22,6 +22,7 @@
#'@param MaxIter The Maximum number of iterations
#'@param delta The value of delta Z
#'
+#'@author Pulkit Mehrotra
#'@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
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/ProbSharpeRatio.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/ProbSharpeRatio.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/ProbSharpeRatio.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -30,7 +30,7 @@
#' @param kr Kurtosis, in the same periodicity as the returns(non-annualized).
#' To be given in case the return series is not given.
#' @param n track record length. To be given in case the return series is not given.
-#'
+#'@author Pulkit Mehrotra
#' @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
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/REDDCOPS.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/REDDCOPS.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/REDDCOPS.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -29,6 +29,7 @@
#'@param geomtric geometric utilize geometric chaining (TRUE) or simple/arithmetic #'chaining(FALSE) to aggregate returns, default is TRUE.
#'@param ... any other variable
#'
+#'@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)
#'
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/REM.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/REM.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/REM.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -20,6 +20,7 @@
#'@param h Look back period
#'@param geomtric geometric utilize geometric chaining (TRUE) or simple/arithmetic #'chaining(FALSE) to aggregate returns, default is TRUE.
#'@param ... any other variable
+#'@author Pulkit Mehrotra
#'@examples
#'rollEconomicMax(edhec,0.08,100)
#'@export
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -33,6 +33,7 @@
#'@param ylim set the ylim value, as in \code{\link{plot}}
#'@param xlim set the xlim value, as in \code{\link{plot}}
#'
+#'@author Pulkit Mehrotra
#'@references
#'Bailey, David H. and Lopez de Prado, Marcos, The Strategy Approval Decision:
#'A Sharpe Ratio Indifference Curve Approach (January 2013). Algorithmic Finance,
@@ -114,4 +115,4 @@
#
# $Id: chart.SRIndifferenceCurve.R $
#
-###############################################################################
\ No newline at end of file
+###############################################################################
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/TuW.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -26,7 +26,7 @@
#' @param R return series
#' @param confidence the confidence interval
#' @param type The type of distribution "normal" or "ar"."ar" stands for Autoregressive.
-#'
+#' @author Pulkit Mehrotra
#' @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/chart.Penance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.Penance.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -28,6 +28,7 @@
#'@param ylim set the ylim value, as in \code{\link{plot}}
#'@param xlim set the xlim value, as in \code{\link{plot}}
#'
+#'@author Pulkit Mehrotra
#'@seealso \code{\link{plot}}
#'@keywords ts multivariate distribution models hplot
#'@examples
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.REDD.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.REDD.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/chart.REDD.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -12,6 +12,7 @@
#'@param legend.loc set the legend.loc, as in \code{\link{plot}}
#'@param colorset set the colorset label, as in \code{\link{plot}}
#'@param \dots any other variable
+#'@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)
#'@examples
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/redd.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/redd.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/redd.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -19,6 +19,7 @@
#'@param geometric utilize geometric chaining (TRUE) or simple/arithmetic chaining(FALSE)
#'to aggregate returns, default is TRUE
#'@param \dots any other variable
+#'@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)
#'@examples
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/table.PSR.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -2,8 +2,9 @@
#'
#'@description
#'A table to display the Probabilistic Sharpe Ratio Along with
-#'the Minimum Track Record Length for better assessment of the returns.
-#'
+#'the Minimum Track Record Length for better assessment of the returns.For more
+#'details about Probabilistic Sharpe Ratio and Minimum Track record length see\
+#'\code{ProbSharpeRatio} and \code{MinTrackRecord} respectively.
#'@aliases table.PSR
#'
#'@param R the return series
@@ -12,6 +13,7 @@
#'@param the confidence level
#'@param weights the weights for the portfolio
#'
+#'@author Pulkit Mehrotra
#'@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
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/table.Penance.R 2013-08-19 13:08:10 UTC (rev 2826)
@@ -2,11 +2,14 @@
#' Table for displaying the Mximum Drawdown and the Time under Water
#'
#' @description
-#' \code{table.Penance} Displays the table showing mean,Standard Deviation , phi, sigma , MaxDD,time at which MaxDD occurs, MaxTuW and the penance.
+#' \code{table.Penance} Displays the table showing mean,Standard Deviation , phi, sigma , MaxDD,time at which MaxDD occurs, MaxTuW and the penance.For more
+#' details about MaxDD , Time under Water see code \code{MaxDD} and \code{TuW}
+#' respoectively.
#'
#' @param R Returns
#' @param confidence the confidence interval
#'
+#' @author Pulkit Mehrotra
#' @references Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs and the ‘Triple Penance’ Rule(January 1, 2013).
#' @export
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/man/AlphaDrawdown.Rd 2013-08-19 13:08:10 UTC (rev 2826)
@@ -48,11 +48,12 @@
their CAPM predictions
}
\examples{
-AlphaDrawdown(edhec[,1],edhec[,2]) ## expected value : 0.5141929
+data(edhec)
+AlphaDrawdown(edhec[,1],edhec[,2])
-AlphaDrawdown(edhec[,1],edhec[,2],type="max") ## expected value : 0.8983177
+AlphaDrawdown(edhec[,1],edhec[,2],type="max") # expected value : 0.8983177
-AlphaDrawdown(edhec[,1],edhec[,2],type="average") ## expected value : 1.692592
+AlphaDrawdown(edhec[,1],edhec[,2],type="average") # expected value : 1.692592
}
\references{
Zabarankin, M., Pavlikov, K., and S. Uryasev. Capital
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw 2013-08-19 13:08:10 UTC (rev 2826)
@@ -42,25 +42,25 @@
<<echo=FALSE>>=
-source("redd.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/redd.R")
@
<<echo=FALSE>>=
-source("edd.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/Edd.R")
@
<<echo=FALSE>>=
-source("REM.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/REM.R")
@
<<echo=FALSE>>=
-source("REDDCOPS.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/REDDCOPS.R")
@
<<echo=FALSE>>=
-source("EDDCOPS.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/EDDCOPS.R")
@
\section{ Rolling Economic Max }
Rolling Economic Max at time t, looking back at portfolio Wealth history
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw 2013-08-19 13:08:10 UTC (rev 2826)
@@ -4,6 +4,7 @@
\IfFileExists{url.sty}{\usepackage{url}}
{\newcommand{\url}{\texttt}}
+\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{Rd}
@@ -32,25 +33,24 @@
<<echo=FALSE>>=
library(PerformanceAnalytics)
-library(ggplot2)
data(edhec)
@
<<echo=FALSE>>=
-source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/week2/code/BenchmarkSR.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkSR.R")
@
<<echo=FALSE>>=
-source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/week2/code/SRIndifferenceCurve.R")
+source("/home/pulkit/workspace/GSOC/PerformanceAnalytics/sandbox/pulkit/R/SRIndifferenceCurve.R")
@
\section{Benchmark Sharpe Ratio}
- The performance of an Equal Volatility Weights benchmark ($SR_B$) is fully characterized in terms of:
+ The performance of an Equal Volatility Weights benchmark (\eqn{SR_B}) is fully characterized in terms of:
1. Number of approved strategies (S).
2. Average SR among strategies (SR).
-3. Average off-diagonal correlations among strategies($\bar{\rho}$)).
+3. Average off-diagonal correlations among strategies\eqn{\bar{\rho}}.
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.
@@ -59,7 +59,7 @@
\deqn{SR_B = \bar{SR}\sqrt{\frac{S}{1+(S-1)\bar{\rho}}}}
<<>>=
-BenchmanrkSR(edhec)
+BenchmarkSR(edhec)
@
\section{Sharpe Ratio Indifference Curve}
@@ -76,7 +76,7 @@
\deqn{\bar{\rho}{_{s+1}}=\frac{1}{2}\biggl[\frac{\bar{({SR}.S+SR_{s+1}})^2}{S.SR_B^2}-\frac{S+1}{S}-\bar{\rho}{S-1}\biggr]}
<<fig = TRUE>>=
-SRIndifference(edhec)
+chart.SRIndifference(edhec)
@
\end{document}
\ No newline at end of file
Modified: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw 2013-08-19 09:18:25 UTC (rev 2825)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw 2013-08-19 13:08:10 UTC (rev 2826)
@@ -37,20 +37,20 @@
@
<<echo=FALSE>>=
-source("../code/MaxDD.R")
+source("../R/MaxDD.R")
@
<<echo=FALSE>>=
-source("../code/TriplePenance.R")
+source("../R/TriplePenance.R")
@
<<echo=FALSE>>=
-source("../code/GoldenSection.R")
+source("../R/GoldenSection.R")
@
<<echo=FALSE>>=
-source("../code/TuW.R")
+source("../R/TuW.R")
@
\section{ Maximum Drawdown }
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
@@ -61,6 +61,7 @@
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.
More information about the Returnanalytics-commits
mailing list