# Segment a time series using PELT
x <- segment(CET, method = "pelt")
# Retrieve the model component
x |>
as.model()
# Explicitly convert the segmenter to a model
x |>
as.segmenter() |>
as.model()
# Is that model valid?
x |>
as.model() |>
is_model()
# Fit a model directly, without using [segment()]
x <- fit_nhpp(CET, tau = 330)
is_model(x)
Run the code above in your browser using DataLab