140 likes | 202 Views
Learn theoretical concepts of random variables, probability distributions, moments, estimation of parameters, and more for data analysis. Explore methods like Method of Moments and Maximum Likelihood. Generate random variables and pseudo-random numbers efficiently.
E N D
Random Variables and their Properties • Learn fundamental theoretical concepts of random variables and probability distributions • Describe the representation of randomness and data variability using probability distributions. • Characterize probability distributions through attributes such as moments (mean, variance, skewness…) and other measures of central tendency. • Estimate parameters of probability distributions from sample data
Text Coverage (Kottegoda and Rosso) • 3.1 Random Variables, probability distributions and density functions (p86-94) • 3.2 Descriptors of Random Variables • 3.2.1 Expectation and other probability measures (p94-103) • 3.2.3 Estimation of Parameters by method of moments (p107-109), Maximum Likelihood (p112-114), Jackknife and Bootstrap (p116-117)
A random variable X is a variable whose outcomes (values) are governed by the laws of chance. Discrete Values Probability Mass Function PX(x)=Pr(X=x)
Cumulative Distribution Function FX(x)=Pr[X ≤ x]
Continuous Variable Probability density function
= 8621 mgal S = 8194 mgal n = 31 Estimation of parameters Hillsborough River at Zephyr Hills, September flows mgal
=1.1 =1.3 x 10-3 Method of Moments Gamma distribution
=8.29 Method of Moments Log-Normal distribution =0.643
Likelihood ln(L)= -311 (for gamma) ln(L)= -312 (for log normal)
Generating a random variable from a given distribution F(U) F(X) • Generate U from a uniform distribution between 0 and 1 • Solve for X=F-1(U) Basis P(X<x)=P(U<F(x))=P(F-1(U)<x) U X F-1(U) is randomly distributed with CDF F(x)
Generating a Pseudo random number • There is a lot of lore about this. Refer to: Press, W. H., B. P. Flannery, S. A. Teukolsky and W. T. Vetterling, (1988), Numerical Recipes in C : The Art of Scientific Computing, Cambridge University Press, New York, 735 p. • Congruential method • Each r is an integer random number between 0 and m-1. by (m-1) gives a number between 0 and 1 that repeats after at most m numbers. Numerical recipes gives "good" choices for a, c and m. • R has built in functions runif to generate uniform random numbers, as well as other distributions, e.g rnorm, rgamma.
Generating a random variable from a discrete distribution in matlab F(U) F(X) Xs=[x1 x2 x3 …] % Vector of x values Px=[p1 p2 p3 …] % Vector of pmf values CDFx=cumsum(Px) % CDF vector U=rand(1) % Uniform random number 0-1 X = Xs(find(CDFx>U,1) ) % Inverse of CDF U X