gpmp.kernel module

The gpmp.kernel package provides the components used to define and select covariance parameters for gpmp.core.Model. The core model stores mean and covariance callables, then evaluates prediction, likelihood, leave-one-out, and sample-path computations. The kernel package supplies covariance functions, covariance-parameter initialization procedures, parameter-selection methods, empirical bounds, and prior terms.

Kernel functions operate on gpmp.num backend objects. They do not require gpmp.parameter objects. gpmp.parameter can be used separately to inspect or display parameter vectors.

Mathematical contract

For observations at points \(x_1,\ldots,x_n\), GPmp uses the decomposition

\[Z(x) = m(x) + Z_0(x), \qquad \operatorname{Cov}(Z_0(x), Z_0(y)) = k_\theta(x, y).\]

The gpmp.core.Model object stores the mean callable \(m\), the covariance callable \(k_\theta\), and their parameter vectors. It performs likelihood, prediction, leave-one-out, and sample-path computations for fixed parameter values. The gpmp.kernel package supplies covariance functions, initialization rules, selection objectives, SciPy-based selection methods, and prior terms used to choose \(\theta\).

Covariance-parameter conventions

GPmp uses named covariance-parameter conventions. These names appear in the parameter-selection methods and in the initialization procedures.

sigma2_rho

The covariance parameter vector is

covparam = [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].

This convention is used by anisotropic covariance functions parameterized by a variance and one lengthscale per coordinate, including fixed-regularity Matérn covariance functions and the squared-exponential covariance.

sigma2_nu_rho

The covariance parameter vector is

covparam = [log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})].

This convention is used by matern_covariance, where nu is the Matérn regularity.

Here sigma2 is the process variance and rho_j is the lengthscale in coordinate j. The stored lengthscale component is -log(rho_j). Some function arguments call this quantity loginvrho_j.

Data-source contract

The standard path is to pass explicit arrays xi and zi. In that case, xi has shape (n, d) and zi has shape (n,) or (n, 1). Some initialization and selection functions also accept a dataloader instead of xi and zi. Do not pass both arrays and a dataloader. Dataloaders are documented in gpmp.dataloader module.

Returned parameters use the active gpmp.num backend. Convert explicitly only when external code requires a NumPy array or Python scalar.

Parameter-selection contract

select_* functions run an optimizer and update the model parameters. They use an explicit initial vector when one is provided, otherwise they compute an initial vector from the corresponding initialization procedure.

update_* functions also run an optimizer and update the model parameters, but they use the current model.covparam as the optimizer start when it is available.

Selection functions return (model, info_ret). If info=False, info_ret is None. If info=True, info_ret contains the selected covparam, optimizer status, objective history, and callable criteria such as selection_criterion and selection_criterion_nograd.

API pages