1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
\name{TimeSeriesPlots}
\alias{seriesPlot}
\alias{returnPlot}
\alias{cumulatedPlot}
\alias{drawdownPlot}
\title{Financial time series plots}
\description{
Produces an index/price, a cumulated return, a return, or a drawdown
plot.
}
\usage{
seriesPlot(x, labels = TRUE, type = "l", col = "steelblue",
title = TRUE, grid = TRUE, box = TRUE, rug = TRUE, \dots)
cumulatedPlot(x, index = 100, labels = TRUE, type = "l", col = "steelblue",
title = TRUE, grid = TRUE, box = TRUE, rug = TRUE, \dots)
returnPlot(x, labels = TRUE, type = "l", col = "steelblue",
title = TRUE, grid = TRUE, box = TRUE, rug = TRUE, \dots)
drawdownPlot(x, labels = TRUE, type = "l", col = "steelblue",
title = TRUE, grid = TRUE, box = TRUE, rug = TRUE, \dots)
}
\arguments{
\item{x}{
an object of class \code{"timeSeries"} or any other object which can
be transformed by \code{as.timeSeries} into an object of class
\code{"timeSeries"}.
}
\item{index}{
a numeric value, by default 100. Used by \code{cumulatedPlot} only.
The function cumulates column by column the returns and multiplies
the result with the index value: \code{index * exp(colCumsums(x))}.
}
\item{labels}{
a logical flag, should the plot be returned with default labels and
decorated in an automated way? By default \code{TRUE}.
}
\item{type}{
what type of plot should be drawn? By default we use a line plot,
\code{type = "l"}. An alternative plot style which produces nice
figures is for example \code{type = "h"}.
}
\item{col}{
the color for the series. In the univariate case use just a color
name like the default, \code{col = "steelblue"}, in the multivariate
case we recommend to select the colors from a color palette,
e.g. \code{col = heat.colors(ncol(x))}.
}
\item{title}{
a logical flag, by default TRUE. Should a default title added
to the plot?
}
\item{grid}{
a logical flag, should a grid be added to the plot? By default
\code{TRUE}.
}
\item{box}{
a logical flag, should a box be added to the plot? By default
\code{TRUE}.
}
\item{rug}{
a logical flag, by default TRUE. Should a rug representation of the
data added to the plot?
}
\item{\dots}{
optional arguments to be passed to \code{plot}.
}
}
\details{
The plot functions can be used to plot univariate and multivariate
time series of class \code{timeSeries}:
\tabular{ll}{
\code{seriesPlot} \tab Returns a tailored return series plot, \cr
\code{cumulatedPlot} \tab Displays a cumulated series given the returns, \cr
\code{returnPlot} \tab Displays returns given the cumulated series, \cr
\code{drawdownPlot} \tab Displays drawdowns given the return series.}
The graphical parameters \code{type} and \code{col} can be set by the
values specified through the argument list. In the case of multivariate
time series \code{col} can be specified by the values returned by
a color palette.
Automated titles including main title, x- and y-lables, grid lines,
box style and rug represenatations cann be selected by setting these
arguments to \code{TRUE} which is the default. If the title flag
is unset, then the main title, x-, and y-labels are empty strings.
This allows to set user defined labels with the function \code{title}
after the plot is drawn.
Beside \code{type}, \code{col}, \code{main}, \code{xlab} and
\code{ylab}, all other \code{par} arguments can be passed to the
\code{plot} function.
If the \code{labels} flag is unset to \code{FALSE}, then no
decorations will be added to the plot, and the plot can be fully
decorated by the user.
}
\value{
\code{NULL} (invisibly)
}
\seealso{
\code{\link{qqnormPlot}},
\code{\link{qqnigPlot}},
\code{\link{qqghtPlot}},
\code{\link{qqgldPlot}}
\code{\link{histPlot}},
\code{\link{densityPlot}},
\code{\link{logDensityPlot}}
\code{\link{boxPlot}},
\code{\link{boxPercentilePlot}}
\code{\link{acfPlot}},
\code{\link{pacfPlot}},
\code{\link{teffectPlot}},
\code{\link{lacfPlot}}
\code{\link{scalinglawPlot}}
\code{\link{returnSeriesGUI}}
}
\examples{
data(LPP2005REC, package = "timeSeries")
tS <- as.timeSeries(LPP2005REC)
seriesPlot(tS)
}
\keyword{hplot}
|