gpmp.kernel covariance-parameter initialization

Initialization procedures construct starting values for covariance-parameter selection. They return backend objects from gpmp.num and do not require gpmp.parameter objects.

The standard input is xi, zi. Some procedures also accept a dataloader when selection is performed batch by batch. The returned vector must match the covariance-parameter convention of the covariance function and selection method.

Notation

Let \(z=(z_1,\ldots,z_n)^T\) be the observation vector and let \(K_0\) be the covariance matrix obtained with preliminary variance \(\sigma^2=1\) and the initial lengthscales described below. For linear_predictor means, let \(P\) be the design matrix returned by the model mean callable and let \(W\) be an orthonormal contrast matrix with \(P^T W = 0\). The initialization formulas are heuristics used to define optimizer starting values; the selected parameters are obtained by the parameter-selection methods documented in gpmp.kernel parameter selection.

sigma2_rho initialization

The sigma2_rho initialization procedures target covariance functions with

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

Let delta_j be the range of the observation points in coordinate j. The initial lengthscales are

\[\rho_j = c_d \, \delta_j, \qquad c_d = \frac{\Gamma(d/2 + 1)^{1/d}}{\sqrt{\pi}}.\]

The constant c_d is chosen so that the anisotropic ellipsoid with semi-axes rho_j has the same volume as the axis-aligned bounding box of the observation points.

The variance component is initialized from the covariance inverse at these lengthscales.

For a zero-mean model,

\[\sigma_0^2 = \frac{1}{n} z^T K_0^{-1} z.\]

For a linear_predictor mean, the implemented restricted-likelihood start uses the contrast quadratic form

\[\sigma_0^2 = \frac{1}{n} (W^T z)^T (W^T K_0 W)^{-1} (W^T z).\]

For the parameterized constant-mean initializer, GPmp first computes the GLS constant mean

\[\mu_0 = \frac{\mathbf{1}^T K_0^{-1} z} {\mathbf{1}^T K_0^{-1} \mathbf{1}}.\]

The initializer then uses the covariance-inverse quadratic form

\[\sigma_0^2 = \frac{1}{n} z^T K_0^{-1} z.\]

This gives an optimizer start for joint ML over the constant mean and the covariance parameters. It is an initialization rule, not the final GLS residual variance estimate.

sigma2_nu_rho initialization

The sigma2_nu_rho initialization procedures target matern_covariance with

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

They use the same initial lengthscales as sigma2_rho and insert an initial Matérn regularity nu0 after the variance component. The default is nu0 = d_eff / 2, rounded to the nearest half-integer, where d_eff = min(d, 20).

More explicitly,

\[d_{\mathrm{eff}} = \min(d, 20), \qquad \nu_0 = \frac{1}{2} \operatorname{round}\!\left(2 \frac{d_{\mathrm{eff}}}{2}\right).\]

The half-integer rounding is compatible with the fixed-regularity Matérn family. The rationale is rate-based. For quasi-uniform points, the fill distance is of order \(n^{-1/d}\) and the native-space Matérn interpolation rate is of order \(h^\nu\), hence \(n^{-\nu/d}\). The default targets the rate \(n^{-1/2}\) up to the capped effective dimension.

Which initializer returns what

anisotropic_parameters_initial_guess_zero_mean

Returns only covparam0 for zero-mean models using the sigma2_rho convention.

anisotropic_parameters_initial_guess

Returns only covparam0 for models whose mean is handled by the core restricted-likelihood computations. The convention is sigma2_rho.

anisotropic_parameters_initial_guess_constant_mean

Returns (meanparam0, covparam0) for ML selection with a parameterized constant mean. The covariance convention is sigma2_rho.

anisotropic_parameters_initial_guess_matern

Returns only covparam0 for continuous-regularity Matérn covariance. The convention is sigma2_nu_rho.

anisotropic_parameters_initial_guess_matern_constant_mean

Returns (meanparam0, covparam0) for ML selection with a parameterized constant mean and continuous-regularity Matérn covariance. The covariance convention is sigma2_nu_rho.

Function reference

anisotropic_parameters_initial_guess_zero_mean

gpmp.kernel.anisotropic_parameters_initial_guess_zero_mean(model, xi=None, zi=None, dataloader=None)[source]

Anisotropic initialization with zero mean.

Parameters:
  • model (gpmp.core.Model) – Model used to evaluate the covariance norm.

  • xi (array_like, optional) – Observation points.

  • zi (array_like, optional) – Observations.

  • dataloader (object, optional) – Dataloader used instead of xi and zi.

Returns:

covparam0 – Initial covariance parameter vector [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].

Return type:

array_like, shape (d + 1,)

Notes

Let delta_j be the range of the observation points in coordinate j. The initial lengthscales are

\[\rho_j = c_d \, \delta_j, \qquad c_d = \frac{\Gamma(d/2 + 1)^{1/d}}{\sqrt{\pi}}.\]

This constant is chosen from the volume of the Euclidean unit ball. If B_d(rho) is the ellipsoid with semi-axes rho_j, then

\[|B_d(\rho)| = \frac{\pi^{d/2}}{\Gamma(d/2 + 1)} \prod_{j=1}^d \rho_j = \prod_{j=1}^d \delta_j.\]

Thus the initial anisotropic correlation ellipsoid has the same volume as the axis-aligned bounding box of the observation points.

anisotropic_parameters_initial_guess

