Description Usage Arguments Details Value
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.
1 | periods_in_class(data, col = 1, retcol = "cum_periods")
|
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"). |
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.
A column added to the xts matrix data argument.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.