Skip to content

Commit

Permalink
update plotting code
Browse files Browse the repository at this point in the history
  • Loading branch information
jackaraz committed Feb 15, 2024
1 parent 3a04654 commit 45b925f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/tutorials/signal_unc.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import matplotlib.pyplot as plt
We can add uncorrelated signal uncertainties just like in uncorrelated background case

$$
\mathcal{L}(\mu, \theta) = \prod_{i\in{\rm bins}}{\rm Poiss}(n_i|\mu (n^{(s)}_i + \theta_i^{(s)}\sigma^{(s)}_i) + n^{(b)}_i + \theta_i^{(b)}\sigma^{(b)}_i) \cdot \prod_{j\in{\rm nui}}\mathcal{N}(\theta_j^{(b)}|0, 1) \cdot \prod_{j\in{\rm nui}}\mathcal{N}(\theta^{(s)}_j|0, 1)\ ,
\mathcal{L}(\mu, \theta) = \prod_{i\in{\rm bins}}{\rm Poiss}(n_i|\mu n^{(s)}_i + \theta_i^{(s)}\sigma^{(s)}_i + n^{(b)}_i + \theta_i^{(b)}\sigma^{(b)}_i) \cdot \prod_{j\in{\rm nui}}\mathcal{N}(\theta_j^{(b)}|0, 1) \cdot \prod_{j\in{\rm nui}}\mathcal{N}(\theta^{(s)}_j|0, 1)\ ,
$$

where $(s)$ superscript indicates signal and $(b)$ indicates background.
Expand Down Expand Up @@ -81,8 +81,8 @@ Using ``statistical_model`` and ``statistical_model_sigunc`` we can compute the
```{code-cell} ipython3
:tags: [hide-cell]
poi = np.linspace(-3,2,20)
plt.plot(poi, [statistical_model.chi2(p) for p in poi], color="b", label="no signal uncertainties")
plt.plot(poi, [statistical_model_sigunc.chi2(p) for p in poi], color="r", label="with signal uncertainties")
plt.plot(poi, [statistical_model.chi2(p, allow_negative_signal=True) for p in poi], color="b", label="no signal uncertainties")
plt.plot(poi, [statistical_model_sigunc.chi2(p, allow_negative_signal=True) for p in poi], color="r", label="with signal uncertainties")
plt.legend()
plt.xlabel("$\mu$")
plt.ylabel("$\chi^2(\mu)$")
Expand Down

0 comments on commit 45b925f

Please sign in to comment.