gpmp.kernel parameter selection

Parameter-selection functions optimize covariance parameters for a gpmp.core.Model. They use gpmp.num arrays and update model.covparam. Functions that optimize a parameterized constant mean also update model.meanparam.

The selection functions operate on the model

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

The covariance matrix at observation points is denoted \(K_\theta\). For linear_predictor means, \(P\) denotes the mean design matrix and \(W\) denotes an orthonormal contrast matrix satisfying \(P^T W = 0\).

Likelihood objectives

The following functions return scalar objective values to minimize over covariance parameters.

negative_log_likelihood_zero_mean

Negative log-likelihood for a centered GP. With \(z \in \mathbb{R}^n\), the objective is

\[J_{\mathrm{ML},0}(\theta) = \frac{1}{2} \left( n \log(2\pi) + \log |K_\theta| + z^T K_\theta^{-1} z \right).\]
negative_log_likelihood

Negative log-likelihood for a GP whose mean is parameterized by model.mean and model.meanparam. If \(m_\beta=(m(x_1;\beta),\ldots,m(x_n;\beta))^T\), the quadratic term becomes

\[(z-m_\beta)^T K_\theta^{-1} (z-m_\beta).\]
negative_log_restricted_likelihood

Negative restricted log-likelihood. This criterion is used when the mean is a linear predictor with unknown coefficients. Instead of evaluating the likelihood of \(z\) after estimating these coefficients, REML evaluates the likelihood of contrasts that do not depend on them.

Let \(W\) be the orthonormal contrast matrix introduced above. Since \(P^T W = 0\), the vector \(W^T z\) removes the component of the observations explained by the columns of \(P\). Under the GP model, the contrast vector has covariance

\[G_\theta = W^T K_\theta W.\]

GPmp computes the negative log-likelihood of this \((n-q)\)-dimensional Gaussian vector:

\[J_{\mathrm{REML}}(\theta) = \frac{1}{2} \left( (n-q)\log(2\pi) + \log |W^T K_\theta W| + (W^T z)^T (W^T K_\theta W)^{-1} (W^T z) \right),\]

where \(q\) is the number of columns of \(P\). The term \(n-q\) is the number of independent contrasts left after removing the \(q\) mean degrees of freedom. This is the restricted likelihood interpretation used in REML and intrinsic / universal kriging; see Stein [13].

The associated generalized residual quadratic form can also be written \(z^T Q_\theta z\), with

\[Q_\theta = K_\theta^{-1} - K_\theta^{-1} P (P^T K_\theta^{-1} P)^{-1} P^T K_\theta^{-1}.\]

For REMAP methods, the optimized criterion is

\[J_{\mathrm{REMAP}}(\theta) = J_{\mathrm{REML}}(\theta) - \log \pi(\theta),\]

where \(\pi(\theta)\) is the prior or regularization term documented in gpmp.kernel priors. Petit et al. [9] compares ML, REML, and REMAP parameter-selection criteria in GP interpolation.

negative_log_likelihood_zero_mean

gpmp.kernel.negative_log_likelihood_zero_mean(model, covparam, xi, zi)[source]

Evaluate the negative log-likelihood for a zero-mean GP model.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • covparam (array_like) – Covariance parameter vector.

  • xi (array_like) – Observation points and observed values.

  • zi (array_like) – Observation points and observed values.

Returns:

Negative log-likelihood value.

Return type:

scalar

negative_log_likelihood

gpmp.kernel.negative_log_likelihood(model, meanparam, covparam, xi, zi)[source]

Evaluate the negative log-likelihood for a GP model with mean parameters.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • meanparam (array_like) – Mean-function parameter vector.

  • covparam (array_like) – Covariance parameter vector.

  • xi (array_like) – Observation points and observed values.

  • zi (array_like) – Observation points and observed values.

Returns:

Negative log-likelihood value.

Return type:

scalar

negative_log_restricted_likelihood

gpmp.kernel.negative_log_restricted_likelihood(model, covparam, xi, zi)[source]

Evaluate the negative restricted log-likelihood (REML criterion).

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • covparam (array_like) – Covariance parameter vector.

  • xi (array_like) – Observation points and observed values.

  • zi (array_like) – Observation points and observed values.

Returns:

Negative restricted log-likelihood value.

Return type:

scalar

Generic selection functions

