Skip to contents

Draw the coefficients of a fit from their Gaussian sampling approximation (mean = estimate, covariance = vcov; a fit without a finite covariance matrix is refused) and return them, with provenance, as a sest_manifest.

Usage

as_sest_manifest(
  fit,
  n_draws = 200L,
  times = NULL,
  newdata = NULL,
  seed = NULL
)

Arguments

fit

A sest_fit.

n_draws

Integer number of draws (default 200L).

times

Optional numeric time grid for the survival outputs. NULL (default) emits a parameters-only manifest.

newdata

Optional single covariate profile (one row) for the survival outputs. Required for the per-draw survival ensemble.

seed

Optional integer RNG seed (recorded in the manifest). The caller's random-number state is restored.

Value

A sest_manifest object.

Details

When times and a single-profile newdata are given and the fit is parametric, spline or cure, the outputs slot carries a genuine per-draw survival ensemble: the draws come from the backend's own sampling distribution and each draw's survival is evaluated through the fitted distribution function, so params and outputs share the same draws. For a Cox-family or non-parametric fit a per-draw survival ensemble would also need the baseline-hazard uncertainty, so outputs instead holds the maximum-likelihood survival curve marked with draw = 0.

See also

sest_manifest for the returned class, survestimand() for the fit.

Examples

fit <- survestimand(survival::Surv(time, status) ~ age, survival::lung, method = "weibull")
m <- as_sest_manifest(fit, n_draws = 50L, seed = 1L)
nrow(m@params)
#> [1] 50