Learn R Programming

ctsfeatures (version 1.2.2)

plot_reg: Constructs the rate evolution graph for a categorical time series

Description

plot_reg constructs the rate evolution graph proposed by ribler1997visualizing;textualctsfeatures.

Usage

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

Value

The rate evolution graph.

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.

Author

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

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.

References

ribler1997visualizingctsfeatures

Examples

Run this code
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

Run the code above in your browser using DataLab