gam_shell: Shell gam object for building prediction matrices

gam_shellR Documentation

Shell gam object for building prediction matrices

Description

mgcv::predict.gam() with type = "lpmatrix" uses only the model frame, the terms objects, the factor levels and contrasts, and the smooth objects – all of which mgcv::gam(fit = FALSE) already produces. This wraps that unfitted setup in something predict.gam() accepts, so that a prediction matrix can be built without fitting anything.

Usage

gam_shell(G)

Arguments

G

Output of mgcv::gam() called with fit = FALSE

Details

The coefficients are set to zero. predict.gam() requires the slot to exist and to have the right length, but for type = "lpmatrix" it returns the design matrix itself and never multiplies by them.

Value

An object of class "gam", only usable for predict(type = "lpmatrix")


hmmTMB documentation built on Nov. 10, 2026, 5:09 p.m.