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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 7 16:58:14 CEST 2013


Author: shubhanm
Date: 2013-09-07 16:58:14 +0200 (Sat, 07 Sep 2013)
New Revision: 3020

Added:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd
Modified:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.pdf
Log:
3 Sharpe Ratio function : correction of bugs, addition of examples in documentation using managers data to Clean R CMD Build 

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION	2013-09-07 13:42:33 UTC (rev 3019)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION	2013-09-07 14:58:14 UTC (rev 3020)
@@ -33,3 +33,6 @@
     'table.EMaxDDGBM.R'
     'table.UnsmoothReturn.R'
     'UnsmoothReturn.R'
+    'LoSharpe.R'
+    'se.LoSharpe.R'
+    'table.Sharpe.R'

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE	2013-09-07 13:42:33 UTC (rev 3019)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE	2013-09-07 14:58:14 UTC (rev 3020)
@@ -5,11 +5,14 @@
 export(chart.Autocorrelation)
 export(EMaxDDGBM)
 export(GLMSmoothIndex)
+export(LoSharpe)
 export(QP.Norm)
 export(Return.GLM)
 export(Return.Okunev)
+export(se.LoSharpe)
 export(SterlingRatio.Norm)
 export(table.ComparitiveReturn.GLM)
 export(table.EMaxDDGBM)