Generic functions connect a scalar criterion to SciPy optimizers. They are the lowest-level public selection interface. They are useful when the criterion is not one of the named ML, REML, or REMAP procedures. They do not infer the covariance-parameter convention from the covariance callable. The caller must provide an initial covariance vector, or pass an initialization procedure matching the covariance convention.

make_selection_criterion_with_gradient builds four callables from a scalar criterion: value evaluation, value evaluation before a gradient call, gradient evaluation, and a no-gradient value evaluation.

autoselect_parameters minimizes a scalar criterion from an initial vector. select_parameters_with_criterion and update_parameters_with_criterion wrap this optimizer around a gpmp.core.Model.

make_selection_criterion_with_gradient

gpmp.kernel.make_selection_criterion_with_gradient(model, selection_criterion, xi=None, zi=None, dataloader=None, batches_per_eval=0, parameterized_mean=False, meanparam_len=1)[source]

Build criterion wrappers for value/gradient optimization and diagnostics.

Parameters:
  • model (gpmp.core.Model) – GP model instance passed to selection_criterion.

  • selection_criterion (callable) – Criterion function. When parameterized_mean is False, the expected signature is f(model, covparam, xi, zi). When parameterized_mean is True, the expected signature is f(model, meanparam, covparam, xi, zi).

  • xi (array_like, optional) – Observation arrays used for criterion evaluation.

  • zi (array_like, optional) – Observation arrays used for criterion evaluation.

  • dataloader (iterable, optional) – Dataloader used instead of xi, zi. Batches must be yielded as (xb, zb).

  • batches_per_eval (int, default=0) – Number of batches used per criterion call when dataloader is provided. Use 0 to iterate over the full loader at each evaluation. Use a positive value to evaluate exactly that many batches per call; the iterator cycles when needed.

  • parameterized_mean (bool, default=False) – Whether the criterion depends on explicit mean parameters.

  • meanparam_len (int, default=1) – Number of leading parameters in the optimization vector assigned to the mean model.

Returns:

  • evaluate (callable) – Value function with gradient-enabled behavior from backend wrapper.

  • evaluate_pre_grad (callable) – Value function intended to be called just before gradient in optimization loops.

  • evaluate_no_grad (callable) – Criterion evaluation function without gradient tracking.

  • gradient (callable) – Gradient function with respect to optimization parameters.

Notes

Exactly one data source must be provided: either observation arrays (xi, zi) or dataloader.

Internally, this function wraps selection_criterion into an adapter accepting either covariance parameters only or concatenated [meanparam, covparam] parameters.

For array data it uses gnp.DifferentiableSelectionCriterion. For loader data it uses gnp.BatchDifferentiableSelectionCriterion.

The four returned callables are complementary. evaluate and evaluate_pre_grad are used for optimizer value calls, gradient is used for optimizer gradient calls, and evaluate_no_grad is used for diagnostics and sampling paths where gradients are not required.

autoselect_parameters

gpmp.kernel.autoselect_parameters(p0, criterion, gradient, bounds=None, bounds_auto=True, bounds_delta=10.0, silent=True, info=False, method='SLSQP', method_options=None)[source]

Minimize a scalar selection criterion with SciPy.

Parameters:
  • p0 (array_like) – Initial parameter vector.

  • criterion (callable) – Objective function criterion(p) -> scalar.

  • gradient (callable) – Gradient function gradient(p) -> array_like.

  • bounds (sequence of tuple, optional) – Bounds passed to SciPy in normalized parameter space.

  • bounds_auto (bool, default=True) – If True and bounds is None, construct local bounds around p0 using bounds_delta and internal safety limits.

  • bounds_delta (float, default=10.0) – Half-width used for automatic local bounds.

  • silent (bool, default=True) – If False, enable solver output.

  • info (bool, default=False) – If True, return the full SciPy result object.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Additional options passed to SciPy minimize.

Returns:

  • p_opt (array_like) – Best parameter vector found.

  • info_ret (scipy.optimize.OptimizeResult or None) – Optimization diagnostics if info=True, else None.

Notes

Optimization wrapper behavior:

  1. Builds SciPy options from method-specific defaults and user method_options.

  2. Tracks full optimization history (parameter vectors and criterion values).

  3. If the final SciPy result is worse than the best visited point, replaces the returned solution by the best seen one and sets best_value_returned=False in the result object.

