[Returnanalytics-commits] r3051 - in pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 11 01:57:44 CEST 2013


Author: shubhanm
Date: 2013-09-11 01:57:44 +0200 (Wed, 11 Sep 2013)
New Revision: 3051

Modified:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/EmaxDDGBM.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.EMaxDDGBM.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/EMaxDDGBM.Rd
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.EMaxDDGBM.Rd
Log:
Output format change,+ addition of examples

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE	2013-09-10 23:24:02 UTC (rev 3050)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE	2013-09-10 23:57:44 UTC (rev 3051)
@@ -3,7 +3,7 @@
 export(CDrawdown)
 export(chart.AcarSim)
 export(chart.Autocorrelation)
-export(EMaxDDGBM)
+export(EmaxDDGBM)
 export(GLMSmoothIndex)
 export(LoSharpe)
 export(QP.Norm)

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/EmaxDDGBM.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/EmaxDDGBM.R	2013-09-10 23:24:02 UTC (rev 3050)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/EmaxDDGBM.R	2013-09-10 23:57:44 UTC (rev 3051)
@@ -1,17 +1,31 @@
-#' Expected Drawdown using Brownian Motion Assumptions
+#' @title Summary of Expected Drawdown using Brownian Motion Assumptions and Return-Volatility 
 #' 
-#' Works on the model specified by Maddon-Ismail
-#' 
-#' 
-#' 
-#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of
-#' asset returns
+#' @title Expected Maximum Drawdown Using Brownian Motion Assumptions
+#' @description  Works on the model specified by Maddon-Ismail which investigates the behavior of this statistic for a Brownian motion 
+#' with drift.
+#' @details If X(t) is a random process on [0, T ], the maximum drawdown at time T , D(T), is defined by
+#' where \deqn{D(T) = sup [X(s) - X(t)]} where s belongs to [0,t] and s belongs to [0,T]
+#'Informally, this is the largest drop from a peak to a bottom. In this paper, we investigate the
+#'behavior of this statistic for a Brownian motion with drift. In particular, we give an infinite 
+#'series representation of its distribution, and consider its expected value. When the drift is zero,
+#'we give an analytic expression for the expected value, and for non-zero drift, we give an infinite
+#'series representation. For all cases, we compute the limiting \bold{(\eqn{T tends to \infty})} behavior, which can be
+#'logarithmic (\eqn{\mu} > 0), square root (\eqn{\mu} = 0), or linear (\eqn{\mu} < 0).
+#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of  asset returns
 #' @param digits significant number
-#' @author Shubhankit
+#' @author Shubhankit Mohan
 #' @keywords Expected Drawdown Using Brownian Motion Assumptions
-#'
+#' @references Magdon-Ismail, M., Atiya, A., Pratap, A., and Yaser S. Abu-Mostafa: On the Maximum Drawdown of a Browninan Motion, Journal of Applied Probability 41, pp. 147-161, 2004 \url{http://alumnus.caltech.edu/~amir/drawdown-jrnl.pdf}
+#' @keywords Drawdown models Brownian Motion Assumptions
+#' @examples
+#' 
+#'library(PerformanceAnalytics)
+#' data(edhec)
+#' EmaxDDGBM(edhec)
+#' @rdname EMaxDDGBM
+#' @export
 #' @export 
-EMaxDDGBM <-
+EmaxDDGBM <-
   function (R,digits =4)
   {# @author 
     
@@ -153,13 +167,26 @@
           Ed<-(2*sig^2/mu)*(-Qn)
           
         }
-        
       }
       
-       return(Ed[1]*100)
       
+      z = c((Ed*100))
+      znames = c("Expected Drawdown in % using Brownian Motion Assumptions")
+      if(column == 1) {
+        resultingtable = data.frame(Value = z, row.names = znames)
+      }
+      else {
+        nextcolumn = data.frame(Value = z, row.names = znames)
+        resultingtable = cbind(resultingtable, nextcolumn)
+      }
+    }
+    colnames(resultingtable) = columnnames
+    ans = base::round(resultingtable, digits)
+    ans
+    
       
