Block 81: SciPy Overview & Statistics
Use scipy.stats for distributions and hypothesis testing.
Concepts
- from scipy import stats
- stats.norm, stats.t, stats.chi2 distributions
- pdf(), cdf(), ppf(), rvs()
- Descriptive stats: stats.describe()
Code Examples
See exercise below.
Exercise
Sample 1000 values from N(5,2). Compute mean, std, and plot histogram vs PDF. Compute the CDF probability of x < 6 for N(5,2).
Homework
Explain the difference between PDF and CDF. Draw a rough sketch of each.