Exception handling: criterion evaluation exceptions caused by linear-algebra failures are mapped to +inf inside criterion_with_history so optimization can continue. Other exceptions are re-raised.

Added fields in returned OptimizeResult (when info=True): history_params, history_criterion, initial_params, final_params, bounds, selection_criterion, total_time, and best_value_returned.

select_parameters_with_criterion

gpmp.kernel.select_parameters_with_criterion(model, criterion, xi=None, zi=None, dataloader=None, meanparam0=None, covparam0=None, parameterized_mean=False, meanparam_len=1, info=False, verbosity=0, *, bounds=None, bounds_auto=True, bounds_delta=10.0, batches_per_eval=0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Optimize model parameters using a user-supplied selection criterion.

Parameters:
  • model (gpmp.core.Model) – GP model whose parameters are optimized.

  • criterion (callable) –

    Criterion minimized by SciPy.

    Expected signatures:

    • criterion(model, covparam, xi, zi) when parameterized_mean=False

    • criterion(model, meanparam, covparam, xi, zi) when parameterized_mean=True.

  • xi (array_like, optional) – Dataset arrays. Must be provided together unless dataloader is used instead.

  • zi (array_like, optional) – Dataset arrays. Must be provided together unless dataloader is used instead.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi. Must yield batches (xb, zb) compatible with criterion.

  • meanparam0 (array_like, optional) – Initial parameters in normalized space. If covparam0 is None, covparam_initial_guess is used when provided.

  • covparam0 (array_like, optional) – Initial parameters in normalized space. If covparam0 is None, covparam_initial_guess is used when provided.

  • parameterized_mean (bool, default False) – If True, optimize both mean and covariance parameters jointly using the concatenated vector [meanparam, covparam].

  • meanparam_len (int, default 1) – Number of leading entries in the concatenated vector corresponding to mean parameters.

  • info (bool, default False) – If True, return optimization diagnostics.

  • verbosity (int, default 0) – 0: silent, 1: short progress message, 2: SciPy solver output.

  • bounds – Bounds configuration in normalized parameter space, forwarded to autoselect_parameters.

  • bounds_auto – Bounds configuration in normalized parameter space, forwarded to autoselect_parameters.

  • bounds_delta – Bounds configuration in normalized parameter space, forwarded to autoselect_parameters.

  • batches_per_eval (int, default 0) – Number of loader batches per objective call when using dataloader. 0 means one full pass over loader per criterion evaluation. >0 means evaluate on exactly that many batches (with iterator cycling).

  • method (str, default "SLSQP") – Optimization method (“SLSQP” or “L-BFGS-B”).

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to compute covparam0 when covparam0 is None. It must have signature f(model, xi, zi, dataloader).

Returns:

  • model (gpmp.core.Model) – Model with updated parameters.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

Notes

Data source contract: exactly one of (xi, zi) or dataloader must be provided.

Internally, this function constructs four complementary criterion callables from make_selection_criterion_with_gradient required by optimization and diagnostics, then optimizes with autoselect_parameters.

When info=True, the returned diagnostics include optimization metadata (history, timing, parameters) and both callable criteria: selection_criterion and selection_criterion_nograd.

update_parameters_with_criterion

gpmp.kernel.update_parameters_with_criterion(model, criterion, xi=None, zi=None, dataloader=None, parameterized_mean=False, meanparam_len=1, info=False, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Update model parameters using current model parameters as initialization.

Parameters:
  • model (gpmp.core.Model) – GP model instance to update.

  • criterion (callable) – Selection criterion to minimize.

  • xi (array_like, optional) – Dataset arrays.

  • zi (array_like, optional) – Dataset arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • parameterized_mean (bool, default=False) – Whether mean parameters are optimized jointly.

  • meanparam_len (int, default=1) – Number of mean parameters in concatenated vectors.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to initialize missing covariance parameters. It must have signature f(model, xi, zi, dataloader).

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

Reading selection method names

Named methods are defined in gpmp.kernel.parameter_selection_methods and re-exported by gpmp.kernel. Their names state the covariance-parameter convention and the criterion.

Named methods bind three choices that must be consistent: the covariance parameter convention, the initialization procedure, and the objective function. They are the recommended entry points when using one of GPmp’s standard covariance conventions.

sigma2_rho

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

sigma2_nu_rho

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

constant_mean_with_ml

Optimize one parameterized constant mean and the covariance parameters by maximum likelihood. The model must have meantype == "parameterized".

with_reml

Optimize covariance parameters by minimizing the negative restricted log-likelihood.

with_remap

Optimize covariance parameters by minimizing a negative restricted posterior criterion. REMAP methods use prior anchors such as covparam0_prior or explicit prior centers.

For example, select_parameters_sigma2_rho_with_reml means: compute or use a sigma2_rho initial covariance vector, minimize the negative restricted log-likelihood, and store the selected covariance vector in model.covparam.

select_* methods use an explicit initial vector when provided. update_* methods use existing model parameters as the optimizer start when available.

Named ML methods

select_parameters_sigma2_rho_constant_mean_with_ml

gpmp.kernel.select_parameters_sigma2_rho_constant_mean_with_ml(model, xi=None, zi=None, dataloader=None, meanparam0=None, covparam0=None, info=False, verbosity=0, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, param_initial_guess=None)[source]

Select a constant mean and sigma2_rho covariance parameters with ML.

The covariance parameter convention is [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].

Parameters:
  • model (gpmp.core.Model) – GP model instance with a parameterized constant mean (model.meantype == "parameterized").

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • meanparam0 (array_like, optional) – Initial mean and covariance parameters in normalized space. If either is None, both are initialized with anisotropic_parameters_initial_guess_constant_mean and explicit values passed by the user are kept.

  • covparam0 (array_like, optional) – Initial mean and covariance parameters in normalized space. If either is None, both are initialized with anisotropic_parameters_initial_guess_constant_mean and explicit values passed by the user are kept.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • param_initial_guess (callable, optional) – Function used when meanparam0 or covparam0 is missing. It must have signature f(model, xi, zi, dataloader) and return (meanparam0, covparam0). If None, anisotropic_parameters_initial_guess_constant_mean is used.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

update_parameters_sigma2_rho_constant_mean_with_ml

gpmp.kernel.update_parameters_sigma2_rho_constant_mean_with_ml(model, xi=None, zi=None, dataloader=None, info=False, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, param_initial_guess=None)[source]

Update a constant mean and sigma2_rho covariance parameters with ML.

The current model.meanparam and model.covparam are used as optimizer initial values when available. Missing initial values are filled by select_parameters_sigma2_rho_constant_mean_with_ml using anisotropic_parameters_initial_guess_constant_mean.

Parameters:
  • model (gpmp.core.Model) – GP model instance with a parameterized constant mean (model.meantype == "parameterized").

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • param_initial_guess (callable, optional) – Function used by select_parameters_sigma2_rho_constant_mean_with_ml if current model parameters are missing.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

select_parameters_sigma2_nu_rho_constant_mean_with_ml

gpmp.kernel.select_parameters_sigma2_nu_rho_constant_mean_with_ml(model, xi=None, zi=None, dataloader=None, meanparam0=None, covparam0=None, info=False, verbosity=0, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, param_initial_guess=None)[source]

Select a constant mean and sigma2_nu_rho covariance parameters with ML.

The covariance parameter convention is [log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})]. Missing initial values are computed with anisotropic_parameters_initial_guess_matern_constant_mean unless param_initial_guess is provided.

