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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
|
\name{timeSeries-package}
\alias{timeSeries-package}
\docType{package}
\title{Utilities and Tools Package}
\description{
Package of time series tools and utilities.
}
\details{
\tabular{ll}{
Package: \tab timeSeries\cr
Type: \tab Package\cr
% Version: \tab 270.73.1\cr
% Date: \tab 2008\cr
% License: \tab GPL Version 2 or later\cr
% Copyright: \tab (c) 1999-2008 Diethelm Wuertz and Rmetrics Foundation\cr
URL: \tab \url{http://www.rmetrics.org}
}
}
\section{Overview of Topics:}{
1. S4 timeSeries Class Definition\cr
2. Creating timeSeries Objects\cr
3. Printing and Plotting timeSeries Objects\cr
4. Modifying 'timeSeries' Objects
}
\section{1. S4 timeSeries Class}{
\emph{timeSeries Class Definition}
'timeSeries' ...
\emph{Extracting Information from a timeSeries object:}
isUnivariate\cr
isMultivariate
}
\section{2. Creating timeSeries Objects}{
'timeSeries' objects can be created in several ways. One can create
them from scratch, or one can read them from a file. If we have a file
it is assumed that the first column holds a character string with the
date/time positions, named "charvec", and the remaining column(s),
depending if we consider the univariate or multivariate case the
numeric time series records named "data".
\emph{Create a 'timeSeries' object from scratch:}
\code{timeSeries}
\emph{Read a time Series from a file:}
\code{readSeries}
\emph{Attach a 'timeSeries' object to the search path:}
List of Functions:
\tabular{ll}{
\code{timeSeries} \tab Creates a 'timeSeries' from scratuch, \cr
\code{readSeries} \tab reads a time series from a file, \cr
\code{attach} \tab attaches a 'timeSeries' object, \cr
\code{detach} \tab detaches a 'timeSeries' object [see base package]. }
}
\section{3. Printing and Plotting 'timeSeries' Objects}{
List of Functions:
\tabular{ll}{
\code{print} \tab ..., \cr
\code{plot} \tab ..., \cr
\code{points} \tab ..., \cr
\code{lines} \tab ... .
}
}
\section{4. Modifying 'timeSeries' Objects}{
If we have a price/index series or a return series, it is often
required taht we have to convert from one to the other representation.
So Rmetrics makes functions available which compute \code{returns} from
price/index series or the \code{cumulated} series from returns. Further
modifications are concerned with drawdowns, durations, spreads and
midquotes.
List of Functions:
\tabular{ll}{
\code{returns} \tab Compute returns from prices or indexes, \cr
\code{cumulated} \tab compute cumulated series from a returns, \cr
\code{drawdowns} \tab compute series of drawdowns from financial returns,\cr
\code{durations} \tab compute durations from a financial time series,\cr
\code{spreads} \tab compute spreads from a price/index stream, \cr
\code{miquotes} \tab compute mid quotes from a price/index stream.
}
}
\section{Subsetting timeSeries Objects}{
'timeSeries' objects can subsetted in several ways. The method
\code{window} (and the deprecated function \code{cut}) extracts
the subset of a 'timeSeries' observed between the times \code{from}
and \code{to}. The methods \code{head} and \code{tail} return the
first or last part of a time series for a specified length.
The method \code{outlier} can be used to remove huge "outliers"
which may appear for example through the redefinition of an index
(it should not be used for outlier detection).
There are other functions provided which can be considered in broader
sense as subset functions. For example the function
\preformatted{
fapply(x, from, to, FUN, ...)
}
can be used to subset a time series with very complex rules, e.g.
subset Mondays from a series, subset the last Thursdays in every
Month, subset from a daily series open (first), high, low, close (last)
prices to a end-of-month time series, etc.
As another example, we mention the function \code{aggreagte} which
can data records subset to monthly or quarterly information with
information specified by the function \code{FUN}
\preformatted{
aggregate(x, by = c("monthly", "quarterly"), FUN = colMeans,
units = NULL, ...)
}
List of Functions:
\tabular{ll}{
\code{"["} \tab ..., \cr
\code{"[<-"} \tab ..., \cr
\code{window} \tab ..., \cr
\code{head} \tab ..., \cr
\code{tail} \tab ..., \cr
\code{outlier} \tab ..., \cr
\code{fapply} \tab ..., \cr
\code{aggreagte} \tab ... .
}
}
\section{Merging and Binding timeSeries Objects}{
List of Functions:
\tabular{ll}{
\code{merge} \tab merges ..., \cr
\code{rbind} \tab binds ..., \cr
\code{lag} \tab lags ... .
}
}
\section{Reordering the columns of timeSeries Objects}{
List of Functions:
\tabular{ll}{
\code{orderColnames} \tab ..., \cr
\code{sortColname} \tab ..., \cr
\code{sampleColnames} \tab ..., \cr
\code{statsColnames} \tab ..., \cr
\code{pcaColnames} \tab ..., \cr
\code{hclustColnames} \tab ... .
}
}
\section{Renaming column and rows of timeSeries Objects}{
List of Functions:
\tabular{ll}{
\code{dim} \tab ..., \cr
\code{dimnames} \tab ..., \cr
\code{colnames<-} \tab ..., \cr
\code{rownames<-} \tab ..., \cr
\code{is.array} \tab ...
}
}
\section{Mathematical Operations}{
List of Functions:
\tabular{ll}{
\code{Ops.timeSeries} \tab S3: Arith method for a 'timeSeries' object, \cr
\code{abs} \tab Returns absolute values of a 'timeSeries' object, \cr
\code{sqrt} \tab Returns square root of a 'timeSeries' object, \cr
\code{exp} \tab Returns the exponential values of a 'timeSeries' object, \cr
\code{log} \tab Returns the logarithm of a 'timeSeries' object, \cr
\code{sign} \tab Returns the signs of a 'timeSeries' object, \cr
\code{diff} \tab Differences a 'timeSeries' object, \cr
\code{scale} \tab Centers and/or scales a 'timeSeries' object, \cr
\code{quantile} \tab Returns quantiles of an univariate 'timeSeries'. }
}
\section{Handling Missing Data}{
List of Functions:
\tabular{ll}{
\code{na.omit} \tab Handles NAs in a timeSeries object, \cr
\code{removeNA} \tab removes NAs from a matrix object, \cr
\code{substituteNA} \tab substitutes NAs by zero, the column mean or median, \cr
\code{interpNA} \tab interpolates NAs using R's "approx" function. }
}
\section{Special Daily and Monthly Operations}{
Note, a daily time series is not necessarily a series which has only
position dates, rather it should mean that we have not more than one
record per day. The availability of daily data, e.g. end of day data,
is in real time usually at the same local time every working day, but
this may be influenced due to holidays or due to the fact that you
get the data from a financial center located in another time zone than
your own.
If all all these facts can be neglected and only date positions without
time information is relevant and we speak losely of "daily" data records.
It is also worth to note, that Rmetrics uses in this case by default
the ISO-8601 format "\%Y-\%m-\%d".
In the case of monthly data, it is important to note that Rmetrics
always expects the full date for the position vector and not only
the years ans monhts. ...
List of Functions:
\tabular{ll}{
\code{dummyDailySeries} \tab Creates a dummy daily 'timeSeries' object, \cr
\code{alignDailySeries} \tab Aligns a daily 'timeSeries' to new positions,\cr
\code{rollDailySeries} \tab Rolls daily a 'timeSeries' on a given period, \cr
\code{ohlcDailyPlot} \tab Plots open high low close bar chart, \cr
\code{countMonthlyRecords} \tab Returns a series with monthly counts of records, \cr
\code{isMonthly} \tab Decides if the series consists of monthly records, \cr
\code{rollMonthlyWindows} \tab Returns start and end dates for rolling time windows, \cr
\code{rollMonthlySeries} \tab Rolls monthly a 'timeSeries' on a given period. }
}
\section{Column and Row Statistics}{
List of Functions:
\tabular{ll}{
\code{colStats} \tab ..., \cr
\code{rowStats} \tab ... .
}
}
\section{Coercion of timeSeries Objects}{
List of Functions:
as\cr
is.timeSeries
as.timeSeries\cr
as.timeSeries.default\cr
as.timeSeries.numeric\cr
as.timeSeries.data.frame\cr
as.timeSeries.matrix\cr
as.timeSeries.ts\cr
as.timeSeries.character\cr
as.timeSeries.zoo
as.vector.timeSeries\cr
as.matrix.timeSeries\cr
as.data.frame.timeSeries\cr
as.ts.timeSeries
}
\keyword{package}
|