Trouble using gammapy's Feldman-Cousins methods for a gaussian

61 views
Skip to first unread message

DV

unread,
May 19, 2020, 6:54:09 AM5/19/20
to gammapy
Hello all,

I'm trying to set limits on a value with an expected gaussian distribution around the origin, however have run into some strange behaviour. I've mostly copied the example code from the FC documentation, changing the poisson in there to a gaussian:

x_bins=np.arange(0,20)
mu_bins = np.linspace(0, 15, 2000, endpoint=True)
matrix = [norm(mu + 0,2).pdf(x_bins) for mu in mu_bins]
acceptance_intervals = gstats.fc_construct_acceptance_intervals_pdfs(matrix, 0.9)
LowerLimitNum, UpperLimitNum, _ = gstats.fc_get_limits(mu_bins, x_bins, acceptance_intervals)

m = 2.1
lim = gstats.fc_find_limit(m, UpperLimitNum, mu_bins)

And this gives sensible-looking limits, for an m value of 2.1 it returns ~5.5, which is similar to the basic frequentist limit. However, if I try to bin the x_bins more finely to get a more accurate result, this affects the value of the limit, which doesn't seem like what it should be doing! The more finely I bin, the smaller this limit gets. More worryingly, this ends up very close to the measured x, which means it's setting a much lower limit than I think it should be.

If I don't adjust the x_bins, I find that many similar m values give the same limit - I figured this was a binning issue, but perhaps I've fixed this wrong?

Is there something I've misunderstood/ am doing wrong here?

Thanks.
Kind Regards,
Dominika




Reply all
Reply to author
Forward
0 new messages