Skip to contents

This function creates a CmdStanModel object using the Stan model and functions from primarycensoreddist and optionally includes additional user-specified Stan files.

Usage

pcd_cmdstan_model(include_paths = primarycensoreddist::pcd_stan_path(), ...)

Arguments

include_paths

Character vector of paths to include for Stan compilation. Defaults to the result of pcd_stan_path().

...

Additional arguments passed to cmdstanr::cmdstan_model().

Value

A CmdStanModel object.

Details

The underlying Stan model (pcens_model.stan) supports various features:

  • Multiple probability distributions for modeling delays

  • Primary and secondary censoring

  • Truncation

  • Optional use of reduce_sum for improved performance (via within chain parallelism).

  • Flexible prior specifications

  • Optional computation of log-likelihood for model comparison

See also

Modelling wrappers for external fitting packages fitdistdoublecens(), pcd_as_cmdstan_data()

Examples

if (FALSE) { # \dontrun{
model <- pcd_cmdstan_model()
fit <- model$sample(data = stan_data)
} # }