math {timeSeries}R Documentation

Mathematical Time Series Operations

Description

Functions and methods dealing with mathematical 'timeSeries' operations.

Ops-method Group 'Ops' methods for a 'timeSeries' object
Math-method Group 'Math' methods for a 'timeSeries' object
Math2-method Group 'Math2' methods for a 'timeSeries' object
Summary-method Group 'Summary' methods for a 'timeSeries' object
diff Differences a 'timeSeries' object,
scale Centers and/or scales a 'timeSeries' object,
quantile Returns quantiles of an univariate 'timeSeries'.

Usage





## S4 method for signature 'timeSeries'
diff(x, lag = 1, diff = 1, trim = FALSE, pad = NA, ...)
## S4 method for signature 'timeSeries'
scale(x, center = TRUE, scale = TRUE)
## S4 method for signature 'timeSeries'
quantile(x, ...)

Arguments

center, scale

[scale] -
either a logical value or a numeric vector of length equal to the number of columns of x.

diff

an integer indicating the order of the difference. By default 1.

lag

an integer indicating which lag to use. By default 1.

pad

[diffSeries] -
which value should get the padded values? By default NA. Another choice often used would be zero.

trim

a logical value. By default TRUE, the first missing observation in the return series will be removed.

x

an object of class timeSeries.

...

arguments to be passed.

Value

returns the value from a mathematical or logical operation operating on objects of class timeSeries, or the value computed by a mathematical function.

Examples

## Create an Artificial timeSeries Object - 
   setRmetricsOptions(myFinCenter = "GMT")
   charvec = timeCalendar()
   set.seed(4711)
   data = matrix(exp(cumsum(rnorm(12, sd = 0.1))))
   TS = timeSeries(data, charvec, units = "TS")
   TS

## Mathematical Operations: | +/- * ^ ... - 
   TS^2
   TS[2:4]
   OR = returns(TS)
   OR
   OR > 0

[Package timeSeries version 2160.95 Index]