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

## 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")  

[Package timeSeries version 2100.83 Index]