View source: R/cptgaisl-class.R
| plot.cptgaisl | R Documentation |
This function visualizes a univariate time series along with the changepoints identified by a island model genetic algorithm, as represented by a 'cptgaisl' object. Vertical dashed lines mark changepoint locations, and segment means are shown as horizontal dashed lines. The optimal fitness value and changepoint locations are displayed as margin text.
## S3 method for class 'cptgaisl'
plot(
x,
data,
main = NULL,
XTickLab = NULL,
XTickPos = NULL,
XAxisLab = "Time",
YAxisLab = "Data",
cex.lab = 1.3,
cex.axis = 1.3,
cex.main = 1.3,
lwd = 2,
...
)
x |
An object of class |
data |
A numeric vector representing the observed univariate time series. |
main |
Optional main title for the plot. |
XTickLab |
Optional vector (e.g., numeric or date) for custom x-axis labels.
Must be the same length as |
XTickPos |
Optional vector specifying which elements of |
XAxisLab |
Optional label for the x-axis. Default is |
YAxisLab |
Optional label for the y-axis. Default is |
cex.lab |
Text size for axis labels and margin text. Default is |
cex.axis |
Text size for axis tick labels. Default is |
cex.main |
Text size for the main title. Default is |
lwd |
Line width for vertical and horizontal dashed lines. Default is |
... |
Additional graphical parameters passed to |
If XTickLab is supplied and matches the length of data, it is used for
the x-axis; otherwise, the default sequence 1:length(data) is used.
If the genetic algorithm was run with option = "both", the function skips hyperparameters
in the chromosome when extracting changepoint positions.
The plot displays vertical dashed lines at changepoint locations and horizontal dashed lines for the mean of each segment. Fitness and changepoint summaries are shown above the plot.
This function is called for its side effects and returns NULL invisibly.
summary, print.summary.cptgaisl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.