[Returnanalytics-commits] r1956 - in pkg/PerformanceAnalytics: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 23 19:50:05 CEST 2012


Author: braverock
Date: 2012-05-23 19:50:05 +0200 (Wed, 23 May 2012)
New Revision: 1956

Modified:
   pkg/PerformanceAnalytics/R/Return.clean.R
   pkg/PerformanceAnalytics/R/chart.QQPlot.R
   pkg/PerformanceAnalytics/R/mean.utils.R
   pkg/PerformanceAnalytics/man/chart.BarVaR.Rd
   pkg/PerformanceAnalytics/man/chart.Boxplot.Rd
   pkg/PerformanceAnalytics/man/chart.Histogram.Rd
   pkg/PerformanceAnalytics/man/chart.QQPlot.Rd
   pkg/PerformanceAnalytics/man/chart.RelativePerformance.Rd
   pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd
   pkg/PerformanceAnalytics/man/clean.boudt.Rd
   pkg/PerformanceAnalytics/man/mean.geometric.Rd
Log:
- more changes to complete roxygen conversion of the documentation

Modified: pkg/PerformanceAnalytics/R/Return.clean.R
===================================================================
--- pkg/PerformanceAnalytics/R/Return.clean.R	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/R/Return.clean.R	2012-05-23 17:50:05 UTC (rev 1956)
@@ -126,7 +126,7 @@
 #' matrix of the bulk of the data and let \eqn{\lfloor \cdot \rfloor}{floor()}
 #' be the operator that takes the integer part of its argument. As a measure of
 #' the extremeness of the return observation \eqn{r_t}, we use its squared
-#' Mahalanobis distance \eqn{ d^2_t = (r_t-\mu)'\Sigma^{-1}(r_t-\mu).} We
+#' Mahalanobis distance \eqn{ d^2_t = (r_t-\mu)'\Sigma^{-1}(r_t-\mu)}.  We
 #' follow Rousseeuw(1985) by estimating \eqn{\mu} and \eqn{\Sigma} as the mean
 #' vector and covariance matrix (corrected to ensure consistency) of the subset
 #' of size \eqn{\lfloor (1-\alpha)T\rfloor}{floor((1-\alpha)T)} for which the
@@ -142,14 +142,14 @@
 #' (1-\alpha)T \rfloor)}}{floor((1-\alpha)T)} and exceeds a very extreme
 #' quantile of the Chi squared distribution function with \eqn{n} degrees of
 #' freedom, which is the distribution function of \eqn{d^2_t} when the returns
-#' are normally distributed. In this application we take the 99.9% quantile,
-#' denoted \eqn{\chi^2_{n,0.999}}.
+#' are normally distributed. In this application we take the 99.9\% quantile,
+#' denoted \eqn{\chi ^2_{n,0.999}}.
 #' 
 #' \item \emph{Data cleaning. } Similarly to Khan(2007) we only clean the
-#' returns that are identified as outliers in step 2 by replacing these returns
-#' \eqn{r_t} with \deqn{r_t\sqrt{\frac{\max(d^2_{(\lfloor }{r_t *
-#' sqrt(max(d^2_floor((1-\alpha)T),\chi^2_{n,0.999})/d^2_t)}\deqn{(1-\alpha)T)\rfloor},\chi^2_{n,0.999})}{d^2_t}}}{r_t
-#' * sqrt(max(d^2_floor((1-\alpha)T),\chi^2_{n,0.999})/d^2_t)} The cleaned
+#' returns that are identified as outliers in step 2 
+#' by replacing these returns \eqn{r_t} with 
+#' \deqn{r_t\sqrt{\frac{\max(d^2_{(\lfloor(1-\alpha)T)\rfloor},\chi^2_{n,0.999})}{d^2_t}}}{r_t * sqrt(max(d^2_floor((1-\alpha)T),\chi^2_{n,0.999})/d^2_t)}
+#' The cleaned
 #' return vector has the same orientation as the original return vector, but
 #' its magnitude is smaller. Khan(2007) calls this procedure of limiting the
 #' value of \eqn{d^2_t} to a quantile of the \eqn{\chi^2_n} distribution,
@@ -173,7 +173,7 @@
 #' 
 #' @param R an xts, vector, matrix, data frame, timeSeries or zoo object of
 #' asset returns
-#' @param alpha probability to filter at 1-alpha, defaults to .01 (99%)
+#' @param alpha probability to filter at 1-alpha, defaults to .01 (99\%)
 #' @param trim where to set the "extremeness" of the Mahalanobis distance
 #' @return cleaned data matrix
 #' @note This function and much of this text was originally written for Boudt,

