Fits an HGAM model

abr_fit.hgam(
  data,
  type = "t",
  bs_t = "tp",
  bs_s = "gp",
  bs_g = "re",
  k_t = 20,
  k_s = 20,
  k_g = NA,
  func = "gam",
  family = "gaussian",
  calc_breaks = FALSE,
  break_args = list(),
  ...
)

Arguments

data

Data frame used for fitting. Should be constructed by the abr_data function

type

The type of regime detection model. One of "t", "st","s", "gt", "gst","gs". "t" indicates a temporal smoother, "s" indicates a spatial smoother, and "g" indicates a grouped (HGAM) smoother

family

The family mgcv or brms will use to fit the model.

bs_t/bs_s/bs_g

basis types to be used for the temporal, spatial, and group-level smoothers

k_t/k_s/k_g

number of basis functions to use for temporal, spatial, and group-level smoothers

Value

A fitted object of class 'abrupt_model' and 'HGAM'.