ecd.ts_lag_stats: Lag statistics on timeseries of log returns

View source: R/ecd-ts-lag-stats-method.R

ecd.ts_lag_statsR Documentation

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

## Not run: 
dji <- ecd.ts_lag_stats(ecd.data("dji"), 2)

## End(Not run)

ecd documentation built on May 10, 2022, 1:07 a.m.