math {timeSeries} | R Documentation |
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'. |
## 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, ...)
center, scale |
[scale] - |
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] - |
trim |
a logical value. By default |
x |
an object of class |
... |
arguments to be passed. |
returns the value from a mathematical or logical operation operating
on objects of class timeSeries
, or the value computed by a
mathematical function.
## 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