hell yeah

A new release of the mgcv #RStats 📦 is out on CRAN and Simon Wood (U Edinburgh) has added some significant new features despite the small bump in version number:

🌟 scasm() for estimating GAMs with shape constrained smooths. Can be used with any family & smoothness selection is via the EFS method

Model is:

b3 <- scasm(
  y ~ s(x0, bs = "bs", k= k) + s(x1, bs = "sc", xt = "m+", k = k) +
         s(x2, bs = "bs", k = k) + s(x3, bs = "bs", k = k),
  family=poisson, bs=200
)

The second smooth `s(x1) is a shape constrained smooth with a positive monotonicity constraint (xt = "m+").

The `bs = 200` arguments uses 200 boostrap samples, which generates bootstrap distributions for each coefficient in the model. These bootstrap samples respect the shape constraints, while the usual +/- 2 SE credible intervals may not.

The uncertainty in the partial effects is shown by two credible interval bands; a dark blue central band is a 68% Bayesian credible interval, while the lighter blue outer interval is a 95% Bayesian credible interval.

The background of each panel is light grey with white grid lines, in a similar style to ggplot2's default theme.

Replies