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 ParameterVector and FieldRequest objects stored in parameters and fields instance variables.

The names of the unpacked keyword arguments correspond to the name attribute of the ParameterVector and FieldRequest objects, 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 FieldRequest specifying the field and coordinates to which the Gaussian prior will be applied. If specified, field_request will override any values passed to the parameter_vector arguments.

  • parameter_vector (ParameterVector) – A ParameterVector specifying 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 CovarianceFunction class from the inference-tools package.

  • mean (MeanFunction) – An instance of a MeanFunction class from the inference-tools package.

  • field_request (FieldRequest) –

    A FieldRequest specifying the field and coordinates which will be used to construct the GP prior. By default, the coordinates in the given FieldRequest will be used as the spatial coordinates for the GP, however these can be overridden by specifying the coordinates keyword 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_request will override any values passed to the parameter_vector argument.

  • parameter_vector (ParameterVector) – A ParameterVector specifying 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 str to coordinate values as numpy.ndarray) corresponding the values specified by either the field_request or parameter_vector keyword 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 FieldRequest specifying the field and coordinates to which the exponential prior will be applied. If specified, field_request will override any values passed to the parameter_vector arguments.

  • parameter_vector (ParameterVector) – A ParameterVector specifying 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 FieldRequest specifying the field and coordinates to which the exponential prior will be applied. If specified, field_request will override any values passed to the parameter_vector arguments.

  • parameter_vector (ParameterVector) – A ParameterVector specifying 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].