Learn R Programming

tidychangepoint (version 1.0.0)

model_args: Retrieve the arguments that a model-fitting function used

Description

Retrieve the arguments that a model-fitting function used

Usage

model_args(object, ...)

# S3 method for default model_args(object, ...)

# S3 method for seg_cpt model_args(object, ...)

# S3 method for ga model_args(object, ...)

# S3 method for cpt model_args(object, ...)

# S3 method for wbs model_args(object, ...)

Value

A named list of arguments, or NULL

Arguments

object

A segmenter object.

...

currently ignored

Details

Every model is fit by a model-fitting function, and these functions sometimes take arguments. model_args() recovers the arguments that were passed to the model fitting function when it was called. These are especially important when using a genetic algorithm.

See Also

Other model-fitting: fit_lmshift(), fit_meanshift(), fit_meanvar(), fit_nhpp(), model_name(), new_fun_cpt(), whomademe()

Other segmenter-functions: as.segmenter(), fitness(), seg_params()

Examples

Run this code
# Segment a time series using Coen's algorithm
x <- segment(CET, method = "ga-coen", maxiter = 3)

# Recover the arguments passed to the model-fitting function
x |>
  as.segmenter() |>
  model_args()
  

Run the code above in your browser using DataLab