+export(table.Sharpe)
 export(table.UnsmoothReturn)
 export(UnsmoothReturn)

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R	2013-09-07 14:58:14 UTC (rev 3020)
@@ -0,0 +1,101 @@
+#'@title Andrew Lo Sharpe Ratio
+#'@description
+#' Although the Sharpe ratio has become part of the canon of modern financial 
+#' analysis, its applications typically do not account for the fact that it is an
+#' estimated quantity, subject to estimation errors that can be substantial in 
+#' some cases.
+#' 
+#' Many studies have documented various violations of the assumption of 
+#' IID returns for financial securities.
+#' 
+#' Under the assumption of stationarity,a version of the Central Limit Theorem can 
+#' still be  applied to the estimator .
+#' @details
+#' The relationship between SR and SR(q) is somewhat more involved for non-
+#'IID returns because the variance of Rt(q) is not just the sum of the variances of component returns but also includes all the covariances. Specifically, under
+#' the assumption that returns \eqn{R_t}  are stationary,
+#' \deqn{ Var[(R_t)] =   \sum \sum Cov(R(t-i),R(t-j)) = q{\sigma^2} + 2{\sigma^2} \sum (q-k)\rho(k) }
+#' Where  \eqn{ \rho(k) = Cov(R(t),R(t-k))/Var[(R_t)]} is the \eqn{k^{th}} order autocorrelation coefficient of the series of returns.This yields the following relationship between SR and SR(q):
+#' and i,j belongs to 0 to q-1
+#'\deqn{SR(q)  =  \eta(q) }
+#'Where :
+#' \deqn{ }{\eta(q) = [q]/[\sqrt(q\sigma^2) + 2\sigma^2 \sum(q-k)\rho(k)] }
+#' Where, k belongs to 0 to q-1
+#' SR(q) :  Estimated Lo Sharpe Ratio
+#' SR : Theoretical William Sharpe Ratio
+#' @param Ra an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' daily asset returns
+#' @param Rf an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' annualized Risk Free Rate
+#' @param q Number of autocorrelated lag periods. Taken as 3 (Default)
+#' @param \dots any other pass thru parameters
+#' @author Shubhankit Mohan
+#' @references Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002, AIMR.
+#' \url{http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260}
+#' 
+#' Andrew Lo,\emph{Sharpe Ratio may be Overstated}
+#'  \url{http://www.risk.net/risk-magazine/feature/1506463/lo-sharpe-ratios-overstated}
+#' @keywords ts multivariate distribution models non-iid 
+#' @examples
+#' data(managers)
+#' LoSharpe(managers,0,3)
+#' @rdname LoSharpe
+#' @export
+LoSharpe <-
+  function (Ra,Rf = 0,q = 3, ...)
+  { # @author Brian G. Peterson, Peter Carl
+    
+    
+    # Function:
+    R = checkData(Ra, method="xts")
+    # Get dimensions and labels
+    columns.a = ncol(R)
+    columnnames.a = colnames(R)
+    # Time used for daily Return manipulations
+    Time= 252*nyears(R)
+    clean.lo <- function(column.R,q) {
+      # compute the lagged return series
+      gamma.k =matrix(0,q)
+      mu = sum(column.R)/(Time)
+      Rf= Rf/(Time)
+      for(i in 1:q){
+        lagR = lag(column.R, k=i)
+        # compute the Momentum Lagged Values
+        gamma.k[i]= (sum(((column.R-mu)*(lagR-mu)),na.rm=TRUE))
+      }
+      return(gamma.k)
+    }
+    neta.lo <- function(pho.k,q) {
+      # compute the lagged return series
+      sumq = 0
+      for(j in 1:q){
+        sumq = sumq+ (q-j)*pho.k[j]
+      }
+      return(q/(sqrt(q+2*sumq)))
+    }
+    column.lo=NULL
+    lo=NULL
+    for(column.a in 1:columns.a) { # for each asset passed in as R
+      # clean the data and get rid of NAs
+      clean.ret=na.omit(R[,column.a])
+      mu = sum(clean.ret)/(Time)
+      sig=sqrt(((clean.ret-mu)^2/(Time)))
+      pho.k = na.omit(clean.lo(clean.ret,q))/(as.numeric(sig[1]))
+      netaq=neta.lo(pho.k,q)
+      #column.lo = (netaq*((mu-Rf)/as.numeric(sig[1])))
+      column.lo = as.numeric(SharpeRatio.annualized(R[,column.a]))[1]*netaq
+  #    if(column.a == 1)  { lo = column.lo }
+   #   else { lo = cbind (lo, column.lo) 
+  #          colnames(lo) = columnnames.a
+    #  }
+      
+     lo=cbind(lo,column.lo) 
+    }
+   colnames(lo) = columnnames.a 
+    rownames(lo)= paste("Lo Sharpe Ratio")
+    return(lo)
+    
+    
+    # RESULTS:
+    
+  }

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R	2013-09-07 14:58:14 UTC (rev 3020)
@@ -0,0 +1,104 @@
+#'@title Andrew Lo Sharpe Ratio Statistics
+#'@description
+#' Although the Sharpe ratio has become part of the canon of modern financial 
+#' analysis, its applications typically do not account for the fact that it is an
+#' estimated quantity, subject to estimation errors which can be substantial in 
+#' some cases.
+#' 
+#' Many studies have documented various violations of the assumption of 
+#' IID returns for financial securities.
+#' 
+#' Under the assumption of stationarity,a version of the Central Limit Theorem can 
+#' still be  applied to the estimator .
+#' @details
+#' The relationship between SR and SR(q) is somewhat more involved for non-
+#'IID returns because the variance of Rt(q) is not just the sum of the variances of component returns but also includes all the covariances. Specifically, under
+#' the assumption that returns \eqn{R_t}  are stationary,
+#' \deqn{ Var[(R_t)] =   \sum \sum Cov(R(t-i),R(t-j)) = q{\sigma^2} + 2{\sigma^2} \sum (q-k)\rho(k) }
+#' Where  \eqn{ \rho(k) = Cov(R(t),R(t-k))/Var[(R_t)]} is the \eqn{k^{th}} order autocorrelation coefficient of the series of returns.This yields the following relationship between SR and SR(q):
+#' and i,j belongs to 0 to q-1
+#'\deqn{SR(q)  =  \eta(q) }
+#'Where :
+#' \deqn{ }{\eta(q) = [q]/[\sqrt(q\sigma^2) + 2\sigma^2 \sum(q-k)\rho(k)] }
+#' Where k belongs to 0 to q-1
+#' Under the assumption of assumption of asymptotic variance of SR(q), the standard error for the Sharpe Ratio Esitmator can be computed as:
+#' \deqn{SE(SR(q)) = \sqrt((1+SR^2/2)/T)}
+#' SR(q) :  Estimated Lo Sharpe Ratio
+#' SR : Theoretical William Sharpe Ratio
+#' @param Ra an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' daily asset returns
+#' @param Rf an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' annualized Risk Free Rate
+#' @param q Number of autocorrelated lag periods. Taken as 3 (Default)
+#' @param \dots any other pass thru parameters
+#' @author Shubhankit Mohan
+#' @references Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002, AIMR.
+#' \url{http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260}
+#' 
+#' Andrew Lo,\emph{Sharpe Ratio may be Overstated} 
+#' \url{http://www.risk.net/risk-magazine/feature/1506463/lo-sharpe-ratios-overstated}
+#' @keywords ts multivariate distribution models non-iid 
+#' @examples
+#' 
+#' data(managers)
+#' se.LoSharpe(managers,0,3)
+#' @rdname se.LoSharpe
+#' @export
+se.LoSharpe <-
+  function (Ra,Rf = 0,q = 3, ...)
+  { # @author Brian G. Peterson, Peter Carl
+    
+    
+    # Function:
+    R = checkData(Ra, method="xts")
+    # Get dimensions and labels
+    columns.a = ncol(R)
+    columnnames.a = colnames(R)
+    # Time used for daily Return manipulations
+    Time= 252*nyears(R)
+    clean.lo <- function(column.R,q) {
+      # compute the lagged return series
+      gamma.k =matrix(0,q)
+      mu = sum(column.R)/(Time)
+      Rf= Rf/(Time)
+      for(i in 1:q){
+        lagR = lag(column.R, k=i)
+        # compute the Momentum Lagged Values
+        gamma.k[i]= (sum(((column.R-mu)*(lagR-mu)),na.rm=TRUE))
+      }
+      return(gamma.k)
+    }
+    neta.lo <- function(pho.k,q) {
+      # compute the lagged return series
+      sumq = 0
+      for(j in 1:q){
+        sumq = sumq+ (q-j)*pho.k[j]
+      }
+      return(q/(sqrt(q+2*sumq)))
+    }
+    column.lo=NULL
+    lo=NULL
+    
+    for(column.a in 1:columns.a) { # for each asset passed in as R
+      # clean the data and get rid of NAs
+      mu = sum(R[,column.a])/(Time)
+      sig=sqrt(((R[,column.a]-mu)^2/(Time)))
+      pho.k = clean.lo(R[,column.a],q)/(as.numeric(sig[1]))
+      netaq=neta.lo(pho.k,q)
+      column.lo = (netaq*((mu-Rf)/as.numeric(sig[1])))
+      column.lo= 1.96*sqrt((1+(column.lo*column.lo/2))/(Time))
+      lo=cbind(lo,column.lo) 
+    }
+    
+    colnames(lo) = columnnames.a
+    rownames(lo)= paste("Standard Error of Sharpe Ratio Estimates(95% Confidence)")
+    return(lo)
+   
+#colnames(lo) = columnnames.a 
+#rownames(lo)= paste("Lo Sharpe Ratio")
+#return(lo)
+
+    
+    # RESULTS:
+    
+  }

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R	2013-09-07 14:58:14 UTC (rev 3020)
@@ -0,0 +1,96 @@
+#'@title Sharpe Ratio Statistics Summary 
+#'@description
+#' The Sharpe ratio is simply the return per unit of risk (represented by
+#' variability).  In the classic case, the unit of risk is the standard
+#' deviation of the returns.
+#' 
+#' \deqn{\frac{\overline{(R_{a}-R_{f})}}{\sqrt{\sigma_{(R_{a}-R_{f})}}}}
+#' 
+#' William Sharpe now recommends \code{\link{InformationRatio}} preferentially
+#' to the original Sharpe Ratio.
+#' 
+#' The higher the Sharpe ratio, the better the combined performance of "risk"
+#' and return.
+#' 
+#' As noted, the traditional Sharpe Ratio is a risk-adjusted measure of return
+#' that uses standard deviation to represent risk.
+
+#' Although the Sharpe ratio has become part of the canon of modern financial 
+#' analysis, its applications typically do not account for the fact that it is an
+#' estimated quantity, subject to estimation errors that can be substantial in 
+#' some cases.
+#' 
+#' Many studies have documented various violations of the assumption of 
+#' IID returns for financial securities.
+#' 
+#' Under the assumption of stationarity,a version of the Central Limit Theorem can 
+#' still be  applied to the estimator .
+#' @details
+#' The relationship between SR and SR(q) is somewhat more involved for non-
+#'IID returns because the variance of Rt(q) is not just the sum of the variances of component returns but also includes all the covariances. Specifically, under
+#' the assumption that returns \eqn{R_t}  are stationary,
+#' \deqn{ Var[(R_t)] =   \sum \sum Cov(R(t-i),R(t-j)) = q{\sigma^2} + 2{\sigma^2} \sum (q-k)\rho(k) }
+#' Where  \eqn{ \rho(k) = Cov(R(t),R(t-k))/Var[(R_t)]} is the \eqn{k^{th}} order autocorrelation coefficient of the series of returns.This yields the following relationship between SR and SR(q):
+#' and i,j belongs to 0 to q-1
+#'\deqn{SR(q)  =  \eta(q) }
+#'Where :
+#' \deqn{ }{\eta(q) = [q]/[\sqrt(q\sigma^2) + 2\sigma^2 \sum(q-k)\rho(k)] }
+#' Where, k belongs to 0 to q-1
+#' SR(q) :  Estimated Lo Sharpe Ratio
+#' SR : Theoretical William Sharpe Ratio
+#' @param Ra an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' daily asset returns
+#' @param Rf an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' annualized Risk Free Rate
+#' @param q Number of autocorrelated lag periods. Taken as 3 (Default)
+#' @param digits Round off Numerical Value
+#' @param \dots any other pass thru parameters
+#' @author Shubhankit Mohan
+#' @references Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002, AIMR.
+#' \url{http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260}
+#' 
+#' Andrew Lo,\emph{Sharpe Ratio may be Overstated}
+#'  \url{http://www.risk.net/risk-magazine/feature/1506463/lo-sharpe-ratios-overstated}
+#' @keywords ts multivariate distribution models non-iid 
+#' @examples
+#' 
+#' data(managers)
+#' table.Sharpe(managers,0,3)
+#' @rdname table.Sharpe
+#' @export
+table.Sharpe <-
+  function (Ra,Rf = 0,q = 3,digits=4, ...)
+  { y = checkData(Ra, method = "xts")
+    columns = ncol(y)
+    rows = nrow(y)
+    columnnames = colnames(y)
+    rownames = rownames(y)
+    
+    # for each column, do the following:
+    for(column in 1:columns) {
+      x = y[,column]
+      
+      z = c(as.numeric(SharpeRatio.annualized(x)),
+            as.numeric(LoSharpe(x)),
+            as.numeric(Return.annualized(x)),as.numeric(StdDev.annualized(x)),as.numeric(se.LoSharpe(x)))
+            
+      znames = c(
+        "William Sharpe Ratio",
+        "Andrew Lo Sharpe Ratio",
+        "Annualized Return",
+        "Annualized Standard Deviation","Sharpe Ratio Standard Error(95%)"        
+      )
+      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
+    
+    
+  }

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd	2013-09-07 14:58:14 UTC (rev 3020)
@@ -0,0 +1,71 @@
+\name{LoSharpe}
+\alias{LoSharpe}
+\title{Andrew Lo Sharpe Ratio}
+\usage{
+  LoSharpe(Ra, Rf = 0, q = 3, ...)
+}
+\arguments{
+  \item{Ra}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of daily asset returns}
+
+  \item{Rf}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of annualized Risk Free Rate}
+
+  \item{q}{Number of autocorrelated lag periods. Taken as 3
+  (Default)}
+
+  \item{\dots}{any other pass thru parameters}
+}
+\description{
+  Although the Sharpe ratio has become part of the canon of
+  modern financial analysis, its applications typically do
+  not account for the fact that it is an estimated
+  quantity, subject to estimation errors that can be
+  substantial in some cases.
+
+  Many studies have documented various violations of the
+  assumption of IID returns for financial securities.
+
+  Under the assumption of stationarity,a version of the
+  Central Limit Theorem can still be applied to the
+  estimator .
+}
+\details{
+  The relationship between SR and SR(q) is somewhat more
+  involved for non- IID returns because the variance of
+  Rt(q) is not just the sum of the variances of component
+  returns but also includes all the covariances.
+  Specifically, under the assumption that returns \eqn{R_t}
+  are stationary, \deqn{ Var[(R_t)] = \sum \sum
+  Cov(R(t-i),R(t-j)) = q{\sigma^2} + 2{\sigma^2} \sum
+  (q-k)\rho(k) } Where \eqn{ \rho(k) =
+  Cov(R(t),R(t-k))/Var[(R_t)]} is the \eqn{k^{th}} order
+  autocorrelation coefficient of the series of returns.This
+  yields the following relationship between SR and SR(q):
+  and i,j belongs to 0 to q-1 \deqn{SR(q) = \eta(q) } Where
+  : \deqn{ }{\eta(q) = [q]/[\sqrt(q\sigma^2) + 2\sigma^2
+  \sum(q-k)\rho(k)] } Where, k belongs to 0 to q-1 SR(q) :
+  Estimated Lo Sharpe Ratio SR : Theoretical William Sharpe
+  Ratio
+}
+\examples{
+data(managers)
+LoSharpe(managers,0,3)
+}
+\author{
+  Shubhankit Mohan
+}
+\references{
+  Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002,
+  AIMR.
+  \url{http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260}
+
+  Andrew Lo,\emph{Sharpe Ratio may be Overstated}
+  \url{http://www.risk.net/risk-magazine/feature/1506463/lo-sharpe-ratios-overstated}
+}
+\keyword{distribution}
+\keyword{models}
+\keyword{multivariate}
+\keyword{non-iid}
+\keyword{ts}
+

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd	2013-09-07 14:58:14 UTC (rev 3020)
@@ -0,0 +1,74 @@
+\name{se.LoSharpe}
+\alias{se.LoSharpe}
+\title{Andrew Lo Sharpe Ratio Statistics}
+\usage{
+  se.LoSharpe(Ra, Rf = 0, q = 3, ...)
+}
+\arguments{
+  \item{Ra}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of daily asset returns}
+
+  \item{Rf}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of annualized Risk Free Rate}
+
+  \item{q}{Number of autocorrelated lag periods. Taken as 3
+  (Default)}
+
+  \item{\dots}{any other pass thru parameters}
+}
+\description{
+  Although the Sharpe ratio has become part of the canon of
+  modern financial analysis, its applications typically do
+  not account for the fact that it is an estimated
+  quantity, subject to estimation errors which can be
+  substantial in some cases.
+
+  Many studies have documented various violations of the
+  assumption of IID returns for financial securities.
+
+  Under the assumption of stationarity,a version of the
+  Central Limit Theorem can still be applied to the
+  estimator .
+}
+\details{
+  The relationship between SR and SR(q) is somewhat more
+  involved for non- IID returns because the variance of
+  Rt(q) is not just the sum of the variances of component
+  returns but also includes all the covariances.
+  Specifically, under the assumption that returns \eqn{R_t}
+  are stationary, \deqn{ Var[(R_t)] = \sum \sum
+  Cov(R(t-i),R(t-j)) = q{\sigma^2} + 2{\sigma^2} \sum
+  (q-k)\rho(k) } Where \eqn{ \rho(k) =
+  Cov(R(t),R(t-k))/Var[(R_t)]} is the \eqn{k^{th}} order
+  autocorrelation coefficient of the series of returns.This
+  yields the following relationship between SR and SR(q):
+  and i,j belongs to 0 to q-1 \deqn{SR(q) = \eta(q) } Where
+  : \deqn{ }{\eta(q) = [q]/[\sqrt(q\sigma^2) + 2\sigma^2
+  \sum(q-k)\rho(k)] } Where k belongs to 0 to q-1 Under the
+  assumption of assumption of asymptotic variance of SR(q),
+  the standard error for the Sharpe Ratio Esitmator can be
+  computed as: \deqn{SE(SR(q)) = \sqrt((1+SR^2/2)/T)} SR(q)
+  : Estimated Lo Sharpe Ratio SR : Theoretical William
+  Sharpe Ratio
+}
+\examples{
+data(managers)
+se.LoSharpe(managers,0,3)
+}
+\author{
+  Shubhankit Mohan
+}
+\references{
+  Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002,
+  AIMR.
+  \url{http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260}
+
+  Andrew Lo,\emph{Sharpe Ratio may be Overstated}
+  \url{http://www.risk.net/risk-magazine/feature/1506463/lo-sharpe-ratios-overstated}
+}
+\keyword{distribution}
+\keyword{models}
+\keyword{multivariate}
+\keyword{non-iid}
+\keyword{ts}
+

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd	2013-09-07 14:58:14 UTC (rev 3020)
@@ -0,0 +1,88 @@
+\name{table.Sharpe}
+\alias{table.Sharpe}
+\title{Sharpe Ratio Statistics Summary}
+\usage{
+  table.Sharpe(Ra, Rf = 0, q = 3, digits = 4, ...)
+}
+\arguments{
+  \item{Ra}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of daily asset returns}
+
+  \item{Rf}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of annualized Risk Free Rate}
+
+  \item{q}{Number of autocorrelated lag periods. Taken as 3
+  (Default)}
+
+  \item{digits}{Round off Numerical Value}
+
+  \item{\dots}{any other pass thru parameters}
+}
+\description{
+  The Sharpe ratio is simply the return per unit of risk
+  (represented by variability).  In the classic case, the
+  unit of risk is the standard deviation of the returns.
+
+  \deqn{\frac{\overline{(R_{a}-R_{f})}}{\sqrt{\sigma_{(R_{a}-R_{f})}}}}
+
+  William Sharpe now recommends
+  \code{\link{InformationRatio}} preferentially to the
+  original Sharpe Ratio.
+
+  The higher the Sharpe ratio, the better the combined
+  performance of "risk" and return.
+
+  As noted, the traditional Sharpe Ratio is a risk-adjusted
+  measure of return that uses standard deviation to
+  represent risk. Although the Sharpe ratio has become part
+  of the canon of modern financial analysis, its
+  applications typically do not account for the fact that
+  it is an estimated quantity, subject to estimation errors
+  that can be substantial in some cases.
+
+  Many studies have documented various violations of the
+  assumption of IID returns for financial securities.
+
+  Under the assumption of stationarity,a version of the
+  Central Limit Theorem can still be applied to the
+  estimator .
+}
+\details{
+  The relationship between SR and SR(q) is somewhat more
+  involved for non- IID returns because the variance of
+  Rt(q) is not just the sum of the variances of component
+  returns but also includes all the covariances.
+  Specifically, under the assumption that returns \eqn{R_t}
+  are stationary, \deqn{ Var[(R_t)] = \sum \sum
+  Cov(R(t-i),R(t-j)) = q{\sigma^2} + 2{\sigma^2} \sum
+  (q-k)\rho(k) } Where \eqn{ \rho(k) =
+  Cov(R(t),R(t-k))/Var[(R_t)]} is the \eqn{k^{th}} order
+  autocorrelation coefficient of the series of returns.This
+  yields the following relationship between SR and SR(q):
+  and i,j belongs to 0 to q-1 \deqn{SR(q) = \eta(q) } Where
+  : \deqn{ }{\eta(q) = [q]/[\sqrt(q\sigma^2) + 2\sigma^2
+  \sum(q-k)\rho(k)] } Where, k belongs to 0 to q-1 SR(q) :
+  Estimated Lo Sharpe Ratio SR : Theoretical William Sharpe
+  Ratio
+}
+\examples{
+data(managers)
+table.Sharpe(managers,0,3)
+}
+\author{
+  Shubhankit Mohan
+}
+\references{
+  Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002,
+  AIMR.
+  \url{http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260}
+
+  Andrew Lo,\emph{Sharpe Ratio may be Overstated}
+  \url{http://www.risk.net/risk-magazine/feature/1506463/lo-sharpe-ratios-overstated}
+}
+\keyword{distribution}
+\keyword{models}
+\keyword{multivariate}
+\keyword{non-iid}
+\keyword{ts}
+

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.pdf
===================================================================
(Binary files differ)



More information about the Returnanalytics-commits mailing list