Model¶
-
class
pyhf.pdf.
Model
(spec, batch_size=None, **config_kwargs)[source]¶ Bases:
object
The main pyhf model class.
Attributes
-
nominal_rates
¶ Nominal value of bin rates of the main model.
Methods
-
__init__
(spec, batch_size=None, **config_kwargs)[source]¶ Construct a HistFactory Model.
- Parameters
spec (jsonable) – The HistFactory JSON specification
batch_size (None or int) – Number of simultaneous (batched) Models to compute.
config_kwargs – Possible keyword arguments for the model configuration
- Returns
The Model instance.
- Return type
model (Model)
-
constraint_logpdf
(auxdata, pars)[source]¶ Compute the log value of the constraint pdf.
- Parameters
auxdata (tensor) – The auxiliary measurement data
pars (tensor) – The parameter values
- Returns
The log density value
- Return type
Tensor
-
expected_actualdata
(pars)[source]¶ Compute the expected value of the main model.
- Parameters
pars (tensor) – The parameter values
- Returns
The expected data of the main model (no auxiliary data)
- Return type
Tensor
-
expected_auxdata
(pars)[source]¶ Compute the expected value of the auxiliary measurements.
- Parameters
pars (tensor) – The parameter values
- Returns
The expected data of the auxiliary pdf
- Return type
Tensor
-
expected_data
(pars, include_auxdata=True)[source]¶ Compute the expected value of the main model
- Parameters
pars (tensor) – The parameter values
- Returns
The expected data of the main and auxiliary model
- Return type
Tensor
-
logpdf
(pars, data)[source]¶ Compute the log value of the full density.
- Parameters
pars (tensor) – The parameter values
data (tensor) – The measurement data
- Returns
The log density value
- Return type
Tensor
-
mainlogpdf
(maindata, pars)[source]¶ Compute the log value of the main term.
- Parameters
maindata (tensor) – The main measurement data
pars (tensor) – The parameter values
- Returns
The log density value
- Return type
Tensor
-