Assembles the block-diagonal penalty matrix S(lambda) from the smooth
terms of a fitted gamlss model whose submodels use penalised additive
terms (for example pb() P-spline terms). The result is suitable as the
penalty argument of bic_info().
Value
A block-diagonal penalty matrix of dimension
(M+m+p) x (M+m+p), block diagonal across the inflation, mean, and
precision coefficient groups.
Details
The function reads the smoothing structure stored by gamlss
for each parameter (mu, sigma, nu) and places the corresponding
penalty contributions on the diagonal blocks. Terms without a penalty
contribute a zero block, so a model with a mix of linear and smooth
terms is handled transparently. By construction the returned matrix is
block diagonal across the three coefficient groups, so it preserves the
separability required by the semiparametric theory.