cumulated {timeSeries} | R Documentation |
Compute cumulated financial series, e.g. prices or indexes, from financial returns.
cumulated(x, ...) ## Default S3 method: cumulated(x, method = c("continuous", "discrete", "compound", "simple"), percentage = FALSE, ...)
method |
a character string naming the method how the returns were computed. |
percentage |
a logical value. By default FALSE , if TRUE the
series will be expressed in percentage changes.
|
x |
an object of class timeSeries .
|
... |
arguments to be passed. |
all functions return a time series object of the same class as
the input argument x
.
## data - # Microsoft Data: setRmetricsOptions(myFinCenter = "GMT") MSFT = as.timeSeries(data(msft.dat))[1:10, "Close"] MSFT ## cumulated - # Index series to 100: MSFT = 100 * MSFT/as.numeric(MSFT[1,1]) MSFT MSFT.RET = returns(MSFT, method = "discrete") cumulated(MSFT.RET, method = "discrete")