Modified: pkg/PerformanceAnalytics/R/chart.QQPlot.R
===================================================================
--- pkg/PerformanceAnalytics/R/chart.QQPlot.R	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/R/chart.QQPlot.R	2012-05-23 17:50:05 UTC (rev 1956)
@@ -25,16 +25,16 @@
 #' @param main set the chart title, same as in \code{plot}
 #' @param las set the direction of axis labels, same as in \code{plot}
 #' @param envelope confidence level for point-wise confidence envelope, or
-#' 'FALSE' for no envelope.
+#' FALSE for no envelope.
 #' @param labels vector of point labels for interactive point identification,
-#' or 'FALSE' for no labels.
+#' or FALSE for no labels.
 #' @param col color for points and lines; the default is the \emph{second}
 #' entry in the current color palette (see 'palette' and 'par').
 #' @param lwd set the line width, as in \code{\link{plot}}
 #' @param pch symbols to use, see also \code{\link{plot}}
 #' @param cex symbols to use, see also \code{\link{plot}}
-#' @param line '"quartiles"' to pass a line through the quartile-pairs, or
-#' '"robust"' for a robust-regression line; the latter uses the 'rlm' function
+#' @param line 'quartiles' to pass a line through the quartile-pairs, or
+#' 'robust' for a robust-regression line; the latter uses the 'rlm' function
 #' in the 'MASS' package. Specifying 'line = "none"' suppresses the line.
 #' @param element.color provides the color for drawing chart elements, such as
 #' the box lines, axis lines, etc. Default is "darkgray"
@@ -47,6 +47,7 @@
 #' @param cex.main The magnification to be used for the main title relative to
 #' the current setting of 'cex'.
 #' @param \dots any other passthru parameters to the distribution function
+#' 
 #' @author John Fox, ported by Peter Carl
 #' @seealso 
 #' \code{\link[stats]{qqplot}} \cr 

Modified: pkg/PerformanceAnalytics/R/mean.utils.R
===================================================================
--- pkg/PerformanceAnalytics/R/mean.utils.R	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/R/mean.utils.R	2012-05-23 17:50:05 UTC (rev 1956)
@@ -5,8 +5,6 @@
 #       first parameter with R command mean()
 
 
-#' @name mean.utils
-#' 
 #' calculate attributes relative to the mean of the observation series given,
 #' including geometric, stderr, LCL and UCL
 #' 
@@ -31,7 +29,7 @@
 #' mean.stderr(edhec[,"Funds of Funds"])
 #' mean.UCL(edhec[,"Funds of Funds"])
 #' mean.LCL(edhec[,"Funds of Funds"])
