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
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,
For a linear_predictor mean, the implemented restricted-likelihood start
uses the contrast quadratic form
For the parameterized constant-mean initializer, GPmp first computes the GLS constant mean
The initializer then uses the covariance-inverse quadratic form
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,
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_meanReturns only
covparam0for zero-mean models using thesigma2_rhoconvention.anisotropic_parameters_initial_guessReturns only
covparam0for models whose mean is handled by the core restricted-likelihood computations. The convention issigma2_rho.anisotropic_parameters_initial_guess_constant_meanReturns
(meanparam0, covparam0)for ML selection with a parameterized constant mean. The covariance convention issigma2_rho.anisotropic_parameters_initial_guess_maternReturns only
covparam0for continuous-regularity Matérn covariance. The convention issigma2_nu_rho.anisotropic_parameters_initial_guess_matern_constant_meanReturns
(meanparam0, covparam0)for ML selection with a parameterized constant mean and continuous-regularity Matérn covariance. The covariance convention issigma2_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
xiandzi.
- 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_jbe the range of the observation points in coordinatej. 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-axesrho_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
xiandzi.
- 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_jbe the range of the observation points in coordinatej. 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-axesrho_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
xiandzi.
- 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_jbe the range of the observation points in coordinatej. 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-axesrho_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
xiandzi.
- Returns:
covparam0 – Initial covariance parameter vector.
- Return type:
array_like, shape (d + 2,)
Notes
Let
delta_jbe the range of the observation points in coordinatej. 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_jequal 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, whered_eff = min(d, 20). For quasi-uniform points,his of ordern**(-1 / d)and the native-space Matérn interpolation rate isO(h**nu), henceO(n**(-nu / d)). This choice targets the raten**(-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
xiandzi.
- Returns:
meanparam0 (array_like, shape (1,)) – Initial constant mean parameter.
covparam0 (array_like, shape (d + 2,)) – Initial covariance parameter vector.
Notes
Let
delta_jbe the range of the observation points in coordinatej. 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_jequal 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, whered_eff = min(d, 20). For quasi-uniform points,his of ordern**(-1 / d)and the native-space Matérn interpolation rate isO(h**nu), henceO(n**(-nu / d)). This choice targets the raten**(-1/2)up to the maximum effective dimension.