smoothbp_ss: Fit a smooth change-point model with spike-and-slab variable...

View source: R/smoothbp_ss.R

smoothbp_ssR Documentation

Fit a smooth change-point model with spike-and-slab variable selection

Description

Fit a smooth change-point model with spike-and-slab variable selection

Usage

smoothbp_ss(
  formula,
  b0 = ~1,
  b1 = ~1,
  deltas = list(~1),
  omega = list(~1),
  rho = list(~1),
  data,
  priors = smoothbp_priors(),
  spike = prior_spike_slab(),
  b1_spike = FALSE,
  hierarchical = NULL,
  chains = 4L,
  iter = 2000L,
  warmup = 1000L,
  seed = NULL,
  step_om = 0.3,
  step_rho = 0.3,
  target_accept = 0.9,
  cores = getOption("smoothbp.cores", 1L),
  reparameterise = c("none", "omega"),
  .verbose = TRUE
)

Arguments

formula

A two-sided formula.

b0

One-sided formula for b0.

b1

One-sided formula for b1.

deltas

List of formulas for slope changes.

omega

List of formulas for change-points. Can also contain fixed() values.

rho

List of formulas for sharpness. Can also contain fixed() values.

data

A data frame.

priors

A smoothbp_priors object.

spike

A prior_spike_slab() object.

b1_spike

Logical; should b1 coefficients be eligible for spike-and-slab?

hierarchical

Character vector specifying which parameters should be hierarchical. Currently only "omega" is supported.

chains

Number of chains.

iter

Total iterations.

warmup

Warmup iterations.

seed

Random seed.

step_om, step_rho, target_accept

HMC/MH tuning parameters.

cores

Number of CPU cores.

reparameterise

Character specifying the parameterisation for random change-points: "none" (centred) or "omega" (fully non-centred). Default is "none". Only used if random effects are present.

.verbose

Print progress.

Value

A smoothbp_fit object.


smoothbp documentation built on June 14, 2026, 9:06 a.m.