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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Aug 31 22:52:41 CEST 2013


Author: shubhanm
Date: 2013-08-31 22:52:41 +0200 (Sat, 31 Aug 2013)
New Revision: 2955

Added:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ACFSTDEV.pdf
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ACFSTDEV.rnw
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.Rnw
   pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.pdf
Log:
./ Addition of clean build vignettes

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


Property changes on: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ACFSTDEV.pdf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ACFSTDEV.rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ACFSTDEV.rnw	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/ACFSTDEV.rnw	2013-08-31 20:52:41 UTC (rev 2955)
@@ -0,0 +1,90 @@
+%% 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{Autocorrelated Standard Deviation}
+\author{R Project for Statistical Computing}
+
+\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.Because hedge fund strategies have exceptionally high autocorrelations in reported returns and this is taken as evidence of return smoothing, we highlight the effect autocorrelation has on volatility which is hazed by the square root of time rule used in the industry
+\end{abstract}
+
+<<echo=FALSE >>=
+library(PerformanceAnalytics)
+data(edhec)
+@
+
+<<echo=FALSE>>=
+source('C:/Users/shubhankit/Desktop/Again/pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/ACStdDev.annualized.R')
+@
+
+\section{Methodology}
+Given a sample of historical returns \((R_1,R_2, . . .,R_T)\),the method assumes the fund manager smooths returns in the following manner, when 't' is the unit time interval:
+
+%Let $X \sim N(0,1)$ and $Y \sim \textrm{Exponential}(\mu)$.  Let
+%$Z = \sin(X)$. $\sqrt{X}$.
+  
+%$\hat{\mu}$ = $\displaystyle\frac{22}{7}$
+%e^{2 \mu} = 1
+%\begin{equation}
+%\left(\sum_{t=1}^{T} R_t/T\right) = \hat{\mu} \\
+%\end{equation}
+\begin{equation}
+ \sigma_{T}  =  T \sqrt{\sigma_{t}} \\
+\end{equation}
+
+
+\section{Usage}
+
+In this example we use edhec database, to compute true Hedge Fund Returns.
+
+<<echo=T,fig=T>>=
+library(PerformanceAnalytics)
+data(edhec)
+ACFVol = ACStdDev.annualized(edhec[,1:3])
+Vol = StdDev.annualized(edhec[,1:3])
+Vol
+ACFVol
+barplot(rbind(ACFVol,Vol), main="ACF and Orignal Volatility",
+         xlab="Fund Type",ylab="Volatilty (in %)", col=c("darkblue","red"), beside=TRUE)
+   legend("topright", c("1","2"), cex=0.6, 
+                   bty="2", fill=c("darkblue","red"));
+@
+
+The above figure shows the behaviour of the distribution tending to a normal IID distribution.For comparitive purpose, one can observe the change in the charateristics of return as compared to the orignal.
+
+\end{document}
\ No newline at end of file

Added: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.Rnw
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.Rnw	                        (rev 0)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.Rnw	2013-08-31 20:52:41 UTC (rev 2955)
@@ -0,0 +1,76 @@
+\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}
+\begin{document}
+\SweaveOpts{concordance=TRUE}
+
+\title{ Lo Sharpe Ratio }
+\author{R Project for Statistical Computing}
+% \keywords{Lo Sharpe Ratio,GLM Smooth Index,GLM Return Table}
+
+\makeatletter
+\makeatother
+\maketitle
+
+\begin{abstract}
+
+    This vignette gives an overview of the Lo Sharpe Ratio which have addressed the issue of IID in the financial time series data.
+\end{abstract}
+
+
+<<echo=FALSE>>=
+source('C:/Users/shubhankit/Desktop/Again/pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/R/LoSharpe.R')
+@
+
+<<echo=FALSE >>=
+library(PerformanceAnalytics)
+data(edhec)
+@
+\section{Background}
+The building blocks of the \textbf{Sharpe Ratio} : expected returns and volatilities  are unknown quantities that must be estimated statistically and are,
+therefore, subject to \emph{estimation error} . This raises the natural question: How
+\emph{accurately} are Sharpe ratios measured? To address this question, Andrew Lo derives explicit expressions for the statistical distribution of the Sharpe ratio using
+standard asymptotic theory. 
+
+
+\section{Lo Sharpe Ratio}
+ Given a predefined benchmark Sharpe ratio $SR^\ast$ , the observed Sharpe ratio         $\hat{SR}$  can be expressed in terms of autocorrelated coefficients as
+ 
+ \deqn{ \hat{SR} (q) - SR(q)= Normal Distribution(0,V_{GMM}(q)) }
+ 
+The estimator for the Sharpe ratio then follows directly:
+\deqn{  \hat{SR} (q) =  \hat{ \eta } (q)  * Sharpe Ratio}
+\deqn{  \hat{ \eta } (q)= q/\sqrt{q +  \sum_k^n  \rho  } }
+\section{Example}
+
+In an illustrative
+empirical example of mutual funds and hedge funds, we find results, similar reported in paper, that the annual Sharpe ratio for a hedge fund can be overstated by as much as \textbf{65} \% because of the presence of \textbf{serial correlation} , and once
+this serial correlation is properly taken into account, the rankings of hedge
+funds based on \emph{Sharpe ratios} can change dramatically.
+
+<<echo=T,fig=T>>=
+data(edhec)
+charts.PerformanceSummary(edhec[,2:4],
+colorset = rich6equal, lwd = 2, ylog = TRUE)
+@
+
+We can observe that the fund "\textbf{Emerging Markets}", which has the largest drawdown and serial autocorrelation, has it's Andrew Lo Sharpe ratio , \emph{decrease} most significantly as comapared to other funds.
+<<echo=T,fig=T>>=
+Lo.Sharpe = LoSharpe(edhec[,2:4])
+Theoretical.Sharpe= SharpeRatio.annualized(edhec[,2:4])
+barplot(rbind(Theoretical.Sharpe,Lo.Sharpe), main="Theoretical and Andrew Lo Sharpe Ratio Observed",
+         xlab="Fund Type",ylab="Value", col=c("darkblue","red"), beside=TRUE)
+   legend("topright", c("1","2"), cex=0.6, 
+                   bty="2", fill=c("darkblue","red"));
+@
+
+
+\end{document}

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


Property changes on: pkg/PerformanceAnalytics/sandbox/Shubhankit/noniid.sm/vignettes/LoSharpe.pdf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream



More information about the Returnanalytics-commits mailing list