Download presentation
Presentation is loading. Please wait.
1
Univariate Random Variable
Moore Chapter 4 and Guan chapter 4
2
Random variable A random variable (隨機變數) is a variable whose value is a numerical outcome of a random phenomenon. A basketball player shoots three free throws. We define the random variable X as the number of baskets successfully made. A discrete random variable (間斷隨機變數) X has a finite number of possible values. A continuous random variable (連續隨機變數) X takes all values in an interval (區間).
3
Probability distributions
The probability distribution (機率分配) of a random variable X tells us what values X can take and how to assign probabilities to those values. Because of the differences in the nature of sample spaces for discrete and continuous sample random variables, we describe probability distributions for the two types of random variables separately.
4
The probabilities pi must add up to 1.
The probability distribution of a discrete random variable X lists the values and their probabilities: The probabilities pi must add up to 1. A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. H H HHH M … M M HHM H HMH M HMM … Value of X Probability 1/8 3/8 3/8 1/8 HMM HHM MHM HMH MMM MMH MHH HHH
5
P(X≥2) = P(X=2) + P(X=3) = 3/8 + 1/8 = 1/2
The probability of any event is the sum of the probabilities pi of the values of X that make up the event. A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. Value of X Probability 1/8 3/8 3/8 1/8 What is the probability that the player successfully makes at least two baskets (“at least two” means “two or more”)? HMM HHM MHM HMH MMM MMH MHH HHH P(X≥2) = P(X=2) + P(X=3) = 3/8 + 1/8 = 1/2 What is the probability that the player successfully makes fewer than three baskets? P(X<3) = P(X=0) + P(X=1) + P(X=2) = 1/8 + 3/8 + 3/8 = 7/8 or P(X<3) = 1 – P(X=3) = 1 – 1/8 = 7/8
6
Continuous probability distributions
A continuous random variable X takes all values in an interval. Example: There is an infinity of numbers between 0 and 1 (e.g., 0.001, 0.4, ). The probability distribution of a continuous random variable is described by a density curve. The probability of any event is the area under the density curve for the values of X that make up the event. This is a uniform density curve for the variable X. The probability that X falls between 0.3 and 0.7 is the area under the density curve for that interval: P(0.3 ≤ X ≤ 0.7) = (0.7 – 0.3)*1 = 0.4 X
7
Intervals All Continuous probability distributions assign probability 0 to every individual outcome. Only intervals can have a positive probability, represented by the area under the density curve for that interval. The probability of a single event is zero: P(X=1) = (1 – 1)*1 = 0 Height = 1 X The probability of an interval is the same whether boundary values are included or excluded: P(0 ≤ X ≤ 0.5) = (0.5 – 0)*1 = 0.5 P(0 < X < 0.5) = (0.5 – 0)*1 = 0.5 P(0 ≤ X < 0.5) = (0.5 – 0)*1 = 0.5 P(X < 0.5 or X > 0.8) = P(X < 0.5) + P(X > 0.8) = 1 – P(0.5 < X < 0.8) = 0.7
8
Continuous random variable and population distribution (母體分配)
% individuals with X such that x1 < X < x2 The shaded area under a density curve shows the proportion, or %, of individuals in a population with values of X between x1 and x2. Because the probability of drawing one individual at random depends on the frequency of this type of individual in the population, the probability is also the shaded area under the curve.
9
Normal probability distributions
The probability distribution of many random variables is a normal distribution. It shows what values the random variable can take and is used to assign probabilities to those values. Example: Probability distribution of women’s heights. Here, because we chose a woman randomly, her height, X, is a random variable. To calculate probabilities with the normal distribution, we will standardize the random variable (z score) and use Table A.
10
Because the woman is selected at random, X is a random variable.
What is the probability, if we pick one woman at random, that her height will be some value X? For instance, between 68 and 70 inches P(68 < X < 70)? Because the woman is selected at random, X is a random variable. As before, we calculate the z-scores for 68 and 70. For x = 68", For x = 70", N(µ, s) = N(64.5, 2.5) 0.9192 0.9861 The area under the curve for the interval [68" to 70"] is − = Thus, the probability that a randomly chosen woman falls into this range is 6.69%. P(68 < X < 70) = 6.69%
11
Mean of a random variable
The mean of a set of observations is their arithmetic average (算數平均). The mean µ of a random variable X is a weighted average of the possible values of X, reflecting the fact that all outcomes might not be equally likely. A basketball player shoots three free throws. The random variable X is the number of baskets successfully made (“H”). HMM HHM MHM HMH MMM MMH MHH HHH Value of X Probability 1/8 3/8 3/8 1/8 The mean of a random variable X is also called expected value (期望值) of X.
12
Mean of a random variable
For a discrete random variable X with probability distribution the mean µ of X is found by multiplying each possible value of X by its probability, and then adding the products. A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. The mean µ of X is µ = (0*1/8) + (1*3/8) + (2*3/8) + (3*1/8) = 12/8 = 3/2 = 1.5 Value of X Probability 1/8 3/8 3/8 1/8
13
Mean of a random variable
Population mean (or expected value) simply describes the center of the distribution of the random variable, it doesn’t mean we can always realize the expected value. Example: Probability Model for a Coin Toss: X = 1 if head; zero for tail Probability of heads = 0.5 Probability of tails = 0.5 Expected value=0.5*1+0.5*0=0.5 Could we flip a coin other than head or tail? In social science, we usually have no idea what the expected value is unless we work on a consensus survey (普查). What is the average IQ of Taiwanese people? What is the average consumption of US?
14
Variance of a random variable
The variance and the standard deviation are the measures of spread that accompany the choice of the mean to measure center. The variance σ2X of a random variable is a weighted average of the squared deviations (X − µX)2 of the variable X from its mean µX. Each outcome is weighted by its probability in order to take into account outcomes that are not equally likely. The larger the variance of X, the more scattered the values of X on average. The positive square root of the variance gives the standard deviation σ of X.
15
Variance of a discrete random variable
For a discrete random variable X with probability distribution and mean µX, the variance σ2 of X is found by multiplying each squared deviation of X by its probability and then adding all the products. A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. µX = 1.5. Value of X Probability 1/8 3/8 3/8 1/8 The variance σ2 of X is σ2 = 1/8*(0−1.5)2 + 3/8*(1−1.5)2 + 3/8*(2−1.5)2 + 1/8*(3−1.5)2 = 2*(1/8*9/4) + 2*(3/8*1/4) = 24/32 = 3/4 = .75
16
Rules for means and variances
If X is a random variable and a and b are fixed numbers, then µa+bX = a + bµX σ2a+bX = b2σ2X If X and Y are two independent random variables, then µX+Y = µX + µY σ2X+Y = σ2X + σ2Y σ2X-Y = σ2X + σ2Y If X and Y are NOT independent but have correlation ρ, then σ2X+Y = σ2X + σ2Y + 2ρσXσY σ2X-Y = σ2X + σ2Y - 2ρσXσY
17
A simple example Consider two random variables X1 and X2 with probabilities: P({X1 = -2}) = P({X1 = 2}) = 0.5, P({X2 = -2}) = P({X2 = 4}) = 0.5. and, E(X1) = (-2)(0.5) + (2)(0.5) = 0, E(X2) = (-2)(0.5) + (4)(0.5) = 1. E(X12) = (-2)2(0.5) + (2)2(0.5) = 4, E(X22) = (-2)2(0.5) + (4)2(0.5) = 10 . var(X1 ) = E(X12) – E(X1) 2 = 4 , var(X2 ) = E(X22) – E(X2) 2 = 9 . 4-17
18
A simple example If X3=X1 + 2, then E(X3) = (0)(0.5) + (4)(0.5) = 2,
var(X3 )= E(X32) – [E(X3)]2 = 4 . 4-18
19
Example: Investment decision
$$$ Example: Investment decision You invest 20% of your funds in Treasury bills and 80% in an “index fund” that represents all U.S. common stocks. Your rate of return over time is proportional to that of the T-bills (X) and of the index fund (Y), such that R = 0.2X + 0.8Y. Based on annual returns between 1950 and 2003: Annual return on T-bills µX = 5.0% σX = 2.9% Annual return on stocks µY = 13.2% σY = 17.6% Correlation between X and Yρ = −0.11 µR = 0.2µX + 0.8µY = (0.2*5) + (0.8*13.2) = 11.56% σ2R = σ20.2X + σ20.8Y + 2ρσ0.2Xσ0.8Y = 0.2*2σ2X + 0.8*2σ2Y + 2ρ*0.2*σX*0.8*σY = (0.2)2(2.9)2 + (0.8)2(17.6)2 + (2)(−0.11)(0.2*2.9)(0.8*17.6) = σR = √ = 14.03% The portfolio has a smaller mean return than an all-stock portfolio, but it is also less risky.
20
Example: Bernoulli experiment(白奴里隨機變數)
Bernoulli experiment is a discrete and binary variable in a random. Example: toss a coin Bernoulli random variable, X is X = 1, if the outcome is a success X = 0, if the outcome is a failure 4-20
21
Bernoulli experiment Let p to be the probability P({ X=1 }), then the density function of a Bernoulli is fX(b ; p) = P({ X = b }) = pb (1 p)(1b),b = 0,1 Value of fX is determined by the parameter: p, which represents the likelihood of the event occurrence. E(X) = 1 p + 0 (1 p) = p. var(X) = (1 p)2 p + p2 (1 p) = p(1 – p) Standardized Bernoulli random variable is: 4-21
22
Probability function (機率函數) of discrete random variable (間斷隨機變數)
X is a discrete random variable with values of bi, i=1, 2, … fx(bi)=P({w: X(w)=bi}) Sometimes we ignore w in the probability function to simply the expression…. fx(bi)=P({X(w)=bi})= Probability Outcome, realization { }: random event A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. The probability function of X is 1/8 if bi=0 3/8 if bi=1 fx(bi)= 3/8 if bi=2 1/8 if bi=3 Value of X Probability 1/8 3/8 3/8 1/8
23
Cumulative distribution function
A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. The probability function of X is 1/8 if bi=0 3/8 if bi=1 fx(bi)= 3/8 if bi=2 1/8 if bi=3 Value of X Probability 1/8 3/8 3/8 1/8
24
Recall mean and variance
For a discrete random variable X with probability distribution the mean µ of X is found by multiplying each possible value of X by its probability, and then adding the products. Also known as E(x)=expected value The variance σ2 of X is found by multiplying each squared deviation of X by its probability and then adding all the products.
25
More properties using E(.), the expectation operator
E(X)=μx=first moment (第一階動差) E(X2)=second moment (第二階動差) ≠ Variance=E[(X-μx)2] Var (X)=E[(X-μx)2] =E[X2-2Xμx+μx2] =E(X2)-2μxE(X) +μx2 =E(X2) –μx2 = E(X2)-[E(X)]2 E[g(X)]≠g[E(X)] when g is a non-linear function Note this: E(X2)≠[E(X)]2 A basketball player shoots three free throws. The random variable X is the number of baskets successfully made. Now we set g(X)=X2 Value of X Probability 1/8 3/8 3/8 1/8 E[g(X)]=(0*1/8) + (1*3/8) + (4*3/8) + (9*1/8)=3 g[E(X)]=(1.5)2=2.25 Value of X2 Probability 1/8 3/8 3/8 1/8
26
Probability function of continuous random variable (連續隨機變數)
Fx(a)=P({X≤a}) Because X is a continuous variable, P({X=a})=0 Area at X=a is zero Cumulative density function: Probability density function (機率密度函數)
27
Mean, variables and moments
Mean (or expected value) Variance Try this uniform distribution :
28
Chebyshev inequality (才比雪夫不等式)
The probability of X at away from the expected value with at least distance c is: Or we can express as this: E(X)-c E(X) E(X)+c
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.