GaussianLikelihood

class pmrf.stats.GaussianLikelihood(noise: Param | Callable[[Array], Array], *, name: str | None = None, metadata: Any = None)

Bases: AbstractLikelihood

Gaussian likelihood with independent noise.

Maps measurement noise to a normal distribution over frequency. The noise model is responsibile for returning the measurement variance.

Given an input y of shape (*batch_shape, event_dims), the noise model must accept accept the prediction y and return an array that is either broadcastable to (*batch_shape) or to the full (*batch_shape, event_dims).

Parameters:

noise (Param | Callable[[jnp.ndarray], jnp.ndarray]) – A parameter or callable that evaluates to the measurement variance. The callable accepts the mean prediction as an argument and outputs the variance, and can be a function or a callable PyTree with additional parameters.

__call__(y_event: Array | AbstractDistribution) → AbstractDistribution

Evaluate the likelihood given model predictions.

Parameters:

y_event (jnp.ndarray | AbstractDistribution) – The model prediction or predictive distribution in event space.

Returns:

The probability distribution over the observed data.

Return type:

AbstractDistribution

variance(y_event: Array) → Array

Return the noise variance over the batch shape, requiring it to be constant along the event axis.

Orthogonal GP discrepancy requires this, so that the tangent covariance block is sigma^2 I. The variance is interpreted as in __call__().

Returns:

The variance, broadcastable to the non-event batch shape of y_event.

Return type:

jnp.ndarray

Raises:

ValueError – If the variance varies along the event axis.

noise: Param | Callable[[Array], Array]

The noise parameter or a callable returning the measurement variance.