Simultaneous¶
-
class
pyhf.probability.
Simultaneous
(pdfobjs, tensorview, batch_size=None)[source]¶ Bases:
object
A probability density corresponding to the joint distribution of multiple non-identical component distributions
Example
>>> import pyhf >>> import numpy.random as random >>> from pyhf.tensor.common import _TensorViewer >>> random.seed(0) >>> poissons = pyhf.probability.Poisson(pyhf.tensorlib.astensor([1.,100.])) >>> normals = pyhf.probability.Normal(pyhf.tensorlib.astensor([1.,100.]), pyhf.tensorlib.astensor([1.,2.])) >>> tv = _TensorViewer([[0,2],[1,3]]) >>> sim = pyhf.probability.Simultaneous([poissons,normals], tv) >>> sim.sample((4,)) array([[ 2. , 1.3130677 , 101. , 98.29180852], [ 1. , -1.55298982, 97. , 101.30723719], [ 1. , 1.8644362 , 118. , 98.51566996], [ 0. , 3.26975462, 99. , 97.09126865]])
Methods
-
__init__
(pdfobjs, tensorview, batch_size=None)[source]¶ Construct a simultaneous pdf.
- Parameters
pdfobjs (Distribution) – The constituent pdf objects
tensorview (_TensorViewer) – The
_TensorViewer
defining the data compositionbatch_size (int) – The size of the batch
-
expected_data
()[source]¶ The expectation value of the probability density function.
- Returns
The expectation value of the distribution \(\mathrm{E}\left[f(\theta)\right]\)
- Return type
Tensor
-