[Uwgarp-commits] r100 - in pkg/GARPFRM: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 5 06:15:59 CET 2014


Author: rossbennett34
Date: 2014-03-05 06:15:58 +0100 (Wed, 05 Mar 2014)
New Revision: 100

Added:
   pkg/GARPFRM/man/chartSML.Rd
   pkg/GARPFRM/man/countViolations.Rd
   pkg/GARPFRM/man/plotEndingPrices.Rd
Modified:
   pkg/GARPFRM/DESCRIPTION
   pkg/GARPFRM/NAMESPACE
   pkg/GARPFRM/R/EWMA.R
   pkg/GARPFRM/man/CAPM.Rd
   pkg/GARPFRM/man/EWMA.Rd
   pkg/GARPFRM/man/backTestVaR.Rd
   pkg/GARPFRM/man/endingPrices.Rd
   pkg/GARPFRM/man/fcstGarch11.Rd
   pkg/GARPFRM/man/garch11.Rd
   pkg/GARPFRM/man/getAlphas.Rd
   pkg/GARPFRM/man/getBetas.Rd
   pkg/GARPFRM/man/getCor.Rd
   pkg/GARPFRM/man/getCov.Rd
   pkg/GARPFRM/man/getStatistics.Rd
   pkg/GARPFRM/man/hypTest.Rd
   pkg/GARPFRM/man/monteCarlo.Rd
Log:
updating documentation

Modified: pkg/GARPFRM/DESCRIPTION
===================================================================
--- pkg/GARPFRM/DESCRIPTION	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/DESCRIPTION	2014-03-05 05:15:58 UTC (rev 100)
@@ -13,3 +13,9 @@
 Suggests:
     quadprog
 License: GPL
+Collate:
+    'backTestVaR.R'
+    'capm.R'
+    'EWMA.R'
+    'garch11.R'
+    'monte_carlo.R'

Modified: pkg/GARPFRM/NAMESPACE
===================================================================
--- pkg/GARPFRM/NAMESPACE	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/NAMESPACE	2014-03-05 05:15:58 UTC (rev 100)
@@ -1,26 +1,9 @@
-S3method(countViolations,xts)
-S3method(fcstGarch11,DCCfit)
-S3method(getAlphas,capm_mlm)
-S3method(getAlphas,capm_uv)
-S3method(getBetas,capm_mlm)
-S3method(getBetas,capm_uv)
-S3method(getCor,EWMACor)
-S3method(getCov,EWMACovar)
-S3method(getCov,EWMAVar)
-S3method(getStatistics,capm_mlm)
-S3method(getStatistics,capm_uv)
-S3method(hypTest,capm_mlm)
-S3method(hypTest,capm_uv)
-S3method(plot,EWMACor)
-S3method(plot,EWMACovar)
-S3method(plot,EWMAVar)
-S3method(plot,capm_mlm)
-S3method(plot,capm_uv)
+export(backTestVaR)
 export(CAPM)
-export(EWMA)
-export(backTestVaR)
 export(chartSML)
 export(countViolations)
+export(endingPrices)
+export(EWMA)
 export(fcstGarch11)
 export(garch11)
 export(getAlphas)
@@ -29,3 +12,23 @@
 export(getCov)
 export(getStatistics)
 export(hypTest)
+export(monteCarlo)
+export(plot.capm_mlm)
+export(plot.capm_uv)
+export(plot.corEWMA)
+export(plot.covEWMA)
+export(plot.varEWMA)
+export(plotEndingPrices)
+S3method(countViolations,xts)
+S3method(fcstGarch11,DCCfit)
+S3method(getAlphas,capm_mlm)
+S3method(getAlphas,capm_uv)
+S3method(getBetas,capm_mlm)
+S3method(getBetas,capm_uv)
+S3method(getCor,corEWMA)
+S3method(getCov,covEWMA)
+S3method(getCov,varEWMA)
+S3method(getStatistics,capm_mlm)
+S3method(getStatistics,capm_uv)
+S3method(hypTest,capm_mlm)
+S3method(hypTest,capm_uv)

Modified: pkg/GARPFRM/R/EWMA.R
===================================================================
--- pkg/GARPFRM/R/EWMA.R	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/R/EWMA.R	2014-03-05 05:15:58 UTC (rev 100)
@@ -58,7 +58,7 @@
 #' 
 #' Extract the covariance between two assets from an EWMA object
 #' 