-  }
+      
+  
 }
 ###############################################################################
 # R (http://r-project.org/) 

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.EMaxDDGBM.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.EMaxDDGBM.R	2013-09-10 23:24:02 UTC (rev 3050)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.EMaxDDGBM.R	2013-09-10 23:57:44 UTC (rev 3051)
@@ -1,4 +1,4 @@
-#' @title Expected Drawdown using Brownian Motion Assumptions
+#' @title Summary of Expected Drawdown using Brownian Motion Assumptions and Return-Volatility 
 #' 
 #' @description  Works on the model specified by Maddon-Ismail which investigates the behavior of this statistic for a Brownian motion 
 #' with drift.

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/EMaxDDGBM.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/EMaxDDGBM.Rd	2013-09-10 23:24:02 UTC (rev 3050)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/EMaxDDGBM.Rd	2013-09-10 23:57:44 UTC (rev 3051)
@@ -1,8 +1,8 @@
-\name{EMaxDDGBM}
-\alias{EMaxDDGBM}
-\title{Expected Drawdown using Brownian Motion Assumptions}
+\name{EmaxDDGBM}
+\alias{EmaxDDGBM}
+\title{Summary of Expected Drawdown using Brownian Motion Assumptions and Return-Volatility}
 \usage{
-  EMaxDDGBM(R, digits = 4)
+  EmaxDDGBM(R, digits = 4)
 }
 \arguments{
   \item{R}{an xts, vector, matrix, data frame, timeSeries
@@ -11,15 +11,47 @@
   \item{digits}{significant number}
 }
 \description{
-  Works on the model specified by Maddon-Ismail
+  Works on the model specified by Maddon-Ismail which
+  investigates the behavior of this statistic for a
+  Brownian motion with drift.
 }
+\details{
+  If X(t) is a random process on [0, T ], the maximum
+  drawdown at time T , D(T), is defined by where \deqn{D(T)
+  = sup [X(s) - X(t)]} where s belongs to [0,t] and s
+  belongs to [0,T] Informally, this is the largest drop
+  from a peak to a bottom. In this paper, we investigate
+  the behavior of this statistic for a Brownian motion with
+  drift. In particular, we give an infinite series
+  representation of its distribution, and consider its
+  expected value. When the drift is zero, we give an
+  analytic expression for the expected value, and for
+  non-zero drift, we give an infinite series
+  representation. For all cases, we compute the limiting
+  \bold{(\eqn{T tends to \infty})} behavior, which can be
+  logarithmic (\eqn{\mu} > 0), square root (\eqn{\mu} = 0),
+  or linear (\eqn{\mu} < 0).
+}
+\examples{
+library(PerformanceAnalytics)
+data(edhec)
+EmaxDDGBM(edhec)
+}
 \author{
-  Shubhankit
+  Shubhankit Mohan
 }
+\references{
+  Magdon-Ismail, M., Atiya, A., Pratap, A., and Yaser S.
+  Abu-Mostafa: On the Maximum Drawdown of a Browninan
+  Motion, Journal of Applied Probability 41, pp. 147-161,
+  2004
+  \url{http://alumnus.caltech.edu/~amir/drawdown-jrnl.pdf}
+}
 \keyword{Assumptions}
 \keyword{Brownian}
 \keyword{Drawdown}
 \keyword{Expected}
+\keyword{models}
 \keyword{Motion}
 \keyword{Using}
 

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.EMaxDDGBM.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.EMaxDDGBM.Rd	2013-09-10 23:24:02 UTC (rev 3050)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.EMaxDDGBM.Rd	2013-09-10 23:57:44 UTC (rev 3051)
@@ -1,57 +1,57 @@
-\name{table.EMaxDDGBM}
-\alias{table.EMaxDDGBM}
-\title{Expected Drawdown using Brownian Motion Assumptions}
-\usage{
-  table.EMaxDDGBM(R, digits = 4)
-}
-\arguments{
-  \item{R}{an xts, vector, matrix, data frame, timeSeries
-  or zoo object of asset returns}
-
-  \item{digits}{significant number}
-}
-\description{
-  Works on the model specified by Maddon-Ismail which
-  investigates the behavior of this statistic for a
-  Brownian motion with drift.
-}
-\details{
-  If X(t) is a random process on [0, T ], the maximum
-  drawdown at time T , D(T), is defined by where \deqn{D(T)
-  = sup [X(s) - X(t)]} where s belongs to [0,t] and s
-  belongs to [0,T] Informally, this is the largest drop
-  from a peak to a bottom. In this paper, we investigate
-  the behavior of this statistic for a Brownian motion with
-  drift. In particular, we give an infinite series
-  representation of its distribution, and consider its
-  expected value. When the drift is zero, we give an
-  analytic expression for the expected value, and for
-  non-zero drift, we give an infinite series
-  representation. For all cases, we compute the limiting
-  \bold{(\eqn{T tends to \infty})} behavior, which can be
-  logarithmic (\eqn{\mu} > 0), square root (\eqn{\mu} = 0),
-  or linear (\eqn{\mu} < 0).
-}
-\examples{
-library(PerformanceAnalytics)
-data(edhec)
-table.EMaxDDGBM(edhec)
-}
-\author{
-  Shubhankit Mohan
-}
-\references{
-  Magdon-Ismail, M., Atiya, A., Pratap, A., and Yaser S.
-  Abu-Mostafa: On the Maximum Drawdown of a Browninan
-  Motion, Journal of Applied Probability 41, pp. 147-161,
-  2004
-  \url{http://alumnus.caltech.edu/~amir/drawdown-jrnl.pdf}
-}
-\keyword{Assumptions}
-\keyword{Brownian}
-\keyword{Drawdown}
-\keyword{Expected}
-\keyword{models}
-\keyword{Motion}
-\keyword{Using}
-
+\name{table.EMaxDDGBM}
+\alias{table.EMaxDDGBM}
+\title{Summary of Expected Drawdown using Brownian Motion Assumptions and Return-Volatility}
+\usage{
+  table.EMaxDDGBM(R, digits = 4)
+}
+\arguments{
+  \item{R}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of asset returns}
+
+  \item{digits}{significant number}
+}
+\description{
+  Works on the model specified by Maddon-Ismail which
+  investigates the behavior of this statistic for a
+  Brownian motion with drift.
+}
+\details{
+  If X(t) is a random process on [0, T ], the maximum
+  drawdown at time T , D(T), is defined by where \deqn{D(T)
+  = sup [X(s) - X(t)]} where s belongs to [0,t] and s
+  belongs to [0,T] Informally, this is the largest drop
+  from a peak to a bottom. In this paper, we investigate
+  the behavior of this statistic for a Brownian motion with
+  drift. In particular, we give an infinite series
+  representation of its distribution, and consider its
+  expected value. When the drift is zero, we give an
+  analytic expression for the expected value, and for
+  non-zero drift, we give an infinite series
+  representation. For all cases, we compute the limiting
+  \bold{(\eqn{T tends to \infty})} behavior, which can be
+  logarithmic (\eqn{\mu} > 0), square root (\eqn{\mu} = 0),
+  or linear (\eqn{\mu} < 0).
+}
+\examples{
+library(PerformanceAnalytics)
+data(edhec)
+table.EMaxDDGBM(edhec)
+}
+\author{
+  Shubhankit Mohan
+}
+\references{
+  Magdon-Ismail, M., Atiya, A., Pratap, A., and Yaser S.
+  Abu-Mostafa: On the Maximum Drawdown of a Browninan
+  Motion, Journal of Applied Probability 41, pp. 147-161,
+  2004
+  \url{http://alumnus.caltech.edu/~amir/drawdown-jrnl.pdf}
+}
+\keyword{Assumptions}
+\keyword{Brownian}
+\keyword{Drawdown}
+\keyword{Expected}
+\keyword{models}
+\keyword{Motion}
+\keyword{Using}
+



More information about the Returnanalytics-commits mailing list