Problem 1#
Write a program to calculate an confidence limits at arbitrary confidence levels for a given number of observed counts (remember those are integers). Calculate upper and lower limits (if possible) at 68% and 95% CL for observed counts between 0 and 10.
Problem 2#
Another common statistical test is the Student’s-t test. This is similar to a Gaussian test, except that the standard deviations of the distributions are calculated from the data rather than known a priori. Implementations of this test exist in python (e.g in scipy).
Part 1#
Write a function that uses the Student’s t-test to descriminate at an arbitrary level between two samples.
Part 2#
Generate two normally distributed samples with \(n = 10\) entries with means \(\mu_1 = 5\) and \(\mu_2 = 10\) with both with \(\sigma = 2\)
Calculate the Student’s t-test for whether the sample means (the mean calculated from the \(n\) values in each sample) \(\mu_{1,s}\) is significantly different from \(\mu_{2,s}\).
Part 3#
Repeat this test for \(\sigma = {1, 3, 5}\) and \(n = 2, 5, 15, 25, 250\).
How does the significance of the difference in the sample means vary with \(\sigma\) and \(n\). Make a plot to illustrate your conclusion.