nami_toys.parameterised#

Classes

ParameterisedGaussian([sig_loc, sig_cov, ...])

Gaussian mixture whose signal location depends on a parameter \(\theta\).

class nami_toys.parameterised.ParameterisedGaussian(sig_loc=<factory>, sig_cov=<factory>, bkg_loc=<factory>, bkg_cov=<factory>, sig_frac=0.3, param_dim=0)[source]#

Bases: object

Gaussian mixture whose signal location depends on a parameter \(\theta\).

The background distribution is fixed while the signal mean is set to \(\theta\) along param_dim, keeping the base mean elsewhere.

Parameters:
  • sig_loc (Tensor) – Base signal mean (d,); entry at param_dim is replaced by theta.

  • sig_cov (Tensor) – Signal covariance (d, d) (fixed).

  • bkg_loc (Tensor) – Background mean and covariance (fixed).

  • bkg_cov (Tensor) – Background mean and covariance (fixed).

  • sig_frac (float) – Expected signal fraction.

  • param_dim (int) – Dimension of the mean vector that theta controls.

property bkg: MultivariateNormal#
bkg_cov: Tensor#
bkg_loc: Tensor#
property d: int#
generate(theta, n_expected, *, generator=None)[source]#

Draw a Poisson-fluctuated dataset at the given theta.

Return type:

ToyDataset

Parameters:
log_likelihood_ratio(x, theta)[source]#

Per-event log-likelihood ratio \(\log p(x \mid \text{sig}, \theta) - \log p(x \mid \text{bkg})\).

Return type:

Tensor

Parameters:
log_prob(x, theta)[source]#

Mixture log-probability \(\log p(x \mid \theta)\).

Parameters:
  • x (Tensor) – Events (N, d) or (d,).

  • theta (float) – Parameter value.

Return type:

Tensor

param_dim: int = 0#
sig_at(theta)[source]#

Return the signal distribution at a given theta.

Return type:

MultivariateNormal

Parameters:

theta (float)

sig_cov: Tensor#
sig_frac: float = 0.3#
sig_loc: Tensor#