periods_in_class: Cumulatively counts the periods since the latest prediction

Description Usage Arguments Details Value

Description

This function computes the cumulative number of periods since the last prediction (or transition). For instance, a market timer is a form of binary classifier and when applied to the timer series, this function will return the number of periods since it last changed value.

Usage

1
periods_in_class(data, col = 1, retcol = "cum_periods")

Arguments

data

The xts matrix data containing the classifier's results column (e.g. market timer).

col

The number or name of the column containing the classification information.

retcol

The name of the column containing the cumulative count results (default is "cum_count").

Details

The return value is in the form of a column added to the xts matrix passed as the data argument. The added column contains the cumulative period count since the last observed transition in the specified predictor column.

Value

A column added to the xts matrix data argument.


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