prospect.models#
prospect.models#
prospect.models.priors#
priors.py – This module contains various objects to be used as priors. When called these return the ln-prior-probability, and they can also be used to construct prior transforms (for nested sampling) and can be sampled from.
- class prospect.models.priors.Prior(parnames=[], name='', **kwargs)#
Encapsulate the priors in an object. Each prior should have a distribution name and optional parameters specifying scale and location (e.g. min/max or mean/sigma). These can be aliased at instantiation using the
parnameskeyword. When called, the argument should be a variable and the object should return the ln-prior-probability of that value.ln_prior_prob = Prior(param=par)(value)
Should be able to sample from the prior, and to get the gradient of the prior at any variable value. Methods should also be avilable to give a useful plotting range and, if there are bounds, to return them.
- Parameters:
parnames (sequence of strings) – A list of names of the parameters, used to alias the intrinsic parameter names. This way different instances of the same Prior can have different parameter names, in case they are being fit for….
- params#
The values of the parameters describing the prior distribution.
- Type:
dictionary
- update(**kwargs)#
Update
self.paramsvalues using alias.
- sample(nsample=None, **kwargs)#
Draw a sample from the prior distribution.
- Parameters:
nsample – (optional) Unused
- unit_transform(x, **kwargs)#
Go from a value of the CDF (between 0 and 1) to the corresponding parameter value.
- Parameters:
x – A scalar or vector of same length as the Prior with values between zero and one corresponding to the value of the CDF.
- Returns theta:
The parameter value corresponding to the value of the CDF given by x.
- inverse_unit_transform(x, **kwargs)#
Go from the parameter value to the unit coordinate using the cdf.
- property loc#
This should be overridden.
- property scale#
This should be overridden.