[Returnanalytics-commits] r2944 - in pkg/PerformanceAnalytics/sandbox/pulkit: . R vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 30 17:28:20 CEST 2013


Author: pulkit
Date: 2013-08-30 17:28:20 +0200 (Fri, 30 Aug 2013)
New Revision: 2944

Removed:
   pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/ProbSharpe.Rnw
   pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/ProbSharpe.pdf
   pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw
   pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw
   pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw
Modified:
   pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
   pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/TriplePenance.R
   pkg/PerformanceAnalytics/sandbox/pulkit/R/na.skip.R
Log:
check changes

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/NAMESPACE	2013-08-30 15:28:20 UTC (rev 2944)
@@ -7,20 +7,14 @@
 export(chart.Penance)
 export(chart.REDD)
 export(chart.SRIndifference)
-export(dd_norm)
-export(diff_Q)
 export(DrawdownGPD)
 export(EconomicDrawdown)
 export(EDDCOPS)
-export(get_minq)
-export(getQ)
-export(get_TuW)
 export(golden_section)
 export(MaxDD)
 export(MinTrackRecord)
 export(MonteSimulTriplePenance)
 export(MultiBetaDrawdown)
-export(na.skip)
 export(ProbSharpeRatio)
 export(PsrPortfolio)
 export(REDDCOPS)
@@ -29,5 +23,4 @@
 export(table.Penance)
 export(table.PSR)
 export(TuW)
-export(tuw_norm)
 useDynLib(noniid.pm)

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/BenchmarkPlots.R	2013-08-30 15:28:20 UTC (rev 2944)
@@ -2,7 +2,8 @@
 #'
 #'@description
 #'Benchmark Sharpe Ratio Plots are used to give the relation ship between the
-#'Benchmark Sharpe Ratio and average correlation,average sharpe ratio or the number of #'strategies keeping other parameters constant. Here average Sharpe ratio , average #'correlation stand for the average of all the strategies in the portfolio. The original 
+#'Benchmark Sharpe Ratio and average correlation,average sharpe ratio or the number of #'strategies keeping other parameters constant. 
+#'Here average Sharpe ratio , average correlation stand for the average of all the strategies in the portfolio. The original 
 #'point of the return series is also shown on the plots.
 #'
 #'The equation for the Benchamark Sharpe Ratio is.

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/TriplePenance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/TriplePenance.R	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/TriplePenance.R	2013-08-30 15:28:20 UTC (rev 2944)
@@ -13,7 +13,7 @@
 ## REFERENCE:
 ## Bailey, David H. and Lopez de Prado, Marcos, Drawdown-Based Stop-Outs
 ## and the ‘Triple Penance’ Rule(January 1, 2013).
-#'@export
+
 dd_norm<-function(x,confidence){
     # DESCRIPTION:
     # A function to return the maximum drawdown for a normal distribution
@@ -30,7 +30,6 @@
     return(c(dd*100,t))
 }
 
