ParameterHandlerBase

class pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase

Bases: pybind11_object

Methods Summary

calculate_likelihood(self)

Calculate penalty term based on inverted covariance matrix.

get_fancy_par_name(self, index)

Get the name of this parameter.

get_flat_prior(self, index)

Is the parameter at index i flat?.

get_internal_par_name(self, index)

Get the internally used name of this parameter.

get_lower_bound(self, index)

Get the lower bound of parameter at index i.

get_n_pars(self)

Get the number of parameters that this ParameterHandler object knows about.

get_par_error(self, index)

The prior error on parameter at index i

get_par_fixed(self, index)

Is the parameter at index i fixed

get_par_init(self, index)

Get initial value of parameter at index i

get_prior_cov(self)

Get the prior covariance

get_proposal_array(self)

Get the parameter proposal values as a numpy array.

get_upper_bound(self, index)

Get the upper bound of parameter at index i.

propose_step(self)

Propose a step based on the covariances.

set_parameters(self[, pars])

Set parameter values using array.

Methods Documentation

calculate_likelihood(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase) float

Calculate penalty term based on inverted covariance matrix.

get_fancy_par_name(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) str
Get the name of this parameter.
param index:

The global index of the parameter

get_flat_prior(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) bool
Is the parameter at index i flat?.
param index:

index of the parameter

get_internal_par_name(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) str
Get the internally used name of this parameter.
param index:

The global index of the parameter

get_lower_bound(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) float
Get the lower bound of parameter at index i.
param index:

index of the parameter

get_n_pars(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase) int

Get the number of parameters that this ParameterHandler object knows about.

get_par_error(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) float
The prior error on parameter at index i
param index:

index of the parameter

get_par_fixed(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) bool
Is the parameter at index i fixed
param index:

index of the parameter

get_par_init(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) float
Get initial value of parameter at index i
param index:

index of the parameter

get_prior_cov(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase) numpy.ndarray[numpy.float32]

Get the prior covariance

get_proposal_array(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase) numpy.ndarray[numpy.float64]
Get the parameter proposal values as a numpy array.

This returns a copy of the current proposal values. :return: A numpy array containing the proposal values for all parameters.

get_upper_bound(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, index: int) float
Get the upper bound of parameter at index i.
param index:

index of the parameter

propose_step(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase) None

Propose a step based on the covariances. Also feel free to overwrite if you want something more funky.

set_parameters(self: pyMaCh3._pyMaCh3.parameters.ParameterHandlerBase, pars: object = None) None

Set parameter values using array.

Parameters:

pars (numpy.ndarray or list of float, optional) – Array holding new values for every parameter. Must have same size as the number of parameters in the covariance class. If not provided, parameters are set to their pre-fit values.

Examples

>>> import numpy as np
>>> handler.set_parameters(np.array([1.0, 2.0, 3.0]))
>>> handler.set_parameters([1.0, 2.0, 3.0])
>>> handler.set_parameters()