NonConjugateModel#

class gpjax.gps.NonConjugateModel(prior, likelihood, latent=None)[source]#

Bases: JointModel[M, K, NGL]

A joint model with non-Gaussian likelihood.

Exact conditioning is intractable; the model instead carries a whitened latent vector \(w_x\) as a trainable parameter, and conditioning produces the approximate posterior implied by its current value. Markov chain Monte Carlo, variational inference, or MAP optimisation (via gpx.objectives.log_posterior_density) refine it.

The latent is sized by the training data, so it is initialised lazily on first contact with data — gpx.fit does this automatically, or call init_latent() explicitly.

Parameters:
condition(train_data)[source]#

Return the approximate posterior implied by the current latent.

A None latent conditions at the prior mean (zeros in whitened space).

Returns:

The conditioned process. Exposes the predictive

(via __call__) and log_posterior_density.

Return type:

LatentPosterior

Parameters:

train_data (Dataset)

init_latent(num_datapoints, key=jr.key(42))[source]#

Return a copy of this model with the latent vector initialised.

Parameters:
  • num_datapoints (int) – The number of training observations the latent must cover.

  • key (UInt32[jaxlib._jax.Array, '2'] | Key[jaxlib._jax.Array, '']) – The random seed for the initial values.

Return type:

NonConjugateModel[M, K, NGL]