Learn R Programming

qbrms (version 1.0.1)

generate_prior_predictive_samples: Generate prior predictive samples (compat wrapper) - FIXED

Description

Maintains the legacy API: returns a list with $prior_samples as a numeric matrix of size ndraws × nrow(data).

Generate samples from the prior predictive distribution for qbrms models. Returns an ndraws x nobs matrix for compatibility with qbrms structure.

Usage

generate_prior_predictive_samples(
  formula,
  data,
  family = gaussian(),
  prior = NULL,
  ndraws = 100,
  verbose = TRUE,
  ...
)

generate_prior_predictive_samples( formula, data, family = gaussian(), prior = NULL, ndraws = 100, verbose = TRUE, ... )

Value

A list with elements:

  • prior_samples – numeric matrix ndraws × n.

  • eta – numeric matrix n × ndraws of linear predictors.

  • coef_draws – numeric matrix ndraws × p of coefficient draws.

Matrix of prior predictive samples (ndraws x nrow(data))

Arguments

formula

Model formula

data

Data frame containing model variables

family

Model family specification

prior

Prior specifications (currently uses default priors)

ndraws

Number of draws from prior predictive distribution

verbose

Logical; print progress messages

...

Additional arguments (currently ignored)

Details

Uses simple default priors:

  • Intercept: Normal(0, 2.5)

  • Other coefficients: Normal(0, 1.0)

For families other than gaussian, binomial, and poisson, falls back to Gaussian-like sampling.