gpmp.kernel.anisotropic_parameters_initial_guess(model, xi=None, zi=None, dataloader=None)[source]

Anisotropic covariance initialization for zero-mean models or REML-type criteria.

Parameters:
  • model (gpmp.core.Model) – Model used to evaluate the covariance norm.

  • xi (array_like, optional) – Observation points.

  • zi (array_like, optional) – Observations.

  • dataloader (object, optional) – Dataloader used instead of xi and zi.

Returns:

covparam0 – Initial covariance parameter vector [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].

Return type:

array_like, shape (d + 1,)

Notes

Let delta_j be the range of the observation points in coordinate j. The initial lengthscales are

\[\rho_j = c_d \, \delta_j, \qquad c_d = \frac{\Gamma(d/2 + 1)^{1/d}}{\sqrt{\pi}}.\]

This constant is chosen from the volume of the Euclidean unit ball. If B_d(rho) is the ellipsoid with semi-axes rho_j, then

\[|B_d(\rho)| = \frac{\pi^{d/2}}{\Gamma(d/2 + 1)} \prod_{j=1}^d \rho_j = \prod_{j=1}^d \delta_j.\]

Thus the initial anisotropic correlation ellipsoid has the same volume as the axis-aligned bounding box of the observation points.

anisotropic_parameters_initial_guess_constant_mean

gpmp.kernel.anisotropic_parameters_initial_guess_constant_mean(model, xi=None, zi=None, dataloader=None)[source]

Anisotropic initialization with parameterized constant mean.

Parameters:
  • model (gpmp.core.Model) – Model used to evaluate covariance inverses.

  • xi (array_like, optional) – Observation points.

  • zi (array_like, optional) – Observations.

  • dataloader (object, optional) – Dataloader used instead of xi and zi.

Returns:

  • meanparam0 (array_like, shape (1,)) – Initial constant mean parameter.

  • covparam0 (array_like, shape (d + 1,)) – Initial covariance parameter vector [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].

Notes

Let delta_j be the range of the observation points in coordinate j. The initial lengthscales are

\[\rho_j = c_d \, \delta_j, \qquad c_d = \frac{\Gamma(d/2 + 1)^{1/d}}{\sqrt{\pi}}.\]

This constant is chosen from the volume of the Euclidean unit ball. If B_d(rho) is the ellipsoid with semi-axes rho_j, then

\[|B_d(\rho)| = \frac{\pi^{d/2}}{\Gamma(d/2 + 1)} \prod_{j=1}^d \rho_j = \prod_{j=1}^d \delta_j.\]

Thus the initial anisotropic correlation ellipsoid has the same volume as the axis-aligned bounding box of the observation points.

anisotropic_parameters_initial_guess_matern

gpmp.kernel.anisotropic_parameters_initial_guess_matern(model, xi=None, zi=None, dataloader=None)[source]

Anisotropic initialization for continuous-Matérn covariance.

Parameters:
  • model (gpmp.core.Model) – Model using a continuous-Matérn covariance parameterized by [log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})].

  • xi (array_like, optional) – Observation points.

  • zi (array_like, optional) – Observations.

  • dataloader (object, optional) – Dataloader used instead of xi and zi.

Returns:

covparam0 – Initial covariance parameter vector.

Return type:

array_like, shape (d + 2,)

Notes

Let delta_j be the range of the observation points in coordinate j. The initial lengthscales are

\[\rho_j = c_d \, \delta_j, \qquad c_d = \frac{\Gamma(d/2 + 1)^{1/d}}{\sqrt{\pi}}.\]

This makes the volume of the anisotropic ellipsoid with semi-axes rho_j equal to the volume of the axis-aligned bounding box of the observation points.

The initial regularity is nu0 = d_eff / 2, rounded to the nearest half-integer value, where d_eff = min(d, 20). For quasi-uniform points, h is of order n**(-1 / d) and the native-space Matérn interpolation rate is O(h**nu), hence O(n**(-nu / d)). This choice targets the rate n**(-1/2) up to the maximum effective dimension.

anisotropic_parameters_initial_guess_matern_constant_mean

gpmp.kernel.anisotropic_parameters_initial_guess_matern_constant_mean(model, xi=None, zi=None, dataloader=None)[source]

Anisotropic initialization for continuous-Matérn covariance.

Parameters:
  • model (gpmp.core.Model) – Model using a continuous-Matérn covariance parameterized by [log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})].

  • xi (array_like, optional) – Observation points.

  • zi (array_like, optional) – Observations.

  • dataloader (object, optional) – Dataloader used instead of xi and zi.

Returns:

  • meanparam0 (array_like, shape (1,)) – Initial constant mean parameter.

  • covparam0 (array_like, shape (d + 2,)) – Initial covariance parameter vector.

Notes

Let delta_j be the range of the observation points in coordinate j. The initial lengthscales are

\[\rho_j = c_d \, \delta_j, \qquad c_d = \frac{\Gamma(d/2 + 1)^{1/d}}{\sqrt{\pi}}.\]

This makes the volume of the anisotropic ellipsoid with semi-axes rho_j equal to the volume of the axis-aligned bounding box of the observation points.

The initial regularity is nu0 = d_eff / 2, rounded to the nearest half-integer value, where d_eff = min(d, 20). For quasi-uniform points, h is of order n**(-1 / d) and the native-space Matérn interpolation rate is O(h**nu), hence O(n**(-nu / d)). This choice targets the rate n**(-1/2) up to the maximum effective dimension.