This shows you the differences between two versions of the page.
cs401r_w2016:lab3 [2015/12/23 20:04] admin |
cs401r_w2016:lab3 [2021/06/30 23:42] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===Objective:=== | ||
- | |||
- | To understand how to sample from different distributions, and to | ||
- | understand the link between samples and a PDF/PMF. To explore | ||
- | different parameter settings of common distributions, and to implement | ||
- | a small library of random variable types. | ||
- | |||
- | ===Deliverable:=== | ||
- | |||
- | You should turn in an ipython notebook that implements and tests a | ||
- | library of random variable types. | ||
- | |||
- | When run, this notebook should sample multiple times from each type of | ||
- | random variable; these samples should be aggregated and visualized, | ||
- | and compared to the corresponding PDF/PMF. The result should look | ||
- | something like this: | ||
- | |||
- | {{:cs401r_w2016:lab3.png?nolink|}} | ||
- | |||
- | |||
- | ===Description:=== | ||
- | |||
- | You must implement: | ||
- | |||
- | * The following one dimensional, continuous valued distributions. For | ||
- | these, you should also plot the PDF of the random variable on the | ||
- | same plot; the curves should match. | ||
- | |||
- | '' | ||
- | Beta (alpha=1, beta=3) | ||
- | Poisson (lambda=7) | ||
- | Univariate Gaussian (mean=2, variance=3) | ||
- | '' | ||
- | |||
- | * The following discrete distributions. For these, plot predicted and | ||
- | empirical histograms side-by-side: | ||
- | |||
- | '' | ||
- | Bernoulli (p=0.7) | ||
- | Multinomial (theta=[0.1, 0.2, 0.7]) | ||
- | '' | ||
- | |||
- | * The following multidimensional distributions. | ||
- | |||
- | * Two-dimensional Gaussian | ||
- | * 3-dimensional Dirichlet | ||
- | |||
- | ===Hints:=== | ||
- | |||
- | The following functions may be useful to you: | ||
- | |||
- | <code python> | ||
- | |||
- | hist( data, bins=50, normed=True ) | ||
- | |||
- | numpy.linspace | ||
- | |||
- | legend | ||
- | |||
- | title | ||
- | |||
- | </code> | ||
- | |||