Prev: L42, Next: L44

# Lecture

📗 The lecture is in person, but you can join Zoom: 8:50-9:40 or 11:00-11:50. Zoom recordings can be viewed on Canvas -> Zoom -> Cloud Recordings. They will be moved to Kaltura over the weekends.
📗 The in-class (participation) quizzes should be submitted on TopHat (Code:741565), but you can submit your answers through Form at the end of the lectures too.
📗 The Python notebooks used during the lectures can also be found on: GitHub. They will be updated weekly.


# Lecture Notes

📗 Pseudorandom Numbers
➭ A random sequence can be generated by a recurrence relation, for example, \(x_{t+1} = \left(a x_{t} + c\right) \mod m\).
➭ \(x_{0}\) is called the seed, and if \(a, c, m\) are large and unknown, then the sequence looks random.
numpy.random uses a more complicated PCG generator, but with a similar deterministic sequence that looks random: Link

📗 Discrete Distributions
➭ A discrete distribution takes on finite or countably infinite number of values (for example, 0, 1, 2, ...).
➭ The distribution can be summarized in a table containing the probability that it takes on each value, for example \(\mathbb{P}\left\{X = a\right\}, a = 0, 1, 2, ...\).
➭ The probabilities should be non-negative and sum up to one.

📗 Continuous Distributions
➭ A continuous distribution takes on uncountably infinite number of values (for example, real numbers between 0 and 1).
➭ The distribution can be summarized as a probability density function \(f\left(x\right)\) with the property that \(\mathbb{P}\left\{a \leq X \leq b\right\} = \displaystyle\int_{a}^{b} f\left(x\right) dx\).
➭ The density function should be non-negative and integrates to 1.
➭ For a continuous \(X\), \(\mathbb{P}\left\{X = x\right\} = 0\) always has 0 probability of taking on any specific value.

Random Variable Examples ➭ Code for discrete distribution examples: Notebook.
➭ Code for continuous distribution examples: Notebook.

TopHat Discussion ➭ How to generate uniform random vectors within a circle or in a unit simplex?
➭ Code for uniform distribution in a circle or simplex: Notebook.

Additional Example ➭ What is the correlation between \(\left(X, Y\right) \sim \text{\;MultivariateNormal\;} \left(\begin{bmatrix} 0 \\ 0 \end{bmatrix} , \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} \right)\)?
➭ The variance of \(X\) is \(\sigma_{X}^{2} = 1\), so the standard deviation is \(\sigma_{X} = 1\).
➭ The variance of \(Y\) is \(\sigma_{Y}^{2} = 4\), so the standard deivation is \(\sigma_{Y} = 2\).
➭ The covariance between \(X\) and \(Y\) is \(c_{X Y} = 2\), so the correlation is \(\rho_{X Y} = \dfrac{c_{X Y}}{\sigma_{X} \sigma_{Y}} = \dfrac{2}{1 \cdot 2} = 1\).
➭ Therefore, \(X\) and \(Y\) are perfectly positively correlated, i.e. all random pairs \(\left(X, Y\right)\) will appear on the same line.




📗 Notes and code adapted from the course taught by Yiyin Shen Link and Tyler Caraza-Harter Link






Last Updated: April 29, 2024 at 1:10 AM