Provided Matérn container classes¶
gpmpcontrib.models provides configured ModelContainer subclasses. Each
container stores one independent gpmp.core.Model per output and builds a
gpmp.parameter.Param object from the selected raw vectors. The common
select_params, predict, run_diagnosis, and state-access contracts are
documented in Model containers.
Naming and covariance parameters¶
Maternp fixes the Matérn regularity at \(\nu=p+1/2\) and uses
[log(sigma2), -log(rho_0), ..., -log(rho_{d-1})]
Matern selects \(\nu\) and uses
[log(sigma2), log(nu), -log(rho_0), ..., -log(rho_{d-1})]
The corresponding Param paths are covparam/variance,
covparam/regularity, and covparam/lengthscale. Variance and regularity
use logarithmic normalization. Lengthscales use inverse-log normalization.
Constructor contracts¶
- class Model_ConstantMean_Maternp_ML(name, output_dim, covariance_specification=None)
Build
output_dimfixed-regularity Matérn models. Each output has one explicit constant-mean parameter. Mean and covariance parameters are selected by maximum likelihood.covariance_specificationmust contain{"p": int}unless a custom covariance function is supplied.
- class Model_ConstantMean_Maternp_REML(name, output_dim, mean_specification, covariance_specification)
Build fixed-regularity Matérn models with covariance parameters selected by restricted likelihood.
mean_specificationaccepts{"type": "constant"}or{"type": "linear"}.covariance_specificationmust contain{"p": int}unless a custom covariance function is supplied.
- class Model_ConstantMean_Matern_REML(name, output_dim, mean_specification, covariance_specification=None)
Build Matérn models whose variance, regularity, and componentwise lengthscales are selected by restricted likelihood. A
d-dimensional input givesd + 2covariance parameters.covariance_specificationis normally omitted; the class usesgp.kernel.matern_covarianceand its default numerical policy.The initial guess is computed by
gp.kernel.anisotropic_parameters_initial_guess_matern. Afterselect_params, usemodel[k].get_param()and path["covparam", "regularity"]to readlog(nu). Exponentiation gives the selected positive regularity.
- class Model_ConstantMean_Maternp_REMAP_logsigma2(name, output_dim, mean_specification, covariance_specification, gamma=None, sigma2_coverage=None)
Build fixed-regularity Matérn models selected by REMAP with a Gaussian prior on
log(sigma2). Missing hyperparameters are resolved fromgpmp.kernel.prior_defaultswhenselect_paramsbuilds the criterion.
- class Model_ConstantMean_Maternp_REMAP_logsigma2_and_logrho_prior(name, output_dim, mean_specification, covariance_specification, gamma=None, sigma2_coverage=None, alpha=None, rho_min_range_factor=None, logrho_min=None, covparam0_prior=None, logsigma2_0_prior=None, logrho_0_prior=None)
Build fixed-regularity Matérn models selected by REMAP with priors on
log(sigma2)andlogrho. Direct anchorslogsigma2_0_priorandlogrho_0_priortake priority overcovparam0_prior. Missing anchors are obtained from the anisotropic initial guess on the current observations.
- class Model_ConstantMean_Maternp_REMAP
Alias of
Model_ConstantMean_Maternp_REMAP_logsigma2_and_logrho_prior.
- class Model_Noisy_ConstantMean_Maternp_REML(name, output_dim, mean_specification, covariance_specification)
Build fixed-regularity Matérn models with known, point-dependent observation noise. The input matrix contains physical coordinates followed by one noise variance column per output. Prediction points use zero in these columns when prediction concerns the latent function.
Parameter adapters¶
Model_ConstantMean_Matern_REML.build_param_procedures accepts the optional
arguments logsigma2_bounds, lognu_bounds, loginvrho_bounds, and
name_prefix. It returns (param_from_vectors, vectors_from_param).
Bounds use the normalized coordinates stored in Param:
import gpmp.num as gnp
param_from_vectors, vectors_from_param = model.build_param_procedures(
0,
logsigma2_bounds=(-10.0, 10.0),
lognu_bounds=(-2.0, 4.0),
loginvrho_bounds=(-8.0, 8.0),
)
param = param_from_vectors(gnp.asarray([]), covparam)
The first callable accepts (meanparam, covparam) and returns a Param
object. The second accepts a Param object and returns
(meanparam, covparam).
Prior access¶
- Model_ConstantMean_Maternp_REMAP_logsigma2.set_prior(*, gamma=..., sigma2_coverage=..., covparam0_prior=..., logsigma2_0_prior=..., output_idx=None)
Update the supplied log-variance prior fields. Omitted fields remain unchanged.
output_idx=Noneapplies each update to every output.
- Model_ConstantMean_Maternp_REMAP_logsigma2_and_logrho_prior.set_prior(*, gamma=..., sigma2_coverage=..., alpha=..., rho_min_range_factor=..., logrho_min=..., covparam0_prior=..., logsigma2_0_prior=..., logrho_0_prior=..., output_idx=None)
Update the supplied log-variance and log-lengthscale prior fields. Omitted fields remain unchanged.
output_idx=Noneapplies each update to every output.covparam0_prioruses covariance coordinates[log(sigma2), -log(rho_0), ...].logrho_0_prioruseslogrhoand therefore has the opposite sign on lengthscale coordinates.
- get_prior(output_idx=None, resolved=True)
Return one resolved prior object or a list with one object per output.
resolved=TrueraisesValueErrorbefore data-dependent defaults have been resolved byselect_params.