[Returnanalytics-commits] r3016 - 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 13:19:40 CEST 2013


Author: shubhanm
Date: 2013-09-07 13:19:40 +0200 (Sat, 07 Sep 2013)
New Revision: 3016

Added:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ShaneAcarMaxLoss.synctex.gz
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ShaneAcarMaxLoss.tex
Removed:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/AcarSim.R
   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/AcarSim.Rd
   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
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/CommodityReport.Rnw
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.Rnw
Modified:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ShaneAcarMaxLoss.Rnw
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ShaneAcarMaxLoss.pdf
Log:
Temp Clean version of R CMD Build Checking...removing bugs in deleted functions

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/DESCRIPTION	2013-09-07 11:19:40 UTC (rev 3016)
@@ -16,7 +16,6 @@
 License: GPL-3
 ByteCompile: TRUE
 Collate:
-    'AcarSim.R'
     'ACStdDev.annualized.R'
     'CalmarRatio.Norm.R'
     'CDrawdown.R'
@@ -24,16 +23,13 @@
     'chart.Autocorrelation.R'
     'EmaxDDGBM.R'
     'GLMSmoothIndex.R'
-    'LoSharpe.R'
     'na.skip.R'
     'noniid.sm-internal.R'
     'QP.Norm.R'
     'Return.GLM.R'
     'Return.Okunev.R'
-    'se.LoSharpe.R'
     'SterlingRatio.Norm.R'
     'table.ComparitiveReturn.GLM.R'
     'table.EMaxDDGBM.R'
     'table.UnsmoothReturn.R'
     'UnsmoothReturn.R'
-    'table.Sharpe.R'

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/NAMESPACE	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,4 +1,3 @@
-export(AcarSim)
 export(ACStdDev.annualized)
 export(CalmarRatio.Norm)
 export(CDrawdown)
