| tulpa_family | R Documentation |
Lightweight constructor for a tulpa_family object that exposes the
contract required by prior_predict() and tulpa_simulate(). Model
packages (tulpaRatio, tulpaObs) register richer families that also link to
C++ likelihoods; this helper is for tests and simple custom families that
only need simulation.
tulpa_family(
name,
simulate_fn,
process_names = "y",
extra_params = list(),
link_inv = NULL
)
## S3 method for class 'tulpa_family'
print(x, ...)
name |
Family name (character, length 1). |
simulate_fn |
|
process_names |
Character vector. Defaults to |
extra_params |
Named list of |
link_inv |
List of inverse-link functions per process; defaults to
identity for every process. tulpa passes the raw linear predictor to
|
x |
A |
... |
Ignored. |
A tulpa_family object.
fam <- tulpa_family(
name = "poisson",
simulate_fn = function(eta, params, n_obs, ...) {
rpois(n_obs, exp(eta[[1]]))
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.