-#' 
+#' @rdname mean.geometric
 mean.geometric <-
 function (x, ...)
 {# @author Peter Carl

Modified: pkg/PerformanceAnalytics/man/chart.BarVaR.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.BarVaR.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/chart.BarVaR.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -4,9 +4,7 @@
 \title{Periodic returns in a bar chart with risk metric overlay}
 \usage{
   chart.BarVaR(R, width = 0, gap = 12,
-    methods = c("none", "ModifiedVaR", "GaussianVaR", 
-        "HistoricalVaR", "StdDev",
-        "ModifiedES", "GaussianES", "HistoricalES"),
+    methods = c("none", "ModifiedVaR", "GaussianVaR", "HistoricalVaR", "StdDev", "ModifiedES", "GaussianES", "HistoricalES"),
     p = 0.95, clean = c("none", "boudt", "geltner"),
     all = FALSE, ..., show.clean = FALSE,
     show.horizontal = FALSE, show.symmetric = FALSE,
@@ -96,7 +94,7 @@
   \code{\link{chart.TimeSeries}}}
 
   \item{ypad}{adds a numerical padding to the y-axis to
-  move data when legend.loc="bottom".  See
+  keep the data away when legend.loc="bottom".  See
   examples below.}
 
   \item{legend.cex}{sets the legend text size, such as in

Modified: pkg/PerformanceAnalytics/man/chart.Boxplot.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.Boxplot.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/chart.Boxplot.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -35,7 +35,7 @@
   rational choices}
 
   \item{symbol.color}{draws the symbols described in
-  mean.symbol,median.symbol,outlier.symbol
+  \code{mean.symbol},\code{median.symbol},\code{outlier.symbol}
   in the color specified}
 
   \item{mean.symbol}{symbol to use for the mean of the

Modified: pkg/PerformanceAnalytics/man/chart.Histogram.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.Histogram.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/chart.Histogram.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -4,12 +4,9 @@
 \usage{
   chart.Histogram(R, breaks = "FD", main = NULL,
     xlab = "Returns", ylab = "Frequency",
-    methods = c("none", "add.density", "add.normal", 
-            "add.centered", "add.cauchy", "add.sst", 
-            "add.rug", "add.risk", "add.qqplot"),
+    methods = c("none", "add.density", "add.normal", "add.centered", "add.cauchy", "add.sst", "add.rug", "add.risk", "add.qqplot"),
     show.outliers = TRUE,
-    colorset = c("lightgray", "#00008F", "#005AFF", 
-        "#23FFDC", "#ECFF13", "#FF4A00", "#800000"),
+    colorset = c("lightgray", "#00008F", "#005AFF", "#23FFDC", "#ECFF13", "#FF4A00", "#800000"),
     border.col = "white", lwd = 2, xlim = NULL,
     ylim = NULL, element.color = "darkgray",
     note.lines = NULL, note.labels = NULL, note.cex = 0.7,

Modified: pkg/PerformanceAnalytics/man/chart.QQPlot.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.QQPlot.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/chart.QQPlot.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -1,110 +1,136 @@
 \name{chart.QQPlot}
 \alias{chart.QQPlot}
-\title{ Plot a QQ chart }
-\description{
-Plot the return data against any theoretical distribution.
-}
+\title{Plot a QQ chart}
 \usage{
-chart.QQPlot(R, 
-    distribution = "norm", 
-    ylab = NULL, 
-    xlab = paste(distribution, "Quantiles"), 
-    main = NULL, 
-    las = par("las"), 
-    envelope = FALSE, 
-    labels = FALSE, 
-    col = c(1, 4), 
-    lwd = 2, 
-    pch = 1, 
-    cex = 1, 
-    line = c("quartiles", "robust", "none"), 
-    element.color = "darkgray", 
-    cex.axis = 0.8, 
-    cex.legend = 0.8, 
-    cex.lab = 1, 
-    cex.main = 1, 
-    ...
-    )
+  chart.QQPlot(R, distribution = "norm", ylab = NULL,
+    xlab = paste(distribution, "Quantiles"), main = NULL,
+    las = par("las"), envelope = FALSE, labels = FALSE,
+    col = c(1, 4), lwd = 2, pch = 1, cex = 1,
+    line = c("quartiles", "robust", "none"),
+    element.color = "darkgray", cex.axis = 0.8,
+    cex.legend = 0.8, cex.lab = 1, cex.main = 1,
+    xaxis = TRUE, yaxis = TRUE, ylim = NULL, ...)
 }
-\details{
-A Quantile-Quantile (QQ) plot is a scatter plot designed to compare the data to the theoretical distributions to visually determine if the observations are likely to have come from a known population. The empirical quantiles are plotted to the y-axis, and the x-axis contains the values of the theorical model.  A 45-degree reference line is also plotted. If the empirical data come from the population with the choosen distribution, the points should fall approximately along this reference line. The larger the departure from the reference line, the greater the evidence that the data set have come from a population with a different distribution.
-}
 \arguments{
-  \item{R}{ an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns }
-  \item{distribution}{ root name of comparison distribution - e.g., 'norm' for
-          the normal distribution; 't' for the t-distribution. See examples for other ideas. }
-  \item{xlab}{ set the x-axis label, as in \code{\link{plot}} }
-  \item{ylab}{ set the y-axis label, as in \code{\link{plot}} }
-  \item{main}{ set the chart title, same as in \code{plot} }
-  \item{las}{ set the direction of axis labels, same as in \code{plot} }
-  \item{envelope}{ confidence level for point-wise confidence envelope, or 'FALSE' for no envelope. }
-  \item{labels}{ vector of point labels for interactive point identification, or 'FALSE' for no labels. }
-  \item{col}{ color for points and lines; the default is the \emph{second} entry in the current color palette (see 'palette' and 'par'). }
-  \item{lwd}{ set the line width, as in \code{\link{plot}} }
-  \item{pch}{ symbols to use, see also \code{\link{plot}} }
-  \item{cex}{ symbols to use, see also \code{\link{plot}} }
-  \item{line}{ '"quartiles"' to pass a line through the quartile-pairs, or '"robust"' for a robust-regression line; the latter uses the 'rlm' function in the 'MASS' package. Specifying 'line = "none"' suppresses the line. }
-  \item{element.color}{ provides the color for drawing chart elements, such as the box lines, axis lines, etc. Default is "darkgray" }
-  \item{cex.legend}{ The magnification to be used for sizing the legend relative to the current setting of 'cex' }
-  \item{cex.axis}{ The magnification to be used for axis annotation relative to the current setting of 'cex' }
-  \item{cex.lab}{ The magnification to be used for x- and y-axis labels relative to the current setting of 'cex'}
-  \item{cex.main}{ The magnification to be used for the main title relative to the current setting of 'cex'.  }
-  \item{\dots}{ any other passthru parameters to the distribution function }
-}
+  \item{R}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of asset returns}
 
-\references{
-  main code forked/borrowed/ported from the excellent: \cr
-  Fox, John (2007) \emph{car: Companion to Applied Regression} \cr
-  \url{http://www.r-project.org}, \url{http://socserv.socsci.mcmaster.ca/jfox/}
+  \item{distribution}{root name of comparison distribution
+  - e.g., 'norm' for the normal distribution; 't' for the
+  t-distribution. See examples for other ideas.}
+
+  \item{xlab}{set the x-axis label, as in
+  \code{\link{plot}}}
+
+  \item{ylab}{set the y-axis label, as in
+  \code{\link{plot}}}
+
+  \item{xaxis}{if true, draws the x axis}
+
+  \item{yaxis}{if true, draws the y axis}
+
+  \item{ylim}{set the y-axis limits, same as in
+  \code{\link{plot}}}
+
+  \item{main}{set the chart title, same as in \code{plot}}
+
+  \item{las}{set the direction of axis labels, same as in
+  \code{plot}}
+
+  \item{envelope}{confidence level for point-wise
+  confidence envelope, or FALSE for no envelope.}
+
+  \item{labels}{vector of point labels for interactive
+  point identification, or FALSE for no labels.}
+
+  \item{col}{color for points and lines; the default is the
+  \emph{second} entry in the current color palette (see
+  'palette' and 'par').}
+
+  \item{lwd}{set the line width, as in \code{\link{plot}}}
+
+  \item{pch}{symbols to use, see also \code{\link{plot}}}
+
+  \item{cex}{symbols to use, see also \code{\link{plot}}}
+
+  \item{line}{'quartiles' to pass a line through the
+  quartile-pairs, or 'robust' for a robust-regression line;
+  the latter uses the 'rlm' function in the 'MASS' package.
+  Specifying 'line = "none"' suppresses the line.}
+
+  \item{element.color}{provides the color for drawing chart
+  elements, such as the box lines, axis lines, etc. Default
+  is "darkgray"}
+
+  \item{cex.legend}{The magnification to be used for sizing
+  the legend relative to the current setting of 'cex'}
+
+  \item{cex.axis}{The magnification to be used for axis
+  annotation relative to the current setting of 'cex'}
+
+  \item{cex.lab}{The magnification to be used for x- and
+  y-axis labels relative to the current setting of 'cex'}
+
+  \item{cex.main}{The magnification to be used for the main
+  title relative to the current setting of 'cex'.}
+
+  \item{\dots}{any other passthru parameters to the
+  distribution function}
 }
-\author{ John Fox, ported by Peter Carl }
-\seealso{
-  \code{\link[stats]{qqplot}} \cr
-  \code{\link[car]{qq.plot}}  \cr
-  \code{\link{plot}}
+\description{
+  Plot the return data against any theoretical
+  distribution.
 }
+\details{
+  A Quantile-Quantile (QQ) plot is a scatter plot designed
+  to compare the data to the theoretical distributions to
+  visually determine if the observations are likely to have
+  come from a known population. The empirical quantiles are
+  plotted to the y-axis, and the x-axis contains the values
+  of the theorical model.  A 45-degree reference line is
+  also plotted. If the empirical data come from the
+  population with the choosen distribution, the points
+  should fall approximately along this reference line. The
+  larger the departure from the reference line, the greater
+  the evidence that the data set have come from a
+  population with a different distribution.
+}
 \examples{
 library(MASS)
 data(managers)
-x = checkData(managers[,2, drop = FALSE], 
-    na.rm = TRUE, method = "vector")
-
+x = checkData(managers[,2, drop = FALSE], na.rm = TRUE, method = "vector")
 #layout(rbind(c(1,2),c(3,4)))
-
 # Panel 1, Normal distribution
-chart.QQPlot(x, main = "Normal Distribution", 
-    distribution = 'norm', envelope=0.95)
-
+chart.QQPlot(x, main = "Normal Distribution", distribution = 'norm', envelope=0.95)
 # Panel 2, Log-Normal distribution
 fit = fitdistr(1+x, 'lognormal')
-
-chart.QQPlot(1+x, main = "Log-Normal Distribution", 
-    envelope=0.95, distribution='lnorm')#, 
-    meanlog = fit$estimate[[1]], 
-    sdlog = fit$estimate[[2]])
+chart.QQPlot(1+x, main = "Log-Normal Distribution", envelope=0.95, distribution='lnorm')#, meanlog = fit$estimate[[1]], sdlog = fit$estimate[[2]])
 \dontrun{
 # Panel 3, Skew-T distribution
 library(sn)
 fit = st.mle(y=x)
-chart.QQPlot(x, main = "Skew T Distribution", 
-    envelope=0.95, distribution = 'st', 
-    location = fit$dp[[1]], scale = fit$dp[[2]], 
-    shape = fit$dp[[3]], df=fit$dp[[4]])
+chart.QQPlot(x, main = "Skew T Distribution", envelope=0.95, distribution = 'st', location = fit$dp[[1]], scale = fit$dp[[2]], shape = fit$dp[[3]], df=fit$dp[[4]])
 #Panel 4: Stable Parietian
 library(fBasics)
 fit.stable = stableFit(x,doplot=FALSE)
-chart.QQPlot(x, main = "Stable Pareto Distribution", 
-    envelope=0.95, distribution = 'stable', 
-    alpha = fit.stable at fit$estimate[[1]], 
-    beta = fit.stable at fit$estimate[[2]], 
-    gamma = fit.stable at fit$estimate[[3]], 
-    delta = fit.stable at fit$estimate[[4]], pm = 0)
+chart.QQPlot(x, main = "Stable Paretian Distribution", envelope=0.95, distribution = 'stable', alpha = fit.stable
 }
+\author{
+  John Fox, ported by Peter Carl
 }
-% Add one or more standard keywords, see file 'KEYWORDS' in the
-% R documentation directory.
-\keyword{ ts }
-\keyword{ multivariate }
-\keyword{ distribution }
-\keyword{ models }
-\keyword{ hplot }
+\references{
+  main code forked/borrowed/ported from the excellent: \cr
+  Fox, John (2007) \emph{car: Companion to Applied
+  Regression} \cr \url{http://www.r-project.org},
+  \url{http://socserv.socsci.mcmaster.ca/jfox/}
+}
+\seealso{
+  \code{\link[stats]{qqplot}} \cr
+  \code{\link[car]{qq.plot}} \cr \code{\link{plot}}
+}
+\keyword{distribution}
+\keyword{hplot}
+\keyword{models}
+\keyword{multivariate}
+\keyword{ts}
+

Modified: pkg/PerformanceAnalytics/man/chart.RelativePerformance.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.RelativePerformance.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/chart.RelativePerformance.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -30,7 +30,7 @@
   left, topleft, top, topright, right, or center.}
 
   \item{ylog}{TRUE/FALSE set the y-axis to logarithmic
-  scale, default FALSE}
+  scale, similar to \code{\link{plot}}, default FALSE}
 
   \item{cex.legend}{the magnification to be used for sizing
   the legend relative to the current setting of 'cex'.}

Modified: pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/chart.TimeSeries.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -1,57 +1,146 @@
 \name{chart.TimeSeries}
 \alias{chart.TimeSeries}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ Creates a time series chart with some extensions. }
-\description{
-Draws a line chart and labels the x-axis with the appropriate dates.  This is really a "primitive", since it extends the base \code{\link{plot}} and standardizes the elements of a chart.  Adds attributes for shading areas of the timeline or aligning vertical lines along the timeline. This function is intended to be used inside other charting functions.
-}
+\title{Creates a time series chart with some extensions.}
 \usage{
-chart.TimeSeries(R, auto.grid = TRUE, xaxis = TRUE, yaxis = TRUE, yaxis.right = FALSE, type = "l", lty = 1, lwd = 2, main = NULL, ylab = NULL, xlab = "Date", date.format.in = "\%Y-\%m-\%d", date.format = NULL, xlim = NULL, ylim = NULL, element.color = "darkgray", event.lines = NULL, event.labels = NULL, period.areas = NULL, event.color = "darkgray", period.color = "aliceblue", colorset = (1:12), pch = (1:12), legend.loc = NULL, ylog = FALSE, cex.axis = 0.8, cex.legend = 0.8, cex.lab = 1, cex.labels = 0.8, cex.main = 1, major.ticks = "auto", minor.ticks = TRUE, grid.color = "lightgray", grid.lty = "dotted", xaxis.labels = NULL, ...)
+  chart.TimeSeries(R, auto.grid = TRUE, xaxis = TRUE,
+    yaxis = TRUE, yaxis.right = FALSE, type = "l", lty = 1,
+    lwd = 2, main = NULL, ylab = NULL, xlab = "Date",
+    date.format.in = "\%Y-\%m-\%d", date.format = NULL,
+    xlim = NULL, ylim = NULL, element.color = "darkgray",
+    event.lines = NULL, event.labels = NULL,
+    period.areas = NULL, event.color = "darkgray",
+    period.color = "aliceblue", colorset = (1:12),
+    pch = (1:12), legend.loc = NULL, ylog = FALSE,
+    cex.axis = 0.8, cex.legend = 0.8, cex.lab = 1,
+    cex.labels = 0.8, cex.main = 1, major.ticks = "auto",
+    minor.ticks = TRUE, grid.color = "lightgray",
+    grid.lty = "dotted", xaxis.labels = NULL, ...)
 }
-%- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{R}{ an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns }
-  \item{auto.grid}{ if true, draws a grid aligned with the points on the x and y axes }
-  \item{grid.color}{ sets the color for the reference grid }
-  \item{grid.lty}{ defines the line type for the grid }
-  \item{xaxis}{ if true, draws the x axis }
-  \item{yaxis}{ if true, draws the y axis }
-  \item{yaxis.right}{ if true, draws the y axis on the right-hand side of the plot }
-  \item{type}{ set the chart type, same as in \code{\link{plot}} }
-  \item{lty}{ set the line type, same as in \code{\link{plot}} }
-  \item{lwd}{ set the line width, same as in \code{\link{plot}} }
-  \item{main}{ set the chart title, same as in \code{\link{plot}} }
-  \item{ylab}{ set the y-axis label, same as in \code{\link{plot}} }
-  \item{xlab}{ set the x-axis label, same as in \code{\link{plot}} }
-  \item{date.format}{ re-format the dates for the xaxis; the default is "\%m/\%y" }
-  \item{xlim}{ set the x-axis limit, same as in \code{\link{plot}} }
-  \item{ylim}{ set the y-axis limit, same as in \code{\link{plot}} }
-  \item{event.lines}{ If not null, vertical lines will be drawn to indicate that an event happened during that time period.  \code{event.lines} should be a list of dates (e.g., \code{c("09/03","05/06"))} formatted the same as date.format.  This function matches the re-formatted row names (dates) with the events.list, so to get a match the formatting needs to be correct. }
-  \item{event.labels}{ if not null and event.lines is not null, this will apply a list of text labels (e.g., \code{c("This Event", "That Event")} to the vertical lines drawn.  See the example below. }
-  \item{period.areas}{ these are shaded areas described by start and end dates in a vector of xts date rangees, e.g., \code{c("1926-10::1927-11","1929-08::1933-03")} See the examples below. }
-  \item{event.color}{ draws the event described in \code{event.labels} in the color specified }
-  \item{period.color}{ draws the shaded region described by \code{period.areas} in the color specified }
-  \item{colorset}{ color palette to use, set by default to rational choices }
-  \item{pch}{ symbols to use, see also \code{\link{plot}} }
-  \item{element.color}{ provides the color for drawing chart elements, such as the box lines, axis lines, etc. Default is "darkgray" } 
-  \item{legend.loc}{ places a legend into one of nine locations on the chart: bottomright, bottom, bottomleft, left, topleft, top, topright, right, or center. }
-  \item{ylog}{ TRUE/FALSE whether to set the y-axis to logarithmic scale, default FALSE }
-  \item{date.format.in}{ allows specification of other date formats in the data object, defaults to "\%Y-\%m-\%d" }
-  \item{cex.axis}{ The magnification to be used for axis annotation relative to the current setting of 'cex', same as in \code{\link{plot}}.  }
-  \item{cex.legend}{ The magnification to be used for sizing the legend relative to the current setting of 'cex'.  }
-  \item{cex.labels}{ The magnification to be used for event line labels relative to the current setting of 'cex'.  }
-  \item{cex.lab}{ The magnification to be used for x- and y-axis labels relative to the current setting of 'cex'.  }
-  \item{cex.main}{ The magnification to be used for the chart title relative to the current setting of 'cex'.  }
-  \item{major.ticks}{ Should major tickmarks be drawn and labeled, default 'auto'}
-  \item{minor.ticks}{ Should minor tickmarks be drawn, default TRUE}
-  \item{xaxis.labels}{ Allows for non-date labeling of date axes, default is NULL }
-  \item{\dots}{ any other passthru parameters }
+  \item{R}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of asset returns}
 
+  \item{auto.grid}{if true, draws a grid aligned with the
+  points on the x and y axes}
+
+  \item{grid.color}{sets the color for the reference grid}
+
+  \item{grid.lty}{defines the line type for the grid}
+
+  \item{xaxis}{if true, draws the x axis}
+
+  \item{yaxis}{if true, draws the y axis}
+
+  \item{yaxis.right}{if true, draws the y axis on the
+  right-hand side of the plot}
+
+  \item{type}{set the chart type, same as in
+  \code{\link{plot}}}
+
+  \item{lty}{set the line type, same as in
+  \code{\link{plot}}}
+
+  \item{lwd}{set the line width, same as in
+  \code{\link{plot}}}
+
+  \item{main}{set the chart title, same as in
+  \code{\link{plot}}}
+
+  \item{ylab}{set the y-axis label, same as in
+  \code{\link{plot}}}
+
+  \item{xlab}{set the x-axis label, same as in
+  \code{\link{plot}}}
+
+  \item{date.format}{re-format the dates for the xaxis; the
+  default is "\%m/\%y"}
+
+  \item{xlim}{set the x-axis limit, same as in
+  \code{\link{plot}}}
+
+  \item{ylim}{set the y-axis limit, same as in
+  \code{\link{plot}}}
+
+  \item{event.lines}{If not null, vertical lines will be
+  drawn to indicate that an event happened during that time
+  period.  \code{event.lines} should be a list of dates
+  (e.g., \code{c("09/03","05/06"))} formatted the same as
+  date.format.  This function matches the re-formatted row
+  names (dates) with the events.list, so to get a match the
+  formatting needs to be correct.}
+
+  \item{event.labels}{if not null and event.lines is not
+  null, this will apply a list of text labels (e.g.,
+  \code{c("This Event", "That Event")} to the vertical
+  lines drawn.  See the example below.}
+
+  \item{period.areas}{these are shaded areas described by
+  start and end dates in a vector of xts date rangees,
+  e.g., \code{c("1926-10::1927-11","1929-08::1933-03")} See
+  the examples below.}
+
+  \item{event.color}{draws the event described in
+  \code{event.labels} in the color specified}
+
+  \item{period.color}{draws the shaded region described by
+  \code{period.areas} in the color specified}
+
+  \item{colorset}{color palette to use, set by default to
+  rational choices}
+
+  \item{pch}{symbols to use, see also \code{\link{plot}}}
+
+  \item{element.color}{provides the color for drawing chart
+  elements, such as the box lines, axis lines, etc. Default
+  is "darkgray"}
+
+  \item{legend.loc}{places a legend into one of nine
+  locations on the chart: bottomright, bottom, bottomleft,
+  left, topleft, top, topright, right, or center.}
+
+  \item{ylog}{TRUE/FALSE set the y-axis to logarithmic
+  scale, similar to \code{\link{plot}}, default FALSE}
+
+  \item{date.format.in}{allows specification of other date
+  formats in the data object, defaults to "\%Y-\%m-\%d"}
+
+  \item{cex.axis}{The magnification to be used for axis
+  annotation relative to the current setting of 'cex', same
+  as in \code{\link{plot}}.}
+
+  \item{cex.legend}{The magnification to be used for sizing
+  the legend relative to the current setting of 'cex'.}
+
+  \item{cex.labels}{The magnification to be used for event
+  line labels relative to the current setting of 'cex'.}
+
+  \item{cex.lab}{The magnification to be used for x- and
+  y-axis labels relative to the current setting of 'cex'.}
+
+  \item{cex.main}{The magnification to be used for the
+  chart title relative to the current setting of 'cex'.}
+
+  \item{major.ticks}{Should major tickmarks be drawn and
+  labeled, default 'auto'}
+
+  \item{minor.ticks}{Should minor tickmarks be drawn,
+  default TRUE}
+
+  \item{xaxis.labels}{Allows for non-date labeling of date
+  axes, default is NULL}
+
+  \item{\dots}{any other passthru parameters}
 }
-\author{ Peter Carl }
-\seealso{ \code{\link{plot}}, \code{\link{par}}, \code{\link[xts]{axTicksByTime}} }
+\description{
+  Draws a line chart and labels the x-axis with the
+  appropriate dates.  This is really a "primitive", since
+  it extends the base \code{\link{plot}} and standardizes
+  the elements of a chart.  Adds attributes for shading
+  areas of the timeline or aligning vertical lines along
+  the timeline. This function is intended to be used inside
+  other charting functions.
+}
 \examples{
-
 # These are start and end dates, formatted as xts ranges.
 ## http://www.nber.org-cycles.html
 cycles.dates<-c("1857-06/1858-12",
@@ -112,11 +201,16 @@
 chart.TimeSeries(Return.cumulative)
 chart.TimeSeries(Return.cumulative, colorset = "darkblue", legend.loc = "bottomright", period.areas = cycles.dates, period.color = "lightblue", event.lines = risk.dates, event.labels = risk.labels, event.color = "red", lwd = 2)
 }
-% Add one or more standard keywords, see file 'KEYWORDS' in the
-% R documentation directory.
-\keyword{ ts }
-\keyword{ multivariate }
-\keyword{ distribution }
-\keyword{ models }
-\keyword{ hplot }
+\author{
+  Peter Carl
+}
+\seealso{
+  \code{\link{plot}}, \code{\link{par}},
+  \code{\link[xts]{axTicksByTime}}
+}
+\keyword{distribution}
+\keyword{hplot}
+\keyword{models}
+\keyword{multivariate}
+\keyword{ts}
 

Modified: pkg/PerformanceAnalytics/man/clean.boudt.Rd
===================================================================
--- pkg/PerformanceAnalytics/man/clean.boudt.Rd	2012-05-23 16:38:16 UTC (rev 1955)
+++ pkg/PerformanceAnalytics/man/clean.boudt.Rd	2012-05-23 17:50:05 UTC (rev 1956)
@@ -1,130 +1,147 @@
 \name{clean.boudt}
 \alias{clean.boudt}
-%\alias{Return.clean}
-
-\title{ clean extreme observations in a time series to to provide more robust risk estimates }
-\description{
-Robustly clean a time series to reduce the magnitude, but not the number or direction, of observations that exceed the \eqn{1-\alpha\%} risk threshold.
-}
+\title{clean extreme observations in a time series to to provide more robust risk
+estimates}
 \usage{
-clean.boudt(R, alpha = 0.01, trim = 0.001)
+  clean.boudt(R, alpha = 0.01, trim = 0.001)
 }
+\arguments{
+  \item{R}{an xts, vector, matrix, data frame, timeSeries
+  or zoo object of asset returns}
 
-\arguments{
-  \item{R}{ an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns }
-  \item{alpha}{ probability to filter at 1-alpha, defaults to .01 (99\%)}
-  \item{trim}{ where to set the "extremeness" of the Mahalanobis distance }
+  \item{alpha}{probability to filter at 1-alpha, defaults
+  to .01 (99\%)}
+
+  \item{trim}{where to set the "extremeness" of the
+  Mahalanobis distance}
 }
-
+\value{
+  cleaned data matrix
+}
+\description{
+  Robustly clean a time series to reduce the magnitude, but
+  not the number or direction, of observations that exceed
+  the \eqn{1-\alpha\%} risk threshold.
+}
 \details{
-Many risk measures are calculated by using the first
-two (four) moments of the asset or portfolio return distribution.
-Portfolio moments are extremely sensitive to data spikes, and this
-sensitivity is only exacerbated in a multivariate context.
-For this reason, it seems appropriate to
-consider estimates of the multivariate moments that are robust to
-return observations that deviate extremely from the Gaussian
-distribution.
+  Many risk measures are calculated by using the first two
+  (four) moments of the asset or portfolio return
+  distribution. Portfolio moments are extremely sensitive
+  to data spikes, and this sensitivity is only exacerbated
+  in a multivariate context. For this reason, it seems
+  appropriate to consider estimates of the multivariate
+  moments that are robust to return observations that
+  deviate extremely from the Gaussian distribution.
 
-There are two main approaches in defining robust
-alternatives to estimate the multivariate moments by their sample
-means (see e.g. Maronna[2006]). One approach is to
-consider a more robust estimator than the sample means. Another one
-is to first clean (in a robust way) the data and then take the
-sample means and moments of the cleaned data.
+  There are two main approaches in defining robust
+  alternatives to estimate the multivariate moments by
+  their sample means (see e.g. Maronna[2006]). One approach
+  is to consider a more robust estimator than the sample
+  means. Another one is to first clean (in a robust way)
+  the data and then take the sample means and moments of
+  the cleaned data.
 
-Our cleaning method follows the second approach. It
-is designed in such a way that, if we want to estimate downside risk
-with loss probability \eqn{\alpha}{alpha}, it will never clean observations
-that belong to the \eqn{1-\alpha}{(1-alpha)} least extreme observations. Suppose we
-have an \eqn{n}-dimensional vector time series of length \eqn{T}:
-\eqn{r_1,...,r_T}. We clean this time series in three steps.
+  Our cleaning method follows the second approach. It is
+  designed in such a way that, if we want to estimate
[TRUNCATED]

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


More information about the Returnanalytics-commits mailing list