[Returnanalytics-commits] r2770 - in pkg/PerformanceAnalytics/sandbox/Shubhankit: Week1/Code Week4/Code

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 13 00:38:57 CEST 2013


Author: shubhanm
Date: 2013-08-13 00:38:56 +0200 (Tue, 13 Aug 2013)
New Revision: 2770

Modified:
   pkg/PerformanceAnalytics/sandbox/Shubhankit/Week1/Code/Return.Okunev.R
   pkg/PerformanceAnalytics/sandbox/Shubhankit/Week4/Code/AcarSim.R
Log:
Reoxygenization, modification(Week 4, 3) as well as addtion of CDD Optimization



Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/Week1/Code/Return.Okunev.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/Week1/Code/Return.Okunev.R	2013-08-12 21:44:10 UTC (rev 2769)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/Week1/Code/Return.Okunev.R	2013-08-12 22:38:56 UTC (rev 2770)
@@ -1,3 +1,25 @@
+#'
+#'The objective is to determine the true underlying return by removing the 
+#' autocorrelation structure in the original return series without making any assumptions 
+#' regarding the actual time series properties of the underlying process. We are 
+#' implicitly assuming by this approach that the autocorrelations that arise in reported 
+#'returns are entirely due to the smoothing behavior funds engage in when reporting 
+#' results. In fact, the method may be adopted to produce any desired 
+#' level of autocorrelation at any lag and is not limited to simply eliminating all 
+#'autocorrelations.It can be be said as the general form of Geltner Return Model
+#'
+#' @references "Hedge Fund Risk Factors and Value at Risk of Credit 
+#' Trading Strategies , John Okunev & Derek White
+#' 
+#' @keywords ts multivariate distribution models
+#' @examples
+#' 
+#' data(managers)
+#' head(Return.Okunev(managers[,1:3]),n=3)
+#' 
+#'
+#' @export
+
 Return.Okunev<-function(R,q=3)
 {
   column.okunev=R
@@ -9,7 +31,7 @@
   }
   return(c(column.okunev))
 }
-
+#' Recusrsive Okunev Call Function
 quad <- function(R,d)
 {
   coeff = as.numeric(acf(as.numeric(edhec[,1]), plot = FALSE)[1:2][[1]])
@@ -19,3 +41,15 @@
   #a <- a[!is.na(a)]
   return(c(ans))               
 }
+###############################################################################
+# 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: Return.Okunev.R 2163 2012-07-16 00:30:19Z braverock $
+#
+###############################################################################
+

Modified: pkg/PerformanceAnalytics/sandbox/Shubhankit/Week4/Code/AcarSim.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Shubhankit/Week4/Code/AcarSim.R	2013-08-12 21:44:10 UTC (rev 2769)
+++ pkg/PerformanceAnalytics/sandbox/Shubhankit/Week4/Code/AcarSim.R	2013-08-12 22:38:56 UTC (rev 2770)
@@ -5,6 +5,8 @@
 #' 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
 #' two to two by step of 0.1. The process has been repeated six thousand times.
+#' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of
+#' asset returns
 #' @author R Project
 #' @references DRAWDOWN MEASURE IN PORTFOLIO OPTIMIZATION,\emph{International Journal of Theoretical and Applied Finance}
 #' ,Fall 1994, 49-58.Vol. 8, No. 1 (2005) 13-58
@@ -15,8 +17,11 @@
 #' @rdname Cdrawdown
 #' @export 
 AcarSim <-
-  function()
+  function(R)
   {
+    R = checkData(Ra, method="xts")
+    # Get dimensions and labels
+    # simulated parameters using edhec data
 mu=mean(Return.annualized(edhec))
 monthly=(1+mu)^(1/12)-1
 sig=StdDev.annualized(edhec[,1])[1];
@@ -68,7 +73,7 @@
        lty = c(2, -1, 1), pch = c(-1, 3, 4), merge = TRUE, bg='gray90')
 
 title("Maximum Drawdown/Volatility as a function of Return/Volatility 
-36 monthly returns simulated 6,000 time") 
+36 monthly returns simulated 6,000 times") 
 }
 
 ###############################################################################



More information about the Returnanalytics-commits mailing list