sample_coefs: Draw coefficients from their approximate posterior...

View source: R/model-helpers.R

sample_coefsR Documentation

Draw coefficients from their approximate posterior distribution

Description

Simulation based confidence intervals are calculated by drawing coefficient vectors from their asymptotic (posterior) distribution, a multivariate normal with mean get_coefs and covariance get_Vp. For scam models this means that draws are obtained on the scale of the re-parametrized (partially exponentiated) coefficients, i.e., based on the same normal approximation that underlies the reported standard errors of the model (the exact posterior of the constrained coefficients is not Gaussian, so individual draws may violate the shape constraints slightly).

Usage

sample_coefs(object, nsim, ...)

## Default S3 method:
sample_coefs(object, nsim, ...)

Arguments

object

A fitted model object.

nsim

Number of draws.

...

Further arguments passed to methods.

Value

A matrix with nsim rows, one coefficient vector per row, on the scale of the design matrix returned by make_X.


pammtools documentation built on Aug. 27, 2026, 1:08 a.m.