-#' @param EWMA an EWMA object created by \code{\link{EWMA}}
+#' @param EWMA an EWMA object created by \link{\code{EWMA}}
 #' @param assets character vector or numeric vector. If 
 #' \code{assets} is of length 1, then the variance will be returned. 
 #' The assets can be specified by name or index.
@@ -109,9 +109,11 @@
 
 #' EWMA Correlation
 #' 
-#' Extract the correlation of two assets from an EWMA object
+#' Extract the correlation of two assets from an \code{EWMA} object
 #' 
-#' @param object an EWMA object created by \code{\link{EWMA}}
+#' @param object an EWMA object created by \link{\code{EWMA}}
+#' @param assets character vector or numeric vector. The assets can be 
+#' specified by name or index.
 #' @export
 getCor <- function(EWMA, assets){
   UseMethod("getCor")

Modified: pkg/GARPFRM/man/CAPM.Rd
===================================================================
--- pkg/GARPFRM/man/CAPM.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/CAPM.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,7 +2,7 @@
 \alias{CAPM}
 \title{Capital Asset Pricing Model}
 \usage{
-CAPM(R, Rmkt)
+  CAPM(R, Rmkt)
 }
 \arguments{
   \item{R}{asset returns}
@@ -10,10 +10,10 @@
   \item{Rmkt}{market returns}
 }
 \description{
-Description of CAPM Retrieves alphas, betas, as well as
-pvalue and tstats. The Model is used to determine a
-theoretically appropriate rate of return of an asset's
-non-diversifiable risk.
+  Description of CAPM Retrieves alphas, betas, as well as
+  pvalue and tstats. The Model is used to determine a
+  theoretically appropriate rate of return of an asset's
+  non-diversifiable risk.
 }
 \examples{
 data(crsp.short)

Modified: pkg/GARPFRM/man/EWMA.Rd
===================================================================
--- pkg/GARPFRM/man/EWMA.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/EWMA.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,19 +2,22 @@
 \alias{EWMA}
 \title{Exponential Weighted Moving Average (EWMA)}
 \usage{
-EWMA(R, lambda = 0.94, initialWindow = 10, cor = FALSE)
+  EWMA(R, lambda = 0.94, initialWindow = 10, cor = FALSE)
 }
 \arguments{
-  \item{R}{}
+  \item{R}{asset returns}
 
-  \item{lambda}{}
+  \item{lambda}{smoothing parameter, must be greater than 0
+  or less than 1}
 
-  \item{initialWindow}{is the initializing window}
+  \item{initialWindow}{initial window of observations used
+  in estimating the initial covariance or correlation}
 
-  \item{correlation}{option (cor by default = FALSE)}
+  \item{TRUE/FALSE}{to return a correlation matrix. Default
+  cor = FALSE.}
 }
 \description{
-Description of EWMA. The function handles UV and MLM
-objects and returns either cov/cor.
+  Use an exponentially weighted moving average to estimate
+  the covariance or correlation of asset returns.
 }
 

Modified: pkg/GARPFRM/man/backTestVaR.Rd
===================================================================
--- pkg/GARPFRM/man/backTestVaR.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/backTestVaR.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,7 +2,7 @@
 \alias{backTestVaR}
 \title{Backtesting VaR (backTestVaR)}
 \usage{
-backTestVaR(R, CI = 0.95)
+  backTestVaR(R, CI = 0.95)
 }
 \arguments{
   \item{R}{returns}
@@ -10,7 +10,7 @@
   \item{CI}{confidence level}
 }
 \description{
-Description of backTestVaR. The function should handle UV
-and MLM.
+  Description of backTestVaR. The function should handle UV
+  and MLM.
 }
 

Added: pkg/GARPFRM/man/chartSML.Rd
===================================================================
--- pkg/GARPFRM/man/chartSML.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/chartSML.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -0,0 +1,17 @@
+\name{chartSML}
+\alias{chartSML}
+\title{CAPM SML}
+\usage{
+  chartSML(object)
+}
+\arguments{
+  \item{object}{a capm object created by
+  \code{\link{CAPM}}}
+}
+\description{
+  Description of CAPM Security Market Line (SML) SML is the
+  represesentation of the CAPM. It illustrates the expected
+  rate of return of an individual secuirty as a function of
+  systematic, non-diversified risk (known as beta).
+}
+

Added: pkg/GARPFRM/man/countViolations.Rd
===================================================================
--- pkg/GARPFRM/man/countViolations.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/countViolations.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -0,0 +1,20 @@
+\name{countViolations}
+\alias{countViolations}
+\title{Count backtesting VaR}
+\usage{
+  countViolations(object, temp, initialWindow, CI)
+}
+\arguments{
+  \item{backTestVaR}{object created by
+  \code{\link{backTestVaR}}}
+
+  \item{initialWindow}{}
+
+  \item{CI}{}
+
+  \item{temp}{}
+}
+\description{
+  Description of countBacktesting VaR
+}
+

Modified: pkg/GARPFRM/man/endingPrices.Rd
===================================================================
--- pkg/GARPFRM/man/endingPrices.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/endingPrices.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,9 +2,17 @@
 \alias{endingPrices}
 \title{Ending Prices of Monte Carlo Simulation}
 \usage{
-endingPrices(mc)
+  endingPrices(mc)
 }
+\arguments{
+  \item{mc}{monte carlo object created with
+  \link{\code{monteCarlo}}}
+}
+\value{
+  vector ending prices
+}
 \description{
-Ending Prices of Monte Carlo Simulation
+  Get the ending prices, i.e. terminal values, of a monte
+  carlo simulation
 }
 

Modified: pkg/GARPFRM/man/fcstGarch11.Rd
===================================================================
--- pkg/GARPFRM/man/fcstGarch11.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/fcstGarch11.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,7 +2,7 @@
 \alias{fcstGarch11}
 \title{Forecast GARCH(1,1)}
 \usage{
-fcstGarch11(object, window)
+  fcstGarch11(object, window)
 }
 \arguments{
   \item{garch11}{object created by
@@ -12,6 +12,6 @@
   window = 100)}
 }
 \description{
-Description of forecast GARCH(1,1)
+  Description of forecast GARCH(1,1)
 }
 

Modified: pkg/GARPFRM/man/garch11.Rd
===================================================================
--- pkg/GARPFRM/man/garch11.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/garch11.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,7 +2,7 @@
 \alias{garch11}
 \title{GARCH(1,1)}
 \usage{
-garch11(R, model = "sGARCH", distribution.model = "norm")
+  garch11(R, model = "sGARCH", distribution.model = "norm")
 }
 \arguments{
   \item{R}{GARCH(1,1)}
@@ -20,6 +20,6 @@
   “jsu” for Johnson's SU distribution.}
 }
 \description{
-Description of GARCH(1,1)
+  Description of GARCH(1,1)
 }
 

Modified: pkg/GARPFRM/man/getAlphas.Rd
===================================================================
--- pkg/GARPFRM/man/getAlphas.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/getAlphas.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,14 +2,14 @@
 \alias{getAlphas}
 \title{CAPM alphas}
 \usage{
-getAlphas(object)
+  getAlphas(object)
 }
 \arguments{
   \item{object}{a capm object created by
   \code{\link{CAPM}}}
 }
 \description{
-Description of CAPM alphas: retrieves alpha (intercept)
-from CAPM object.
+  Description of CAPM alphas: retrieves alpha (intercept)
+  from CAPM object.
 }
 

Modified: pkg/GARPFRM/man/getBetas.Rd
===================================================================
--- pkg/GARPFRM/man/getBetas.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/getBetas.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,14 +2,14 @@
 \alias{getBetas}
 \title{CAPM betas}
 \usage{
-getBetas(object)
+  getBetas(object)
 }
 \arguments{
   \item{object}{a capm object created by
   \code{\link{CAPM}}}
 }
 \description{
-Description of CAPM betas: retrieves beta (slope) from CAPM
-object.
+  Description of CAPM betas: retrieves beta (slope) from
+  CAPM object.
 }
 

Modified: pkg/GARPFRM/man/getCor.Rd
===================================================================
--- pkg/GARPFRM/man/getCor.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/getCor.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,13 +2,17 @@
 \alias{getCor}
 \title{EWMA Correlation}
 \usage{
-getCor(object, asset1, asset2)
+  getCor(EWMA, assets)
 }
 \arguments{
-  \item{object}{a EWMA object created by
-  \code{\link{EWMA}}}
+  \item{object}{an EWMA object created by
+  \link{\code{EWMA}}}
+
+  \item{assets}{character vector or numeric vector. The
+  assets can be specified by name or index.}
 }
 \description{
-Description of EWMA Correlation, requires two assets
+  Extract the correlation of two assets from an \code{EWMA}
+  object
 }
 

Modified: pkg/GARPFRM/man/getCov.Rd
===================================================================
--- pkg/GARPFRM/man/getCov.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/getCov.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -1,14 +1,18 @@
 \name{getCov}
 \alias{getCov}
-\title{EWMA Volatility/Cross-Volatility}
+\title{EWMA Covariance}
 \usage{
-getCov(object, asset1, asset2)
+  getCov(EWMA, assets)
 }
 \arguments{
-  \item{object}{a EWMA object created by
-  \code{\link{EWMA}}}
+  \item{EWMA}{an EWMA object created by \link{\code{EWMA}}}
+
+  \item{assets}{character vector or numeric vector. If
+  \code{assets} is of length 1, then the variance will be
+  returned. The assets can be specified by name or index.}
 }
 \description{
-Description of EWMA Vola
+  Extract the covariance between two assets from an EWMA
+  object
 }
 

Modified: pkg/GARPFRM/man/getStatistics.Rd
===================================================================
--- pkg/GARPFRM/man/getStatistics.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/getStatistics.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,14 +2,14 @@
 \alias{getStatistics}
 \title{CAPM statistics}
 \usage{
-getStatistics(object)
+  getStatistics(object)
 }
 \arguments{
   \item{object}{a capm object created by
   \code{\link{CAPM}}}
 }
 \description{
-Description of CAPM statistics: retrieves standard error,
-t-values, and p-values
+  Description of CAPM statistics: retrieves standard error,
+  t-values, and p-values
 }
 

Modified: pkg/GARPFRM/man/hypTest.Rd
===================================================================
--- pkg/GARPFRM/man/hypTest.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/hypTest.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,15 +2,15 @@
 \alias{hypTest}
 \title{CAPM hypTest}
 \usage{
-hypTest(object, CI)
+  hypTest(object, CI)
 }
 \arguments{
   \item{object}{a capm object created by
   \code{\link{CAPM}}}
 }
 \description{
-Description of CAPM beta/alpha hypothesis test
-Generalization is termed a two-sided or two-tailed test.
-Returns a true (reject) or false (fail to reject).
+  Description of CAPM beta/alpha hypothesis test
+  Generalization is termed a two-sided or two-tailed test.
+  Returns a true (reject) or false (fail to reject).
 }
 

Modified: pkg/GARPFRM/man/monteCarlo.Rd
===================================================================
--- pkg/GARPFRM/man/monteCarlo.Rd	2014-03-05 03:23:09 UTC (rev 99)
+++ pkg/GARPFRM/man/monteCarlo.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -2,8 +2,8 @@
 \alias{monteCarlo}
 \title{Monte Carlo Price Path Simulation}
 \usage{
-monteCarlo(mu, sigma, N = 100, Time = 1, steps = 52,
-  starting_value = 100, log = TRUE)
+  monteCarlo(mu, sigma, N = 100, Time = 1, steps = 52,
+    starting_value = 100, log = TRUE)
 }
 \arguments{
   \item{mu}{annualized expected return}
@@ -16,16 +16,30 @@
 
   \item{steps}{number of time steps}
 
-  \item{starting_value}{price to start at}
+  \item{starting_value}{asset price starting value}
 
-  \item{log}{TRUE/FALSE (default = TRUE) simulate ln(P)
+  \item{log}{TRUE/FALSE (default = TRUE) simulate ln(S)
   rather than S; where S is the price of the asset.}
 }
 \value{
-matrix of Monte Carlo simulated price paths
+  matrix of simulated price paths where each column
+  represents a price path
 }
 \description{
-Description for Monte Carlo. Geometric brownian motion. mu
-and sigma are assumed constant
+  Run \code{N} monte carlo simulations to generate asset
+  price paths following a geometric brownian motion
+  process.
 }
+\details{
+  TODO: add equations for GBM
+}
+\note{
+  This function returns a m x N matrix of simulated price
+  paths where m is the number of steps + 1 and N is the
+  number of simulations. This can be very memory and
+  compute intensive with a large number of steps and/or a
+  large number of simulations. More efficient methods in
+  terms of speed and memory should be used, for example, to
+  price options.
+}
 

Added: pkg/GARPFRM/man/plotEndingPrices.Rd
===================================================================
--- pkg/GARPFRM/man/plotEndingPrices.Rd	                        (rev 0)
+++ pkg/GARPFRM/man/plotEndingPrices.Rd	2014-03-05 05:15:58 UTC (rev 100)
@@ -0,0 +1,14 @@
+\name{plotEndingPrices}
+\alias{plotEndingPrices}
+\title{Plot Ending Prices}
+\usage{
+  plotEndingPrices(mc)
+}
+\arguments{
+  \item{mc}{monte carlo object created with
+  \link{\code{monteCarlo}}}
+}
+\description{
+  Plot the ending prices from a Monte Carlo simulation
+}
+



More information about the Uwgarp-commits mailing list