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
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_meanNegative 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_likelihoodNegative log-likelihood for a GP whose mean is parameterized by
model.meanandmodel.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_likelihoodNegative 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
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_meanis False, the expected signature isf(model, covparam, xi, zi). Whenparameterized_meanis True, the expected signature isf(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
dataloaderis provided. Use0to 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
gradientin 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)ordataloader.Internally, this function wraps
selection_criterioninto an adapter accepting either covariance parameters only or concatenated[meanparam, covparam]parameters.For array data it uses
gnp.DifferentiableSelectionCriterion. For loader data it usesgnp.BatchDifferentiableSelectionCriterion.The four returned callables are complementary.
evaluateandevaluate_pre_gradare used for optimizer value calls,gradientis used for optimizer gradient calls, andevaluate_no_gradis 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
boundsis None, construct local bounds aroundp0usingbounds_deltaand 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:
Builds SciPy options from method-specific defaults and user
method_options.Tracks full optimization history (parameter vectors and criterion values).
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=Falsein the result object.
Exception handling: criterion evaluation exceptions caused by linear-algebra failures are mapped to
+infinsidecriterion_with_historyso optimization can continue. Other exceptions are re-raised.Added fields in returned
OptimizeResult(wheninfo=True):history_params,history_criterion,initial_params,final_params,bounds,selection_criterion,total_time, andbest_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)whenparameterized_mean=Falsecriterion(model, meanparam, covparam, xi, zi)whenparameterized_mean=True.
xi (array_like, optional) – Dataset arrays. Must be provided together unless
dataloaderis used instead.zi (array_like, optional) – Dataset arrays. Must be provided together unless
dataloaderis used instead.dataloader (iterable, optional) – Dataloader alternative to
xi, zi. Must yield batches(xb, zb)compatible withcriterion.meanparam0 (array_like, optional) – Initial parameters in normalized space. If
covparam0is None,covparam_initial_guessis used when provided.covparam0 (array_like, optional) – Initial parameters in normalized space. If
covparam0is None,covparam_initial_guessis 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.0means one full pass over loader per criterion evaluation.>0means 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
covparam0whencovparam0is None. It must have signaturef(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)ordataloadermust be provided.Internally, this function constructs four complementary criterion callables from
make_selection_criterion_with_gradientrequired by optimization and diagnostics, then optimizes withautoselect_parameters.When
info=True, the returned diagnostics include optimization metadata (history, timing, parameters) and both callable criteria:selection_criterionandselection_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_rhocovparam = [log(sigma2), -log(rho_0), ..., -log(rho_{d-1})].sigma2_nu_rhocovparam = [log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})].constant_mean_with_mlOptimize one parameterized constant mean and the covariance parameters by maximum likelihood. The model must have
meantype == "parameterized".with_remlOptimize covariance parameters by minimizing the negative restricted log-likelihood.
with_remapOptimize covariance parameters by minimizing a negative restricted posterior criterion. REMAP methods use prior anchors such as
covparam0_prioror 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_rhocovariance 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_meanand 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_meanand 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
meanparam0orcovparam0is missing. It must have signaturef(model, xi, zi, dataloader)and return(meanparam0, covparam0). If None,anisotropic_parameters_initial_guess_constant_meanis 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_rhocovariance parameters with ML.The current
model.meanparamandmodel.covparamare used as optimizer initial values when available. Missing initial values are filled byselect_parameters_sigma2_rho_constant_mean_with_mlusinganisotropic_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_mlif 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_rhocovariance parameters with ML.The covariance parameter convention is
[log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})]. Missing initial values are computed withanisotropic_parameters_initial_guess_matern_constant_meanunlessparam_initial_guessis 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_rhocovariance parameters with ML.Current
model.meanparamandmodel.covparamare used as optimizer starts when available. Missing values are supplied byanisotropic_parameters_initial_guess_matern_constant_meanunlessparam_initial_guessis 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_rhocovariance 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_rhoanisotropic initial guess is used unlesscovparam_initial_guessis 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
covparam0whencovparam0is None. It must have signaturef(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_rhocovariance 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_rhocovariance parameters with REML.The covariance parameter convention is
[log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})]. Ifcovparam0is None, the continuous-Matérn anisotropic initial guess is used unlesscovparam_initial_guessis 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
covparam0when 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_rhocovariance parameters with REML.Current
model.covparamis used as optimizer start when available. Missing covariance parameters are initialized withanisotropic_parameters_initial_guess_maternunlesscovparam_initial_guessis 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_guessis 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
covparam0whencovparam0is 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_priororcovparam0_initis not provided.covparam0_prior (array_like, optional) – Covariance parameters used to define the prior center
prior_log_sigma2_0. If None,covparam_initial_guessis used when provided; otherwise the standard anisotropic initial guess is used.covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None,
covparam0is used when provided; otherwisecovparam_initial_guessis used when provided; otherwise the standard anisotropic initial guess is used.covparam_initial_guess (callable, optional) – Function used when
covparam0_priororcovparam0_initmust be computed. It must have signaturef(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_0used for prior calibration. If None, the default configured ingpmp.kernel.prior_defaultsis 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 ingpmp.kernel.prior_defaultsis 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_0is taken fromcovparam0_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,
covparam0is used when provided; otherwisemodel.covparamis used when available; otherwisecovparam_initial_guessis used when provided; otherwise the standard anisotropic initial guess is used.covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None, uses
covparam0when provided; otherwise falls back tomodel.covparamthencovparam_initial_guesswhen 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_0used for prior calibration. If None, the default configured ingpmp.kernel.prior_defaultsis 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 ingpmp.kernel.prior_defaultsis 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)andlogrho.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]andlogrho=-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érnlog(nu), need a prior criterion that treats those parameters separately.log p_{\sigma^2}is Gaussian inlog(sigma^2)and centered atprior_log_sigma2_0inferred fromcovparam0_prior(or overridden byprior_log_sigma2_0when provided). Its log-space standard deviation is calibrated fromprior_gammaandprior_sigma2_coverageso thatP(sigma2_0 / prior_gamma <= sigma^2 <= sigma2_0 * prior_gamma) = prior_sigma2_coverage.log p_{\rho}is a barrier + linear-tail prior inlogrho: componentwise support islogrho > prior_logrho_min, the minimum is atprior_logrho_0, andprior_alphacontrols the right-tail linear slope.When
prior_logrho_minis not provided, it is inferred from observation points by combining a minimum-gap bound and a range-based safeguard controlled byprior_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_priororcovparam0_initis not provided.covparam0_prior (array_like, optional) – Covariance parameters used to anchor prior hyperparameters. If None,
covparam_initial_guessis used when provided; otherwise the standard anisotropic initial guess is used.covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None,
covparam0is used when provided; otherwisecovparam_initial_guessis used when provided; otherwise the standard anisotropic initial guess is used.covparam_initial_guess (callable, optional) – Function used when
covparam0_priororcovparam0_initmust be computed. It must have signaturef(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_0used for prior calibration. If None, the default configured ingpmp.kernel.prior_defaultsis 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 ingpmp.kernel.prior_defaultsis used.prior_rho_min_range_factor (float, optional) – Safeguard factor used when
prior_logrho_minis inferred from data. It defines the range-based candidate lower boundlog(range(x[:, j]) * prior_rho_min_range_factor)is applied in addition to the minimum-gap bound. If None, the default configured ingpmp.kernel.prior_defaultsis used.prior_logrho_min (array_like, optional) – Lower bounds for
logrhoprior 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
logrhoprior. If None,-covparam0_prior[1:]is used.prior_alpha (float, optional) – Linear right-tail slope of the
logrhobarrier-linear prior. If None, the default configured ingpmp.kernel.prior_defaultsis 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
covparam0anchors prior hyperparameters by default. This behavior can be overridden by passingprior_log_sigma2_0and/orprior_logrho_0explicitly.If
prior_logrho_minis None, this function uses: -xiif provided, else -dataloader.dataset.x_list(when available). The inferred bound is the componentwise maximum of:log(min_nonzero_gap)andlog(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)andlogrho.- 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,
covparam0is used when provided; otherwisemodel.covparamis used when available; otherwisecovparam_initial_guessis used when provided; otherwise the standard anisotropic initial guess is used.covparam0_init (array_like, optional) – Initial covariance parameters for optimization. If None, uses
covparam0when provided; otherwise falls back tomodel.covparamthencovparam_initial_guesswhen 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 fromgpmp.kernel.prior_defaults.prior_sigma2_coverage – Prior hyperparameters forwarded to
select_parameters_sigma2_rho_with_remap_logsigma2_logrho_prior. Missing values are resolved fromgpmp.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 fromgpmp.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.