Description Usage Arguments Value Examples
This function is a flexible function that converts xts objects into cumulative wealth indices. It alllows the user to pass raw price or return series and also can handle FX data where inversion of the series is necessary before computing cumulative wealth. There is also a flag for controlling the removal of NA's in the data. Note that the default behavior for the function is to omit the first return datum. The function returns and xts object of the same length that was passed. This means that the first return is lost due to starting at 100 at the first date. To make full use of ALL of the return data, the return object would have to be expanded by -1 date value. This behavior is not supported.
1 |
x |
and xts object containing either raw price or return data. |
inv |
a flag that tells the function whether to invert the series before computing returns. Useful for FX data. |
ret |
a flag indicating whether return or price data has been passed to the function. Default is TRUE. |
na.rm |
a flag indicating whether NAs should be removed from the data before computing returns. Default is TRUE. |
an xts object starting at 100 and evolving as the arithmetic returns of x.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.