BetaLikelihood<T>

Models & Types · AiDotNet.GaussianProcesses

Beta Likelihood for Gaussian Processes with bounded outputs in [0, 1].

For Beginners

Standard GP regression assumes Gaussian noise: y ~ N(f(x), σ²) But what if your outputs are bounded between 0 and 1? (e.g., proportions, probabilities)

The Beta likelihood handles this:

  1. GP models a latent function f(x) (unbounded)
  2. Sigmoid transformation: μ = sigmoid(f) ∈ (0, 1)
  3. Beta distribution: y ~ Beta(μ × ν, (1-μ) × ν)

Where:

  • μ is the mean of the Beta (determined by sigmoid(f))
  • ν is the “precision” (higher = less variance)

This is useful for:

  • Modeling proportions (e.g., click-through rates)
  • Modeling probabilities
  • Any response bounded in [0, 1]

The Beta distribution naturally handles the bounded nature:

  • Values near 0 or 1 have appropriately skewed distributions
  • Variance is heteroscedastic (depends on mean)

Constructors

Constructor Summary
BetaLikelihood(double precision) Initializes a Beta Likelihood.

Properties

Property Summary
double Precision { get; } Gets the precision parameter.

Methods

Method Summary
BetaLikelihood<T> FromData(Vector<T> y) Creates a default Beta Likelihood with automatic precision estimation.
T LogLikelihood(Vector<T> y, Vector<T> f) Computes log-likelihood of observations given latent values.
ValueTuple<double, double> GetBetaParameters(double mu) Computes Beta parameters (α, β) from mean μ.
ValueTuple<double, double> PredictiveMoments(double fMean, double fVariance) Computes predictive mean and variance for a new point.
Vector<T> GetMeans(Vector<T> f) Transforms latent function values to Beta means via sigmoid.
Vector<T> LogLikelihoodGradient(Vector<T> y, Vector<T> f) Computes gradient of log-likelihood with respect to f.
Vector<T> LogLikelihoodHessianDiag(Vector<T> y, Vector<T> f) Computes Hessian (second derivative) of log-likelihood.
double Sample(double mu, Random random) Samples from the Beta distribution given mean.