pmrf.fitting.NumPyroNSFitter

class pmrf.fitting.NumPyroNSFitter(model, *, likelihood_kind=None, likelihood_params=None, feature_sigmas=None, **kwargs)[source]

Bases: NumPyroFitter

NumPyro NS: Nested sampling using numpyro.contrib.nested_sampling.NestedSampler.

Parameters:
  • model (Model)

  • likelihood_kind (str | None)

  • likelihood_params (dict[str, Parameter])

  • feature_sigmas (list[str] | None)

__init__(model, *, likelihood_kind=None, likelihood_params=None, feature_sigmas=None, **kwargs)

Initializes the BayesianFitter.

Parameters:
  • model (Model) – The parametric pmrf model to be fitted.

  • likelihood_kind (str, optional) – The kind of likelihood to use. Can be either ‘gaussian’ or ‘multivariate_gaussian’. Defaults internally to ‘gaussian’ for one-port fits, and ‘multivariate_gaussian’ for greater port fits. For ‘gaussian’, a single likelihood parameter, ‘sigma’, is needed. For ‘multivariate_gaussian’, either multiple standard deviations ‘sigma_0’, ‘sigma_1’, …, ‘sigma_N’ may be passed, where N is the number of features, or an arbitrary number of arbitrarily named likelihood parameters may be passed, along with a list of strings feature_sigmas of size N containing the names of the likelihood parameters to use for each feature.

  • likelihood_params (dict[str, Parameter], optional) – A dictionary of likelihood parameters to use for the likelihood function.

  • feature_sigmas (list[str], optional) – A list of sigma names for each feature. Only used when likelihood_kind is ‘multivariate_gaussian’.

  • **kwargs – Additional arguments forwarded to BaseFitter.

Return type:

None

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(model, *[, likelihood_kind, ...])

Initializes the BayesianFitter.

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_create_context(measured, *[, ...])

Create a BayesianContext for the fitting process.

_run_algorithm(ctx, *[, constructor_kwargs, ...])

Executes the Nested Sampling run.

_run_context(ctx[, plot_params, ...])

Execute the Bayesian fitting process within a context

fit(measured, **kwargs)

Fits the model to measured data.

fit_submodels(measured, **kwargs)

Fits the submodels.

make_numpyro_model(ctx)

Construct a NumPyro model function from the fitting context.

Attributes

__abstractmethods__

__annotations__

__dict__

__doc__

__module__

__slots__

__weakref__

list of weak references to the object (if defined)

_abc_impl