rxmc.model_comparison.predictive_draws#

rxmc.model_comparison.predictive_draws(constraint, model_samples, cov_samples=None, *, n_rep: int = 1, rng=None, model_only: bool = False) → ndarray[source]#

Posterior-predictive draws on the constraint’s active points.

For each posterior row theta_i the constraint gives ym_i and Sigma_i; n_rep draws ym_i + L_i z (z ~ N(0, I)) are taken. With model_only=True the rows are ym_i (the model-only predictive, no error-model noise).

Parameters:
  • constraint (Constraint) – The constraint whose predictive is wanted (its active points).

  • model_samples (array_like, shape (n, n_model_params)) – Posterior samples of the physical-model parameters (a 1-D array is one sample).

  • cov_samples (array_like, shape (n, constraint.n_params), optional) – Matching samples of the constraint’s parameters (required when the constraint has any).

  • n_rep (int, optional) – Draws per posterior row (ignored when model_only).

  • rng (numpy.random.Generator, optional) – Source of the standard-normal draws; a fresh default generator when omitted.

  • model_only (bool, optional) – Return the predictions ym_i themselves instead of draws around them (no covariance is assembled).

Returns:

np.ndarray – Draws in the observations’ comparison space: shape (n * n_rep, n_data_pts), or (n, n_data_pts) when model_only.