GPC
|
Methods
|
Compile a marginalized pymc model for the GP. |
|
Draw posterior samples at supplied points |
Attributes
- class gumbi.regression.GPC(dataset: DataSet, outputs=None, seed=2021)
Bases:
GP
- build_model(seed=None, continuous_kernel='ExpQuad', period=None, heteroskedastic_inputs=False, heteroskedastic_outputs=True, sparse=False, n_u=100, ARD=True)
Compile a marginalized pymc model for the GP.
Each dimension in
continuous_dims
is combined in an ExpQuad kernel with a principled \(\text{InverseGamma}\) prior for each lengthscale (as suggested by Michael Betancourt) and a \(\text{Gamma}\left(2, 1\right)\) prior for variance.- Parameters:
seed (int, optional.) – Random seed. If
None
,seed
is used.continuous_kernel ({'ExpQuad', 'Matern32', 'Matern52', 'Exponential', 'Cosine', or 'Periodic'}) – Covariance function to use for continuous dimensions. See pymc docs for more details.
period (ParameterArray, optional) – A single parray of length 1 with one layer for each continuous_dims by name containing the period of the kernel, if periodic-like kernel is used.
heteroskedastic_inputs (bool, default False) – Whether to allow heteroskedasticity along continuous dimensions (input-dependent noise).
heteroskedastic_outputs (bool, default True) – Whether to allow heteroskedasticity between multiple outputs (output-dependent noise). Not yet implemented.
sparse (bool, default False) – Whether to use a sparse approximation to the GP.
n_u (int, default 100) – Number of inducing points to use for the sparse approximation, if required.
ARD (bool, default True) – Whether to use “Automatic Relevance Determination” in the continuous kernel. If _True_, each continuous dimension receives its own lengthscale; otherwise a single lengthscale is used for all continuous dimensions.
- Returns:
self
- Return type:
- draw_point_samples(points, *args, source=None, output=None, var_name='posterior_samples', additive_level='total', increment_var=True, **kwargs)
Draw posterior samples at supplied points
- Parameters:
points (ParameterArray) – 1-D ParameterArray vector of coordinates for prediction, must have one layer per
self.dims
output (str or list of str, optional) – Variable for which to make predictions
source ({None, dict, az.data.inference_data.InferenceData}) – GP parameters for which to draw samples. Should be the result of
find_MAP()
,sample()
, or _None_.var_name (str, default "posterior_samples") – Name to assign new variable to contain conditional predictions.
additive_level (str, default "total") – Level of additive GP at which to make predictions.
increment_var (bool, default True) – Whether to append ‘_’ to the end of _var_name_ if it already exists in model.
- Returns:
samples – Samples as a ‘Parray’
- Return type:
parray