xtsoverlay: Aligns time series to a common overlap point (time zero).

Description Usage Arguments Value

Description

This function aligns two or more time series to a common overlap point denoted time zero. Thus, multiple time series of unrelated dates can be compared by overlapping and normalizing

Usage

1
xtsoverlay(data, timezero, offsets = c(-20, 100), norm = TRUE)

Arguments

data

The xts matrix data containing all time series to align. Each column corresponds to one time series that will be aligned based upon its associated time zero. Use function xtsbind to bind multiple xts matrices with different time indices.

timezero

A vector of dates denoting the time zero for each column in the data xts to align. Its length must equal the number of columns in the data xts.

offsets

A numeric vector of length 2 containing the negative and positive offsets with respect to timezero used to extract the data from the xts matrix.

norm

Logical. Specifies whether the curves are normalized at time zero.

Value

Returns a zoo matrix (Note: NOT xts) containing all the time series with numeric offsets instead of dates.


jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.