smoofit.model.Variable

class smoofit.model.Variable(name, init=0.0, lower_bound=None, upper_bound=None, sub_names=None, nuisance=False)[source]

Represents any parameter in the model, be it a free parameter of interest (POI) or a (constrained) nuisance parameter.

Variables have an initial (default) value, that is taken as initial value in the fits, and that can be used when generating Asimov toy datasets.

Variables can either be scalar- or vector-valued. Vector-valued variables are restricted to a single dimension, i.e. they have array shape (n,).

For vector-valued variables, every component can have a specific “name”, which by default is just the index of the component.

Methods

__init__(name[, init, lower_bound, ...])

Constructor

set(val)

Set a new value for the parameter(s)

__init__(name, init=0.0, lower_bound=None, upper_bound=None, sub_names=None, nuisance=False)[source]

Constructor

Lower or upper bounds for vector-valued parameters can either be specified as scalars (in which case the same bound will be used for every component) or as list/array in which case a different bound can be specified for each component).

Parameters
  • name (str) – name of the parameter - should be unique among all the parameters linked to a Model object.

  • init (Union[float, List[float], ndarray, DeviceArrayBase]) – initial value of the parameter (scalar or jax/numpy 1D array)

  • lower_bound (Union[float, List[float], ndarray, DeviceArrayBase, None]) – lower bound of the parameter in the fit (default is no bound)

  • upper_bound (Union[float, List[float], ndarray, DeviceArrayBase, None]) – upper bound of the parameter in the fit (default is no bound)

  • sub_names (Optional[List[str]]) – names of the sub-components of vector-valued parameters (by default, will just be the indices)

  • nuisance (bool) – specify if the parameter is a (Gaussian-constrained) nuisance parameter

set(val)[source]

Set a new value for the parameter(s)

The dimension of the parameter cannot be changed.

Parameters

val (Union[float, List[float], ndarray, DeviceArrayBase]) – the new value (scalar or jax/numpy array)