Built-in prior distributions
- class midas.priors.BasePrior
- abstractmethod probability(**parameters_and_fields)
Calculate the prior log-probability.
- Parameters:
parameters_and_fields (ndarray) –
The parameter and field values requested via the
ParameterVectorandFieldRequestobjects stored inparametersandfieldsinstance variables.The names of the unpacked keyword arguments correspond to the
nameattribute of theParameterVectorandFieldRequestobjects, and their values will be passed as 1D arrays.- Returns:
The prior log-probability value.
- Return type:
float
- class midas.priors.GaussianPrior(name, mean, standard_deviation, field_request=None, parameter_vector=None)
Specify a Gaussian prior over either a series of field values, or a set of parameters.
- Parameters:
name (str) – The name used to identify the Gaussian prior
mean (ndarray) – The mean of the Gaussian prior corresponding to each parameter or requested field value.
standard_deviation (ndarray) – The standard deviation of the Gaussian prior corresponding to each parameter or requested field value.
field_request (FieldRequest) – A
FieldRequestspecifying the field and coordinates to which the Gaussian prior will be applied. If specified,field_requestwill override any values passed to theparameter_vectorarguments.parameter_vector (ParameterVector) – A
ParameterVectorspecifying which parameters to which the Gaussian prior will be applied.
- class midas.priors.GaussianProcessPrior(name, covariance=<inference.gp.covariance.SquaredExponential object>, mean=<inference.gp.mean.ConstantMean object>, field_request=None, parameter_vector=None, coordinates=None)
Specify a Gaussian process prior over either a series of field values, or a set of parameters and corresponding spatial coordinates.
- Parameters:
name (str) – The name used to identify the GP prior.
covariance (CovarianceFunction) – An instance of a
CovarianceFunctionclass from theinference-toolspackage.mean (MeanFunction) – An instance of a
MeanFunctionclass from theinference-toolspackage.field_request (FieldRequest) –
A
FieldRequestspecifying the field and coordinates which will be used to construct the GP prior. By default, the coordinates in the givenFieldRequestwill be used as the spatial coordinates for the GP, however these can be overridden by specifying thecoordinateskeyword argument. This enables the GP to use a different coordinate system from the one in which the field is being modelled if desired.If specified,
field_requestwill override any values passed to theparameter_vectorargument.parameter_vector (ParameterVector) – A
ParameterVectorspecifying which parameters will be used as inputs to the GP prior.coordinates (dict[str, ndarray]) – A set of coordinates (a dictionary mapping coordinate names as
strto coordinate values asnumpy.ndarray) corresponding the values specified by either thefield_requestorparameter_vectorkeyword arguments.
- class midas.priors.ExponentialPrior(name, mean, field_request=None, parameter_vector=None)
Specify an exponential prior over either a series of field values, or a set of parameters.
- Parameters:
name (str) – The name used to identify the exponential prior.
mean (ndarray) – The mean of the exponential prior corresponding to each parameter or requested field value.
field_request (FieldRequest) – A
FieldRequestspecifying the field and coordinates to which the exponential prior will be applied. If specified,field_requestwill override any values passed to theparameter_vectorarguments.parameter_vector (ParameterVector) – A
ParameterVectorspecifying which parameters to which the exponential prior will be applied.
- class midas.priors.BetaPrior(name, alpha, beta, field_request=None, parameter_vector=None, limits=(0, 1))
Specify a beta distribution prior over either a series of field values, or a set of parameters.
- Parameters:
name (str) – The name used to identify the exponential prior.
alpha (ndarray) – The ‘alpha’ shape parameter of the beta prior corresponding to each parameter or requested field value. All values of ‘alpha’ must be greater than zero.
beta (ndarray) – The ‘beta’ shape parameter of the beta prior corresponding to each parameter or requested field value. All values of ‘beta’ must be greater than zero.
field_request (FieldRequest) – A
FieldRequestspecifying the field and coordinates to which the exponential prior will be applied. If specified,field_requestwill override any values passed to theparameter_vectorarguments.parameter_vector (ParameterVector) – A
ParameterVectorspecifying which parameters to which the exponential prior will be applied.limits (tuple[float, float]) – A tuple of two floats specifying the range of values to which the prior is applied. The Beta distribution normally only supports values between 0 and 1, so the limits are used to re-scale values in the given range to [0, 1].