-#'@export
 tuw_norm<-function(x,confidence){
     # DESCRIPTION:
     # A function to return the Time under water
@@ -47,7 +46,6 @@
 
 
 
-#'@export
 get_minq<-function(R,confidence){
   
     # DESCRIPTION:
@@ -75,7 +73,6 @@
     return(c(-minQ$value*100,minQ$x))
 }
 
-#'@export
 getQ<-function(bets,phi,mu,sigma,dp0,confidence){
 
     # DESCRIPTION:
@@ -103,7 +100,6 @@
 
 }
 
-#'@export
 get_TuW<-function(R,confidence){
 
     # DESCRIPTION:
@@ -134,7 +130,6 @@
 
 
 
-#'@export
 diff_Q<-function(bets,phi,mu,sigma,dp0,confidence){
   
   # DESCRIPTION:

Modified: pkg/PerformanceAnalytics/sandbox/pulkit/R/na.skip.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/R/na.skip.R	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/R/na.skip.R	2013-08-30 15:28:20 UTC (rev 2944)
@@ -1,4 +1,3 @@
-#'@export
 na.skip <- function (x, FUN=NULL, ...) # maybe add a trim capability?
 { # @author Brian Peterson
 

Deleted: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/ProbSharpe.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/ProbSharpe.Rnw	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/ProbSharpe.Rnw	2013-08-30 15:28:20 UTC (rev 2944)
@@ -1,101 +0,0 @@
-\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}
-

Deleted: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/ProbSharpe.pdf
===================================================================
(Binary files differ)

Deleted: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/REDDCOPS.Rnw	2013-08-30 15:28:20 UTC (rev 2944)
@@ -1,144 +0,0 @@
-\documentclass[12pt,letterpaper,english]{article}
-\usepackage{times}
-\usepackage[T1]{fontenc}
-\IfFileExists{url.sty}{\usepackage{url}}
-                      {\newcommand{\url}{\texttt}}
-
-\usepackage{babel}
-\usepackage{Rd}
-
-\usepackage{Sweave}
-\SweaveOpts{engine=R,eps = FALSE}
-%\VignetteIndexEntry{Rolling Economic Drawdown}
-%\VignetteDepends{PerformanceAnalytics}
-%\VignetteKeywords{Drawdown,risk,portfolio}
-%\VignettePackage{PerformanceAnalytics}
-
-\begin{document}
-\SweaveOpts{concordance=TRUE}
-
-\title{ Rolling Economic Drawdown Controlled Optimal Strategy }
-
-% \keywords{Drawdown,risk,portfolio}
-
-\makeatletter
-\makeatother
-\maketitle
-
-\begin{abstract}
-
-Drawdown based stopouts is a framework for informing the decision of stopping a portfolio manager or investment strategy once it has reached the drawdown or time under water limit associated with a certain confidence limit. 
-
-\end{abstract}
-
-<<echo = FALSE >>=
-library(PerformanceAnalytics)
-data(edhec)
-library(noniid.pm)
-@
-
-\section{ Rolling Economic Max }
-Rolling Economic Max at time t, looking back at portfolio Wealth history
-for a rolling window of length H is given by:
-
-\deqn{REM(t,h)=\max_{t-H \leq s}\[(1+r_f)^{t-s}W_s\]}
-
-Here rf is the average realized risk free rate over a period of length t-s. If the risk free rate is changing. This is used to compound.
-
-\deqn{ \prod_{i=s}^{t}(1+r_{i}{\triangle}t)}
-
-
-here  \eqn{r_i} denotes the risk free interest rate during \eqn{i^{th}} discrete 
-time interval \eqn{{\triangle}t}.
-
-
-\subsection{Usage of the function}
-
-The Return Series ,risk free rate of return , lookback priod and the type of cumulative return is taken as the input. The Return Series can be an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns.
-
-<<>>=
-data(edhec)
-head(rollEconomicMax(edhec,0.08,100))
-@
-
-
-
-\section{ Rolling Economic Drawdown }
-
-To calculate the rolling economic drawdown cumulative 
-return and rolling economic max is calculated for each point. The Return series,risk 
-free return(rf) and the lookback period(h) is taken as the input.
-Rolling Economic Drawdown is given by the equation.
-
-\deqn{REDD(t,h)=1-\frac{W_t}/{REM(t,H)}}
-
-Here REM stands for Rolling Economic Max
-
-\subsection{Usage}
-
-The Return Series ,risk free return and the type of cumulative return is taken as the input. The Return Series can be an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns.
-
-
-<<>>=
-data(edhec)
-head(rollDrawdown(edhec,0.08,100))
-@
-
-
-\section{ Rolling Economic Drawdown Controlled Optimal Strategy }
-
-The Rolling Economic Drawdown Controlled Optimal Portfolio Strategy(REDD-COPS) has 
-the portfolio fraction allocated to single risky asset as:
-
-
-The risk free asset accounts for the rest of the portfolio allocation \eqn{x_f = 1 - x_t}.
- 
-For two risky assets in REDD-COPS,dynamic asset allocation weights are :
-
-The portion of the risk free asset is \eqn{x_f = 1 - x_1 - x_2}.
-
-\subsection{Usage}
-
-The Return series ,drawdown limit, risk free rate and the lookback period , the number of assets and the type of REDD-COPS is taken as the input.
-
-
-<<>>=
-data(edhec)
-head(REDDCOPS(edhec,delta = 0.1,Rf = 0,h = 40))
-@
-
-\section{ Economic Drawdown }
-
-To calculate the economic drawdown cumulative 
-return and economic max is calculated for each point. The Return series,risk 
-free return(rf) and the lookback period(h) 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.
-
-\subsection{ Usage}
-
-The Return Series ,risk free return and the type of cumulative return is taken as the input. The Return Series can be an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns.
-
-<<>>=
-data(edhec)
-head(EDDCOPS(edhec,delta = 0.1,gamma = 0.7,Rf = 0))
-@
-
-\section{ Economic Drawdown Controlled Optimal Strategy }
-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}.
- 
-\subsection{Usage}
-<<>>=
-data(edhec)
-head(EDDCOPS(edhec,delta = 0.1,gamma = 0.7,Rf = 0))
-@
-
-\end{document}

Deleted: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/SharepRatioEfficientFrontier.Rnw	2013-08-30 15:28:20 UTC (rev 2944)
@@ -1,76 +0,0 @@
-\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{Sharpe Ratio Indifference Curve}
-%\VignetteDepends{PerformanceAnalytics}
-%\VignetteKeywords{Benchmark Sharpe Ratio,Sharpe Ratio Indifference Curve,Benchmark Sharpe Ratio Plots}
-%\VignettePackage{PerformanceAnalytics}
-
-\begin{document}
-\SweaveOpts{concordance=TRUE}
-
-\title{Sharpe Ratio Indifference Curve}
-% \keywords{Sharpe Ratio Indifference Curve,Benchmark Sharpe Ratio,risk,benchmark,portfolio}
-
-\makeatletter
-\makeatother
-\maketitle
-
-\begin{abstract}
-
- This vignette gives an overview of the Benchmark Sharpe Ratio, Sharpe Ratio Indifference Curve and various plots associated with a Benchmark Sharpe Ratio.It gives an overview of the usability of the functions and its application.
- 
- \end{abstract}
- 
-<<echo=FALSE>>=
-library(PerformanceAnalytics)
-data(edhec)
-library(noniid.pm)
-@
-
- 
- \section{Benchmark Sharpe Ratio}
- 
- 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\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.
- 
-The benchmark Sharpe Ratio is given by the following equation.
- 
-\deqn{SR_B = \bar{SR}\sqrt{\frac{S}{1+(S-1)\bar{\rho}}}}
- 
-<<>>=
-BenchmarkSR(edhec)
-@
-
-\section{Sharpe Ratio Indifference Curve}
-
-The trade-off between a candidate’s SR and its correlation
-to the existing set of strategies, is given by the Sharpe 
-ratio indifference curve. It is a plot between the candidate's 
-Sharpe Ratio and candidate's average correlation for a given 
-portfolio Sharpe Ratio.
-
-The equation for the candidate's average autocorrelation for a given 
-sharpe Ratio is given by
-
-\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>>=
-chart.SRIndifference(edhec)
-@
-
-\end{document}
\ No newline at end of file

Deleted: pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw	2013-08-30 14:04:36 UTC (rev 2943)
+++ pkg/PerformanceAnalytics/sandbox/pulkit/vignettes/TriplePenance.Rnw	2013-08-30 15:28:20 UTC (rev 2944)
@@ -1,105 +0,0 @@
-\documentclass[12pt,letterpaper,english]{article}
-\usepackage{times}
-\usepackage[T1]{fontenc}
-\IfFileExists{url.sty}{\usepackage{url}}
-                      {\newcommand{\url}{\texttt}}
-
-\usepackage{babel}
-\usepackage{Rd}
-
-\usepackage{Sweave}
-\SweaveOpts{engine=R,eps = FALSE}
-%\VignetteIndexEntry{Triple Penance Rule}
-%\VignetteDepends{PerformanceAnalytics}
-%\VignetteKeywords{Triple Penance Rule,Maximum Drawdown,Time under water,risk,portfolio}
-%\VignettePackage{PerformanceAnalytics}
-
-\begin{document}
-\SweaveOpts{concordance=TRUE}
-
-\title{ Triple Penance Rule }
-
-% \keywords{Triple Penance Rule,Maximum Drawdown,Time Under Water,risk,portfolio}
-
-\makeatletter
-\makeatother
-\maketitle
-
-\begin{abstract}
-
-Drawdown based stopouts is a framework for informing the decision of stopping a portfolio manager or investment strategy once it has reached the drawdown or time under water limit associated with a certain confidence limit. 
-
-\end{abstract}
-
-<<echo = FALSE >>=
-library(PerformanceAnalytics)
-data(edhec)
-library(noniid.pm)
-@
-\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
-
-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\}}
-
-Golden Section Algorithm is used to calculate the Minimum of the function Q.
-
-
-\subsection{Usage of the function}
-
-The Return Series ,confidence level and the type of distribution is taken as the input. The Return Series can be an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns.
-<<>>=
-data(edhec)
-MaxDD(edhec,0.95,type="ar")
-@
-
-
-The $t^\ast$ in the output is the time at which Maximum Drawdown occurs.
-
-\section{ Maximum Time Under Water }
-
-For a particular sequence $\left\{\pi_t\right\}$, the time under water $(TuW)$ is the minimum number of observations, $t>0$, such that $\pi_{t-1}<0$ and $\pi_t>0$. 
-
-For a normal distribution Maximum Time Under Water is given by the following expression.
-
-\deqn{MaxTuW_\alpha=\biggl(\frac{Z_\alpha{\sigma}}{\mu}\biggr)^2}
-
-For a Autoregressive process the Time under water is found using the golden section algorithm.
-
-\subsection{Usage}
-<<>>=
-data(edhec)
-TuW(edhec,0.95,type="ar")
-@
-
-The Return Series ,confidence level and the type of distribution is taken as the input. The Return Series can be an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns.
-
-The out is given in the same periodicity as the input series.
-
-\section{ Golden Section Algorithm }
-
-
-\end{document}
-



More information about the Returnanalytics-commits mailing list