Parameters:
  • model (gpmp.core.Model) – GP model instance with a parameterized constant mean (model.meantype == "parameterized").

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • meanparam0 (array_like, optional) – Initial mean and covariance parameters. If either is missing, the continuous-Matérn constant-mean initializer supplies the missing value.

  • covparam0 (array_like, optional) – Initial mean and covariance parameters. If either is missing, the continuous-Matérn constant-mean initializer supplies the missing value.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • param_initial_guess (callable, optional) – Function used to compute missing initial mean and covariance parameters. It must return (meanparam0, covparam0).

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

update_parameters_sigma2_nu_rho_constant_mean_with_ml

gpmp.kernel.update_parameters_sigma2_nu_rho_constant_mean_with_ml(model, xi=None, zi=None, dataloader=None, info=False, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, param_initial_guess=None)[source]

Update a constant mean and sigma2_nu_rho covariance parameters with ML.

Current model.meanparam and model.covparam are used as optimizer starts when available. Missing values are supplied by anisotropic_parameters_initial_guess_matern_constant_mean unless param_initial_guess is provided.

Parameters:
  • model (gpmp.core.Model) – GP model instance with a parameterized constant mean (model.meantype == "parameterized").

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • param_initial_guess (callable, optional) – Function used to compute missing initial values.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

