In World Cup soccer (football), suppose the time until the first goal is well modeled by an exponential distribution with rate lam=2.5 goals per game. Make an ExponentialPdf to represent this distribution and use area_under to compute the probability that the time until the first goal is less than half of a game. Then use an ExponentialCdf to compute the same probability and check that the results are consistent.
Use ExponentialPdf to compute the probability the first goal is scored in the second half of the game. Then use an ExponentialCdf to compute the same probability and check that the results are consistent.
In order to join Blue Man Group, you have to be male between 5β10" and 6β1", which is roughly 178 to 185 centimeters. Letβs see what fraction of the male adult population in the United States meets this requirement.
$ from scipy.stats import trimboth
trimmed = trimboth(heights, 0.01)
m, s = np.mean(trimmed), np.std(trimmed)
m, s
(np.float64(178.10278947124948), np.float64(7.017054887136004))
Hereβs a NormalCdf object that represents a normal distribution with the same mean and standard deviation as the trimmed data.
Use gaussian_kde to make a Pdf that approximates the PDF of male height. (Hint: Investigate the bw_method argument, which can be used to control the smoothness of the estimated density.) Plot the estimated density and compare it to a NormalPdf with mean m and standard deviation s.
Use a NormalPdf and area_under to compute the fraction of people in the normal model that are between 178 and 185 centimeters. Use a NormalCdf to compute the same fraction, and check that the results are consistent. Finally, use the empirical Cdf of the data to see what fraction of people in the dataset are in the same range.