@@ -6,13 +5,10 @@
 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)

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/AcarSim.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/AcarSim.R	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/AcarSim.R	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,103 +0,0 @@
-#' @title Acar-Shane Maximum Loss Plot 
-#' 
-#'@description To get some insight on the relationships between maximum drawdown per unit of volatility 
-#'and mean return divided by volatility, we have proceeded to Monte-Carlo simulations.
-#' We have simulated cash flows over a period of 36 monthly returns and measured maximum 
-#'drawdown for varied levels of annualised return divided by volatility varying from minus
-#' \emph{two to two} by step of \emph{0.1} . The process has been repeated \bold{six thousand times}.
-#' @details  Unfortunately, there is no \bold{analytical formulae} to establish the maximum drawdown properties under 
-#' the random walk assumption. We should note first that due to its definition, the maximum drawdown 
-#' divided by volatility can be interpreted as the only function of the ratio mean divided by volatility.
-#' \deqn{MD/[\sigma]= Min (\sum[X(j)])/\sigma = F(\mu/\sigma)}
-#' Where j varies from 1 to n ,which is the number of drawdown's in simulation 
-#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of
-#' asset returns
-#' @param nsim number of simulations input
-#' @author Shubhankit Mohan
-#' @references Maximum Loss and Maximum Drawdown in Financial Markets,\emph{International Conference Sponsored by BNP and Imperial College on: 
-#' Forecasting Financial Markets, London, United Kingdom, May 1997} \url{http://www.intelligenthedgefundinvesting.com/pubs/easj.pdf}
-#' @keywords Maximum Loss Simulated Drawdown
-#' @examples
-#' library(PerformanceAnalytics)
-#' AcarSim(R)
-#' @rdname AcarSim
-#' @export 
-AcarSim <-
-  function(R,nsim=1)
-  {
-       library(PerformanceAnalytics)
-
-    data(edhec)
-    
-    R = checkData(R, method="xts")
-    # Get dimensions and labels
-    # simulated parameters using edhec data
-mu=mean(Return.annualized(R))
-monthly=(1+mu)^(1/12)-1
-    vol = as.numeric(StdDev.annualized(R));
-    ret=as.numeric(Return.annualized(R))
-    drawdown =as.numeric(maxDrawdown(R))
-    sig=mean(StdDev.annualized(R));
-T= 36
-j=1
-dt=1/T
-thres=4;
-r=matrix(0,nsim,T+1)
-monthly = 0
-r[,1]=monthly;
-# Sigma 'monthly volatiltiy' will be the varying term
-ratio= seq(-2, 2, by=.1);
-len = length(ratio)
-ddown=array(0, dim=c(nsim,len,thres))
-fddown=array(0, dim=c(len,thres))
-Z <- array(0, c(len))
-for(i in 1:len)
-{
-  monthly = sig*ratio[i];
-
-  for(j in 1:nsim)
-{
-    dz=rnorm(T)
-    
-    
-      r[j,2:37]=monthly+(sig*dz*sqrt(3*dt))
-    
-    ddown[j,i,1]= ES((r[j,]),.99, method="modified")
-    ddown[j,i,1][is.na(ddown[j,i,1])] <- 0
-    fddown[i,1]=fddown[i,1]+ddown[j,i,1]
-    ddown[j,i,2]= ES((r[j,]),.95, method="modified")
-    ddown[j,i,2][is.na(ddown[j,i,2])] <- 0
-    fddown[i,2]=fddown[i,2]+ddown[j,i,2]
-    ddown[j,i,3]= ES((r[j,]),.90, method="modified")
-    ddown[j,i,3][is.na(ddown[j,i,3])] <- 0
-    fddown[i,3]=fddown[i,3]+ddown[j,i,3]
-    ddown[j,i,4]= ES((r[j,]),.85, method="modified")
-    ddown[j,i,4][is.na(ddown[j,i,4])] <- 0
-    fddown[i,4]=fddown[i,4]+ddown[j,i,4]
-    assign("last.warning", NULL, envir = baseenv())
-}
-}
-plot(((fddown[,1])/(sig*nsim)),xlab="Annualised Return/Volatility from [-2,2]",ylab="Maximum Drawdown/Volatility",type='o',col="blue")
-lines(((fddown[,2])/(sig*nsim)),type='o',col="pink")
-lines(((fddown[,3])/(sig*nsim)),type='o',col="green")
-lines(((fddown[,4])/(sig*nsim)),type='o',col="red")
-    points((ret/vol), (-drawdown/vol), col = "black", pch=10)
-    legend(32,-4, c("%99", "%95", "%90","%85","Fund"), col = c("blue","pink","green","red","black"), text.col= "black",
-       lty = c(2, -1, 1,2), pch = c(-1, 3, 4,10), merge = TRUE, bg='gray90')
-    
-title("Maximum Drawdown/Volatility as a function of Return/Volatility 
-36 monthly returns simulated 6,000 times") 
-       edhec=NULL
-}
-
-###############################################################################
-# R (http://r-project.org/) Econometrics for Performance and Risk Analysis
-#
-# Copyright (c) 2004-2012 Peter Carl and Brian G. Peterson
-#
-# This R package is distributed under the terms of the GNU Public License (GPL)
-# for full details see the file COPYING
-#
-# $Id: AcarSim.R 2163 2012-07-16 00:30:19Z braverock $
-#
-###############################################################################
\ No newline at end of file

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,98 +0,0 @@
-#'@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.
-#'\code{\link[stats]{}} \cr
-#' \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(edhec)
-#' LoSharpe(edhec,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(edhec)
-    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)))
-    }
-    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 = 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
-    rownames(lo)= paste("Lo Sharpe Ratio")
-    return(lo)
-    
-    
-    # RESULTS:
-    
-  }

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/se.LoSharpe.R	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,99 +0,0 @@
-#'@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.
-#'\code{\link[stats]{}} \cr
-#' \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(edhec)
-#' se.LoSharpe(edhec,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(edhec)
-    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)))
-    }
-    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))
-      if(column.a == 1)  { lo = column.lo }
-      else { lo = cbind (lo, column.lo) }
-      
-    }
-    colnames(lo) = columnnames.a
-    rownames(lo)= paste("Standard Error of Sharpe Ratio Estimates(95% Confidence)")
-    return(lo)
-    
-    
-    # RESULTS:
-    
-  }

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/table.Sharpe.R	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,96 +0,0 @@
-#'@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 \dots any other pass thru parameters
-#' @author Shubhankit Mohan
-#' @references Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002, AIMR.
-#'\code{\link[stats]{}} \cr
-#' \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(edhec)
-#' table.Sharpe(edhec,0,3)
-#' @rdname table.Sharpe
-#' @export
-table.Sharpe <-
-  function (Ra,Rf = 0,q = 3, ...)
-  { 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
-    
-    
-  }

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/AcarSim.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/AcarSim.Rd	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/AcarSim.Rd	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,52 +0,0 @@
-\name{AcarSim}
-\alias{AcarSim}
-\title{Acar-Shane Maximum Loss Plot}
-\usage{
-  AcarSim(R, nsim = 1)
-}
-\arguments{
-  \item{R}{an xts, vector, matrix, data frame, timeSeries
-  or zoo object of asset returns}
-
-  \item{nsim}{number of simulations input}
-}
-\description{
-  To get some insight on the relationships between maximum
-  drawdown per unit of volatility and mean return divided
-  by volatility, we have proceeded to Monte-Carlo
-  simulations. We have simulated cash flows over a period
-  of 36 monthly returns and measured maximum drawdown for
-  varied levels of annualised return divided by volatility
-  varying from minus \emph{two to two} by step of
-  \emph{0.1} . The process has been repeated \bold{six
-  thousand times}.
-}
-\details{
-  Unfortunately, there is no \bold{analytical formulae} to
-  establish the maximum drawdown properties under the
-  random walk assumption. We should note first that due to
-  its definition, the maximum drawdown divided by
-  volatility can be interpreted as the only function of the
-  ratio mean divided by volatility. \deqn{MD/[\sigma]= Min
-  (\sum[X(j)])/\sigma = F(\mu/\sigma)} Where j varies from
-  1 to n ,which is the number of drawdown's in simulation
-}
-\examples{
-library(PerformanceAnalytics)
-AcarSim(R)
-}
-\author{
-  Shubhankit Mohan
-}
-\references{
-  Maximum Loss and Maximum Drawdown in Financial
-  Markets,\emph{International Conference Sponsored by BNP
-  and Imperial College on: Forecasting Financial Markets,
-  London, United Kingdom, May 1997}
-  \url{http://www.intelligenthedgefundinvesting.com/pubs/easj.pdf}
-}
-\keyword{Drawdown}
-\keyword{Loss}
-\keyword{Maximum}
-\keyword{Simulated}
-

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/LoSharpe.Rd	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,71 +0,0 @@
-\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(edhec)
-LoSharpe(edhec,0,3)
-}
-\author{
-  Shubhankit Mohan
-}
-\references{
-  Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002,
-  AIMR. \code{\link[stats]{}} \cr
-  \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}
-

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/se.LoSharpe.Rd	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,74 +0,0 @@
-\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(edhec)
-se.LoSharpe(edhec,0,3)
-}
-\author{
-  Shubhankit Mohan
-}
-\references{
-  Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002,
-  AIMR. \code{\link[stats]{}} \cr
-  \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}
-

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/man/table.Sharpe.Rd	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,86 +0,0 @@
-\name{table.Sharpe}
-\alias{table.Sharpe}
-\title{Sharpe Ratio Statistics Summary}
-\usage{
-  table.Sharpe(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{
-  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(edhec)
-table.Sharpe(edhec,0,3)
-}
-\author{
-  Shubhankit Mohan
-}
-\references{
-  Andrew Lo,\emph{ The Statistics of Sharpe Ratio.}2002,
-  AIMR. \code{\link[stats]{}} \cr
-  \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}
-

Deleted: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/CommodityReport.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/CommodityReport.Rnw	2013-09-07 10:16:35 UTC (rev 3015)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/CommodityReport.Rnw	2013-09-07 11:19:40 UTC (rev 3016)
@@ -1,226 +0,0 @@
-%% no need for  \DeclareGraphicsExtensions{.pdf,.eps}
-
-\documentclass[12pt,letterpaper,english]{article}
-\usepackage{times}
-\usepackage[T1]{fontenc}
-\IfFileExists{url.sty}{\usepackage{url}}
-                      {\newcommand{\url}{\texttt}}
-
-\usepackage{babel}
-%\usepackage{noweb}
-\usepackage{Rd}
-
-\usepackage{Sweave}
-\SweaveOpts{engine=R,eps=FALSE}
-%\VignetteIndexEntry{Performance Attribution from Bacon}
-%\VignetteDepends{PerformanceAnalytics}
-%\VignetteKeywords{returns, performance, risk, benchmark, portfolio}
-%\VignettePackage{PerformanceAnalytics}
-
-%\documentclass[a4paper]{article}
-%\usepackage[noae]{Sweave}
-%\usepackage{ucs}
-%\usepackage[utf8x]{inputenc}
-%\usepackage{amsmath, amsthm, latexsym}
-%\usepackage[top=3cm, bottom=3cm, left=2.5cm]{geometry}
-%\usepackage{graphicx}
-%\usepackage{graphicx, verbatim}
-%\usepackage{ucs}
-%\usepackage[utf8x]{inputenc}
-%\usepackage{amsmath, amsthm, latexsym}
-%\usepackage{graphicx}
-
-\title{Commodity Index Fund Performance Analysis}
-\author{Shubhankit Mohan}
-
-\begin{document}
-\SweaveOpts{concordance=TRUE}
-
-\maketitle
-
-
-\begin{abstract}
-The fact that many hedge fund returns exhibit extraordinary levels of serial correlation is now well-known and generally accepted as fact. The effect of this autocorrelation on investment returns diminishes the apparent risk of such asset classes as the true returns/risk is easily \textbf{camouflaged} within a haze of illiquidity, stale prices, averaged price quotes and smoothed return reporting. We highlight the effect \emph{autocorrelation} and \emph{drawdown} has on performance analysis by investigating the results of functions developed during the Google Summer of Code 2013 on \textbf{commodity based index} .
-\end{abstract}
-
-<<echo=FALSE >>=
-library(PerformanceAnalytics)
-library(noniid.sm)
-data(edhec)
-@
-
-
-\section{Background}
-The investigated fund index that tracks a basket of \emph{commodities} to measure their performance.The value of these indexes fluctuates based on their underlying commodities, and this value depends on the \emph{component}, \emph{methodology} and \emph{style} to cover commodity markets .
-
-A brief overview of the four index invested in our report are : 
-  \begin{itemize}
-    \item
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/returnanalytics -r 3016


More information about the Returnanalytics-commits mailing list