Learn R Programming

tidychangepoint (version 1.0.0)

diagnose: Diagnose the fit of a segmented time series

Description

Depending on the input, this function returns a diagnostic plot.

Usage

diagnose(x, ...)

# S3 method for mod_cpt diagnose(x, ...)

# S3 method for seg_basket diagnose(x, ...)

# S3 method for tidycpt diagnose(x, ...)

# S3 method for nhpp diagnose(x, ...)

Value

A ggplot2::ggplot() object

Arguments

x

A tidycpt object, or a model or segmenter

...

currently ignored

See Also

Other tidycpt-generics: as.model(), as.segmenter(), changepoints(), fitness(), model_name()

Examples

Run this code
# For meanshift models, show the distribution of the residuals by region
fit_meanshift_norm(CET, tau = 330) |>
  diagnose()
# \donttest{
# For Coen's algorithm, show the histogram of changepoint selections
x <- segment(DataCPSim, method = "coen", num_generations = 3)
x |>
  as.segmenter() |>
  diagnose()
# }

# Show various iterations of diagnostic plots
diagnose(segment(DataCPSim))
diagnose(segment(DataCPSim, method = "single-best"))
diagnose(segment(DataCPSim, method = "pelt"))

# Show diagnostic plots for test sets
diagnose(segment(test_set()))
diagnose(segment(test_set(n = 2, sd = 4), method = "pelt"))

# For NHPP models, show the growth in the number of exceedances
diagnose(fit_nhpp(DataCPSim, tau = 826))
diagnose(fit_nhpp(DataCPSim, tau = 826, threshold = 200))

Run the code above in your browser using DataLab