Named REML methods

select_parameters_sigma2_rho_with_reml

gpmp.kernel.select_parameters_sigma2_rho_with_reml(model, xi=None, zi=None, dataloader=None, covparam0=None, info=False, verbosity=0, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Select sigma2_rho covariance parameters with REML.

The covariance parameter convention is [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Dataset arrays.

  • zi (array_like, optional) – Dataset arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Initial covariance parameters. If None, the standard sigma2_rho anisotropic initial guess is used unless covparam_initial_guess is provided.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to compute covparam0 when covparam0 is None. It must have signature f(model, xi, zi, dataloader).

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

update_parameters_sigma2_rho_with_reml

gpmp.kernel.update_parameters_sigma2_rho_with_reml(model, xi=None, zi=None, dataloader=None, info=False, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Update sigma2_rho covariance parameters with REML.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to initialize missing covariance parameters.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

select_parameters_sigma2_nu_rho_with_reml

gpmp.kernel.select_parameters_sigma2_nu_rho_with_reml(model, xi=None, zi=None, dataloader=None, covparam0=None, info=False, verbosity=0, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Select sigma2_nu_rho covariance parameters with REML.

The covariance parameter convention is [log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})]. If covparam0 is None, the continuous-Matérn anisotropic initial guess is used unless covparam_initial_guess is provided.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Initial covariance parameters.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to compute covparam0 when it is not provided.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

update_parameters_sigma2_nu_rho_with_reml

gpmp.kernel.update_parameters_sigma2_nu_rho_with_reml(model, xi=None, zi=None, dataloader=None, info=False, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Update sigma2_nu_rho covariance parameters with REML.

Current model.covparam is used as optimizer start when available. Missing covariance parameters are initialized with anisotropic_parameters_initial_guess_matern unless covparam_initial_guess is provided.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to initialize missing covariance parameters.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

Named REMAP methods

The current named REMAP methods use the sigma2_rho convention. They differ by the prior terms added to the restricted likelihood.

covparam0 is a shared fallback for the optimizer start and prior anchor. When those roles must differ, pass covparam0_init for the optimizer start and covparam0_prior for the prior anchor. For the log-variance and logrho REMAP method, explicit prior centers prior_log_sigma2_0 and prior_logrho_0 override the corresponding values derived from covparam0_prior.

select_parameters_sigma2_rho_with_remap_power_laws_prior

gpmp.kernel.select_parameters_sigma2_rho_with_remap_power_laws_prior(model, xi=None, zi=None, dataloader=None, covparam0=None, info=False, verbosity=0, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Select covariance parameters with REMAP and power-law prior.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Initial covariance parameters. If None, covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to compute covparam0 when covparam0 is None.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

update_parameters_sigma2_rho_with_remap_power_laws_prior

gpmp.kernel.update_parameters_sigma2_rho_with_remap_power_laws_prior(model, xi=None, zi=None, dataloader=None, info=False, *, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None, covparam_initial_guess=None)[source]

Update covariance parameters with REMAP and power-law prior.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

  • covparam_initial_guess (callable, optional) – Function used to initialize missing covariance parameters.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

select_parameters_sigma2_rho_with_remap_logsigma2_prior

gpmp.kernel.select_parameters_sigma2_rho_with_remap_logsigma2_prior(model, xi=None, zi=None, dataloader=None, covparam0=None, info=False, verbosity=0, *, covparam0_prior=None, prior_gamma=None, prior_sigma2_coverage=None, covparam0_init=None, covparam_initial_guess=None, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None)[source]

Select covariance parameters with REMAP and Gaussian prior on log(sigma^2).

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Shared fallback covariance parameters. Used when one of covparam0_prior or covparam0_init is not provided.

  • covparam0_prior (array_like, optional) – Covariance parameters used to define the prior center prior_log_sigma2_0. If None, covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None, covparam0 is used when provided; otherwise covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • covparam_initial_guess (callable, optional) – Function used when covparam0_prior or covparam0_init must be computed. It must have signature f(model, xi, zi, dataloader).

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • prior_gamma (float, optional) – Multiplicative factor around sigma2_0 used for prior calibration. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • prior_sigma2_coverage (float, optional) – Central Gaussian probability mass assigned to [sigma2_0 / prior_gamma, sigma2_0 * prior_gamma]. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

Notes

The Gaussian prior center prior_log_sigma2_0 is taken from covparam0_prior[0].

update_parameters_sigma2_rho_with_remap_logsigma2_prior

gpmp.kernel.update_parameters_sigma2_rho_with_remap_logsigma2_prior(model, xi=None, zi=None, dataloader=None, info=False, verbosity=0, *, covparam0=None, covparam0_prior=None, covparam0_init=None, covparam_initial_guess=None, prior_gamma=None, prior_sigma2_coverage=None, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None)[source]

Update covariance parameters with REMAP and Gaussian prior on log(sigma^2).

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Shared fallback covariance parameters. If provided without covparam0_prior, it is reused as prior anchor and a warning is emitted.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to the selector function.

  • covparam0_prior (array_like, optional) – Covariance parameters used to anchor prior hyperparameters. If None, covparam0 is used when provided; otherwise model.covparam is used when available; otherwise covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None, uses covparam0 when provided; otherwise falls back to model.covparam then covparam_initial_guess when provided, then the standard anisotropic initial guess.

  • covparam_initial_guess (callable, optional) – Function used when fallback covariance parameters must be computed.

  • prior_gamma (float, optional) – Multiplicative factor around sigma2_0 used for prior calibration. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • prior_sigma2_coverage (float, optional) – Central Gaussian probability mass assigned to [sigma2_0 / prior_gamma, sigma2_0 * prior_gamma]. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

select_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior

gpmp.kernel.select_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior(model, xi=None, zi=None, dataloader=None, covparam0=None, info=False, verbosity=0, *, covparam0_prior=None, prior_gamma=None, prior_sigma2_coverage=None, prior_rho_min_range_factor=None, prior_logrho_min=None, prior_log_sigma2_0=None, prior_logrho_0=None, prior_alpha=None, covparam0_init=None, covparam_initial_guess=None, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None)[source]

Select covariance parameters with REMAP and priors on log(sigma^2) and logrho.

The optimized objective is a regularized REML criterion:

\[J(\theta) = -\log p(z \mid x, \theta)_{\mathrm{REML}} - \log p_{\sigma^2}(\theta) - \log p_{\rho}(\theta),\]

where theta = covparam, log(sigma^2)=covparam[0] and logrho=-covparam[1:].

This criterion assumes the covariance parameter convention [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})]. Covariance models with additional parameters, such as continuous-Matérn log(nu), need a prior criterion that treats those parameters separately.

log p_{\sigma^2} is Gaussian in log(sigma^2) and centered at prior_log_sigma2_0 inferred from covparam0_prior (or overridden by prior_log_sigma2_0 when provided). Its log-space standard deviation is calibrated from prior_gamma and prior_sigma2_coverage so that P(sigma2_0 / prior_gamma <= sigma^2 <= sigma2_0 * prior_gamma) = prior_sigma2_coverage.

log p_{\rho} is a barrier + linear-tail prior in logrho: componentwise support is logrho > prior_logrho_min, the minimum is at prior_logrho_0, and prior_alpha controls the right-tail linear slope.

When prior_logrho_min is not provided, it is inferred from observation points by combining a minimum-gap bound and a range-based safeguard controlled by prior_rho_min_range_factor.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Shared fallback covariance parameters. Used when one of covparam0_prior or covparam0_init is not provided.

  • covparam0_prior (array_like, optional) – Covariance parameters used to anchor prior hyperparameters. If None, covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None, covparam0 is used when provided; otherwise covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • covparam_initial_guess (callable, optional) – Function used when covparam0_prior or covparam0_init must be computed. It must have signature f(model, xi, zi, dataloader).

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to generic criterion selection.

  • prior_gamma (float, optional) – Multiplicative factor around sigma2_0 used for prior calibration. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • prior_sigma2_coverage (float, optional) – Central Gaussian probability mass assigned to [sigma2_0 / prior_gamma, sigma2_0 * prior_gamma]. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • prior_rho_min_range_factor (float, optional) – Safeguard factor used when prior_logrho_min is inferred from data. It defines the range-based candidate lower bound log(range(x[:, j]) * prior_rho_min_range_factor) is applied in addition to the minimum-gap bound. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • prior_logrho_min (array_like, optional) – Lower bounds for logrho prior support.

  • prior_log_sigma2_0 (float, optional) – Override for the Gaussian prior center on log(sigma^2). If None, covparam0_prior[0] is used.

  • prior_logrho_0 (array_like, optional) – Override reference values for logrho prior. If None, -covparam0_prior[1:] is used.

  • prior_alpha (float, optional) – Linear right-tail slope of the logrho barrier-linear prior. If None, the default configured in gpmp.kernel.prior_defaults is used.

  • bounds – Bounds configuration in normalized parameter space.

  • bounds_auto – Bounds configuration in normalized parameter space.

  • bounds_delta – Bounds configuration in normalized parameter space.

  • method ({"SLSQP", "L-BFGS-B"}, default="SLSQP") – Optimization method.

  • method_options (dict, optional) – Extra options passed to SciPy minimize.

Returns:

  • model (gpmp.core.Model) – Updated model.

  • info_ret (dict | None) – Diagnostics dictionary if info=True, else None.

Notes

covparam0 anchors prior hyperparameters by default. This behavior can be overridden by passing prior_log_sigma2_0 and/or prior_logrho_0 explicitly.

If prior_logrho_min is None, this function uses: - xi if provided, else - dataloader.dataset.x_list (when available). The inferred bound is the componentwise maximum of: log(min_nonzero_gap) and log(range * prior_rho_min_range_factor).

update_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior

gpmp.kernel.update_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior(model, xi=None, zi=None, dataloader=None, info=False, verbosity=0, *, covparam0=None, covparam0_prior=None, covparam0_init=None, covparam_initial_guess=None, prior_gamma=None, prior_sigma2_coverage=None, prior_rho_min_range_factor=None, prior_logrho_min=None, prior_log_sigma2_0=None, prior_logrho_0=None, prior_alpha=None, bounds=None, bounds_auto=True, bounds_delta=10.0, method='SLSQP', method_options=None)[source]

Update covariance parameters with REMAP and priors on log(sigma^2) and logrho.

Parameters:
  • model (gpmp.core.Model) – GP model instance.

  • xi (array_like, optional) – Observation arrays.

  • zi (array_like, optional) – Observation arrays.

  • dataloader (iterable, optional) – Dataloader alternative to xi, zi.

  • covparam0 (array_like, optional) – Shared fallback covariance parameters. If provided without covparam0_prior, it is reused as prior anchor and a warning is emitted.

  • info (bool, default=False) – If True, return optimization diagnostics.

  • verbosity (int, default=0) – Verbosity level forwarded to the selector function.

  • covparam0_prior (array_like, optional) – Covariance parameters used to anchor prior hyperparameters. If None, covparam0 is used when provided; otherwise model.covparam is used when available; otherwise covparam_initial_guess is used when provided; otherwise the standard anisotropic initial guess is used.

  • covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None, uses covparam0 when provided; otherwise falls back to model.covparam then covparam_initial_guess when provided, then the standard anisotropic initial guess.

  • covparam_initial_guess (callable, optional) – Function used when fallback covariance parameters must be computed.

  • prior_gamma – Prior hyperparameters forwarded to select_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior. Missing values are resolved from gpmp.kernel.prior_defaults.

  • prior_sigma2_coverage – Prior hyperparameters forwarded to select_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior. Missing values are resolved from gpmp.kernel.prior_defaults.

  • prior_rho_min_range_factor – Prior hyperparameters forwarded to select_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior. Missing values are resolved from gpmp.kernel.prior_defaults.

  • prior_logrho_min – Optional prior overrides forwarded to the selector function.

  • prior_log_sigma2_0 – Optional prior overrides forwarded to the selector function.

  • prior_logrho_0 – Optional prior overrides forwarded to the selector function.

  • prior_alpha – Optional prior overrides forwarded to the selector function.

  • bounds – Optimization settings forwarded to the selector function.

  • bounds_auto – Optimization settings forwarded to the selector function.

  • bounds_delta – Optimization settings forwarded to the selector function.

  • method – Optimization settings forwarded to the selector function.

  • method_options – Optimization settings forwarded to the selector function.

Dataloader support

Several initialization and selection functions accept either explicit arrays or a dataloader. Arrays are the direct interface. Dataloaders are useful when the criterion is evaluated from batches of observations. A dataloader must provide batches compatible with gpmp.num and the selected criterion. See gpmp.dataloader module for the dataloader API.