Skip to contents

cosinor_reg() is a parsnip friendly method for specification of cosinor regression model before fitting.

Usage

cosinor_reg(mode = "regression", period = NULL)

# S3 method for cosinor_reg
update(object, period = NULL, fresh = FALSE, ...)

# S3 method for cosinor_reg
print(x, ...)

Arguments

mode

A character string that describes the type of model. In this case, it only supports type of "regression".

period

A non-negative number or vector of numbers that represent the expected periodicity of the data to be analyzed.

object

Cosinor model specification

fresh

A logical for whether the arguments should be modified in place or replaced altogether

...

Extensible

x

Cosinor model specification

Examples

library(parsnip)
data(twins)
cosinor_reg(period = 24) %>%
  set_engine("card") %>%
  fit(rDYX ~ hour, data = twins)
#> Error in vctrs::vec_slice(encoding_info, encoding_info$mode == object$mode &     encoding_info$engine == object$engine): `x` must be a vector, not `NULL`.