Learn R Programming

ecd (version 0.9.2.4)

ecd.ts_lag_stats: Lag statistics on timeseries of log returns

Description

Lag statistics on log returns are added to the xts attributes. It takes a vector of lags and calculates the mean, stdev, var, skewness, and kurtosis for cumulative log returns of each lag. The data is stored as a list of vectors under lagstats attribute. Be aware this function uses multicore lapply.

Usage

ecd.ts_lag_stats(ts = "dji", lags, absolute = FALSE)

Arguments

ts

the xts object from sample data. The ts must have the logr column. If a string is given, it will be replaced with sample data of the symbol.

lags

a numeric vector of integers greater than 0.

absolute

logical, if TRUE, statistics calculated on absolute log returns. Default: FALSE.

Value

The xts object containing lagstats attribute

Examples

Run this code
# NOT RUN {
dji <- ecd.ts_lag_stats(ecd.data("dji"), 2)
# }

Run the code above in your browser using DataLab