bartz.testing.DGP¶
- class bartz.testing.DGP(x, y, z, mulin_shared, mulin_separate, mulin, muquad_shared, muquad_separate, muquad, mu, error_scale, params)[source]¶
Output of
gen_data/gen_data_from_params: sampled data and parameters.See
Paramsfor the definition of the generative model. The_sharedfields are thelambda_=1limit (common across components), the_separatefields are thelambda_=0limit (independent across components), and the plain names are the realized mix at the sampledparams.lambda_.- x: Float[Array, 'p n']¶
Predictors of shape (p, n), drawn i.i.d. from the standardized family
params.x_distr.
- y: Float[Array, 'k n'] | Float[Array, 'n']¶
Noisy outcomes of shape (k, n), or (n,) if
gen_datawas called withk=None.
- z: Float[Array, 'k n'] | Float[Array, 'n']¶
Latent outcomes (the
ZofParams) of shape (k, n), or (n,) ifgen_datawas called withk=None.yequalszfor continuous components and thresholds it at 0 for binary ones.
Shared linear mean of shape (n,).
- mulin_separate: Float[Array, 'k n'] | None¶
Separate linear mean of shape (k, n), rows independent.
Nonein univariate mode (k is None).
- mulin: Float[Array, 'k n'] | Float[Array, 'n']¶
Linear part of the latent mean of shape (k, n), or (n,) in univariate mode (
k is None, equal tomulin_shared).
Shared quadratic mean of shape (n,).
- muquad_separate: Float[Array, 'k n'] | None¶
Separate quadratic mean of shape (k, n), rows independent.
Nonein univariate mode (k is None).
- muquad: Float[Array, 'k n'] | Float[Array, 'n']¶
Quadratic part of the latent mean of shape (k, n), or (n,) in univariate mode (
k is None, equal tomuquad_shared).
- mu: Float[Array, 'k n'] | Float[Array, 'n']¶
Latent mean
mulin + muquad + params.offset[..., None]of shape (k, n), or (n,) in univariate mode (k is None).
- error_scale: Float[Array, 'n'] | Float[Array, 'k n'] | None¶
Per-datapoint error standard-deviation scale (the
WofParams), suitable as theerror_scaleargument ofbartz.mcmcstep.init. Shape (n,) forhet_shape='scalar', (k, n) for'vector',Nonewhen homoskedastic.
- quantize(max_bins=256)[source]¶
Quantize the predictors into the format expected by
bartz.mcmcstep.init.- Parameters:
max_bins (
int, default:256) – Maximum number of levels per predictor.- Returns:
QuantizedData– AQuantizedDatawith the quantized predictors,yandmax_split.