plot_reg {ctsfeatures}R Documentation

Constructs the rate evolution graph for a categorical time series

Description

plot_reg constructs the rate evolution graph proposed by Ribler (1997).

Usage

plot_reg(
  series,
  title = "Rate evolution graph",
  linear_fit = FALSE,
  cat_res = NULL,
  ...
)

Arguments

series

An object of type tsibble (see R package tsibble), whose column named Value contains the values of the corresponding CTS. This column must be of class factor and its levels must be determined by the range of the CTS.

title

The title of the graph.

linear_fit

Logical. I TRUE, the corresponding least squares lines are incorporated to the graph

cat_res

If this parameter is set to any of the categories of the series, then the function returns a graph of residuals for the linear model associated with the corresponding category

...

Additional parameters for the function.

Details

Given a CTS of length T with range \mathcal{V}=\{1, 2, \ldots, r\}, \overline{X}_t=\{\overline{X}_1,\ldots, \overline{X}_T\}, and the corresponding binarized time series, \overline{\boldsymbol Y}_t=\{\overline{\boldsymbol Y}_1, \ldots, \overline{\boldsymbol Y}_T\}, the function constructs the rate evolution graph. Specifically, consider the series of cumulated sums given by \overline{\boldsymbol C}_t=\{\overline{\boldsymbol C}_1, \ldots, \overline{\boldsymbol C}_T\}, with \overline{\boldsymbol C}_k=\sum_{s=1}^{k}\overline{\boldsymbol Y}_s, k=1,\ldots,T. The rate evolution graph displays a standard time series plot for each one of the components of \overline{\boldsymbol C}_t simultaneously in one graph.

Value

The rate evolution graph.

Author(s)

Ángel López-Oriona, José A. Vilar

References

Ribler RL (1997). Visualizing categorical time series data with applications to computer and communications network traces. Ph.D. thesis, Virginia Polytechnic Institute and State University.

Examples

sequence_1 <- GeneticSequences[which(GeneticSequences$Series==1),]
reg <- plot_reg(sequence_1) # Constructing the rate
# evolution graph for the first time series in dataset GeneticSequences

[Package ctsfeatures version 1.2.2 Index]