cumulated {timeSeries}R Documentation

Cumulated Time Series from Returns

Description

Compute cumulated financial series, e.g. prices or indexes, from financial returns.

Usage

cumulated(x, ...)

## Default S3 method:
cumulated(x, method = c("continuous", "discrete", 
    "compound", "simple"), percentage = FALSE, ...)

Arguments

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.

Value

all functions return a time series object of the same class as the input argument x.

Examples

## Load Microsoft Data - 
   data(MSFT)
   setRmetricsOptions(myFinCenter = "GMT")
   MSFT <- MSFT[1:10, "Close"]
   MSFT

## Discrete Return Series  - 
   MSFT = 100 * MSFT/as.numeric(MSFT[1, 1])
   MSFT.RET = returns(MSFT, method = "discrete")
   MSFT.RET
   
## Cumulative Series, Indexed to 100 - 
   cumulated(MSFT.RET, method = "discrete") 

[Package timeSeries version 2110.87 Index]