Skip to content

Usage

ref_spec(
family = ref_gaussian(),
location = ~1,
scale = ~1,
skew = ~1,
tail = ~1,
transform = "identity",
method = "REML",
use_bam = TRUE,
bam_min_n = 20000L,
control = list()
)

Specification of a distributional reference model

Argument Description
family A ref_family such as ref_gaussian() or ref_shash().
location, scale, skew, tail One-sided formulas for the additive
predictors. Unused shape formulas default to ~ 1.
transform Monotone response transform applied before fitting:
"identity" (the default), "sqrt", "log", or a Box-Cox power
$\lambda \ge 0$. The model is fitted to
$h_\lambda(y)=(y^\lambda-1)/\lambda$ ($\log y$ at
$\lambda=0$) and every predictive distribution is pushed back to
the response scale, so densities carry the log Jacobian and
quantiles, medians, hilo(), and CRPS are in the units of y. Any
transform other than the identity requires a positive outcome.
method mgcv smoothness-selection method.
use_bam Use mgcv::bam() when the family supports it and
n >= bam_min_n.
bam_min_n Minimum rows before bam() is considered.
control Extra engine controls (list).

An object of class ref_spec.

ref_spec(family = ref_gaussian(), location = ~ s(age, k = 8) + sex)
<ref_spec> gaussian via mgcv
location: ~s(age, k = 8) + sex
scale: ~1
ref_spec(family = ref_shash(), location = ~ s(age, k = 8), transform = "log")
<ref_spec> shash via mgcv
transform: log
location: ~s(age, k = 8)
scale: ~1
skew: ~1
tail: ~1