320 likes | 426 Views
15.Math-Review. Friday 8/18/00. Random Variables. Event: In this setting we are talking about some uncertain event. The outcome of which is uncertain Outcome: The result of an observation of the event once the uncertainty has been resolved. Probability:
E N D
15.Math-Review Friday 8/18/00
Random Variables • Event: • In this setting we are talking about some uncertain event. The outcome of which is uncertain • Outcome: • The result of an observation of the event once the uncertainty has been resolved. • Probability: • The likelihood that certain outcome is realized for the event. • Example: • To roll a balanced 6-sided die is an event. The number that appears on top of the die once its rolled it’s the outcome. And any outcome (any of the 6 sides) has a probability of 1/6.
Random Variables • We have an uncertain event. • If the outcome of the uncertainty is a number then it is called a random variable: • Example: • The result of the flip of a coin is uncertain event. We can obtain heads or tails. This is not a random variable. • If we associate the variable X a value equal to 1 if the coin flip is head and 0 if the coin flip is tails, then X is a random variable.
Random Variables • Arandom process (or event) is one whose outcome cannot be specified in advance (except in probabilistic terms). • A random variable is a number that reflects the outcome of a random process.
Random Variables • A random variable can be discrete or continuous. • Discrete: The values the random variable can take are fixed discrete amounts. Example: The number on top after the roll of a die can be 1, 2, 3, 4, 5 or 6. • Continuous: The random variable can take any value in some interval. Example: If we draw a student at random in the class and record their height in principle we can obtain any number between .5 meters and 2.5 meters. (Very unlikely in the extremes)
The die example: Probability Distributions • The behavior of a discrete random variable can be described with a probability distribution of the form:
Probability Distributions • The probability that a continuous random variable takes exactly one value =0. • There are infinite possible values the variable can take. • For a cont. r.v. we ask what is the probability that the r.v. falls within a certain interval. • If X is a cont. r.v. its cumulative distribution functionF(x) is defined by: F(x) = P(Xx)
Probability Distributions • What is P(a Xb) for a cont. r.v.? • Since the events {X<a} and {aXb} are disjoint (mutually exclusive) we have: P(X b) = P({X<a}{aXb})=P(X<a)+P(aXb) = P(X a)+P(aXb) • This means that P(aXb)= P(X b) - P(X a)=F(b)-F(a)
By construction we have that: Probability Distributions • We define f(x) the probability density function of the cont. r.v. X as: • But what is this density function?
F(x) 1 x Probability Distributions • The density function is the function f( ) such that the probability over a tiny interval of length y around point x is yf(x). f(x) x Interval of length y P(Xshaded area) yf(x)
Forecast: 6 10,000 Trials Cumulative Chart 0 Outliers 1.000 10000 .750 .500 .250 .000 0 0.00 1.75 3.50 5.25 7.00 Forecast: 6 10,000 Trials Frequency Chart 0 Outliers .172 1715 .129 .086 857.5 .043 428.7 .000 0 0.00 1.75 3.50 5.25 7.00 Probability Distributions • Density function of a continuous r.v. • These graphs show the empirical frequency and cumulative frequency of the ‘die’ r.v. • What happens if we allow the r.v. to take more values between 1 and 6?
Forecast: 11 10,000 Trials Frequency Chart 0 Outliers .096 955 .072 716.2 .048 477.5 .024 238.7 .000 0 0.00 1.75 3.50 5.25 7.00 Forecast: 11 10,000 Trials Cumulative Chart 0 Outliers 1.000 10000 .750 .500 .250 .000 0 0.00 1.75 3.50 5.25 7.00 Probability Distributions • Here the r.v can take 11 equally likely and equally spaced values between 1 and 6. • Note that the frequency over an interval of length 1 is 2 of these bars: 2(.088)=0.1761/6
Forecast: 21 10,000 Trials Frequency Chart 0 Outliers .050 503 .038 377.2 .025 251.5 .013 125.7 .000 0 Forecast: 21 0.00 1.75 3.50 5.25 7.00 10,000 Trials Cumulative Chart 0 Outliers 1.000 10000 .750 .500 .250 .000 0 0.00 1.75 3.50 5.25 7.00 Probability Distributions • Here the r.v can take 21 equally likely and equally spaced values between 1 and 6. • Note that the frequency over an interval of length 1 is 4 of these bars: 4(.042)=0.1681/6
Forecast: 41 10,000 Trials Cumulative Chart 0 Outliers 1.000 10000 .750 .500 .250 .000 0 Forecast: 41 0.00 1.75 3.50 5.25 7.00 10,000 Trials Frequency Chart 0 Outliers .030 297 .022 222.7 .015 148.5 .007 74.25 .000 0 0.00 1.75 3.50 5.25 7.00 Probability Distributions • Here the r.v can take 41 equally likely and equally spaced values between 1 and 6. • Note that the frequency over an interval of length 1 is 8 of these bars: 8(.022)=0.1761/6
Probability Distributions • The probability of any one value decreases to 0. • The cumulative frequency function is smoother. • In the limit, when we pass to a continuous distribution: • the cumulative frequency function will become the cumulative distribution function. • The frequency function will go to the function g(x)=0. • The frequency in an interval of length y will be y/6.
f(x) .172 .129 .086 .043 x .000 1 2 4 6 5 3 Mean, Variance, Covariance • The behavior of r.v. is expressed by their distribution. • The mean and variance give some summary information of what the distribution looks like. • The covariance describes how two r.v. relate to each other.
In the continuous case: • Where f(x) is the probability density function: Mean, Variance, Covariance • The mean of r.v. X is an average of the possible values of X weighted by the probability. • In the discrete case: • If X can take the values x1, x2,…, xn with probabilities p1, p2,…, pn respectively.
In the continuous case: Mean, Variance, Covariance • The variance of r.v. X is the weighted square distance from the mean. • In the discrete case:
Mean, Variance, Covariance • Lets consider the random variables X, Y: • Compute the mean, variance and standard deviation. • X= 1.55, X2 =0.5725, X= 0.756637 • Y= 4.2, Y2 =0.96, Y= 0.979796
X • Distributions that have the same mean but different variances. The ‘fatter’ distributions have greater variance. Mean, Variance, Covariance • Graphically: f(x) X X X • These are continuous r.v. distributions with the same variance and with different means. The mean is the average value the r.v. takes.
Mean, Variance, Covariance • A city newsstand has been keeping records for the past year of the number of copies of the WSJ sold daily. Records were kept for 200 days.
Mean, Variance, Covariance • What is the distribution of the number of copies of the WSJ sold in one day? • What is the average number of WSJ sold in one day? • What is the standard deviation of the number of WSJ sold each day?
Mean, Variance, Covariance • X= 2.53, X2 =3.3791, X= 1.838233
Mean, Variance, Covariance • If we are given two r.v. X and Y the covariance and correlation of X and Y are defined by: • Discrete case: • Where X and X are the mean and standard deviation of r.v. X respectively. • And pi is the probability of the joint distribution. In other words: pi = P(X=xi,Y=yi) • The continuous case is analogous
If COV(X,Y)<0, then if X is greater than its mean, Y is smaller than its mean. Y P(X=xi,,Y=yi )= pi Y P(X=xi,,Y=yi )= pi Y Y X X X X • COV(X,Y)<0 Mean, Variance, Covariance • Interpretation: • If COV(X,Y)>0, then if X is greater than its mean, Y is greater than its mean. • COV(X,Y)>0
x y Mean, Variance, Covariance • Example: In our old example: • The joint distribution is: • We already know that: • X= 1.55, X2 =0.5725, X= 0.756637 • Y= 4.2, Y2 =0.96, Y= 0.979796
x 1 1.5 3 3 0.1 0.22 0.08 0.4 y 5 0.4 0.08 0.12 0.6 0.5 0.3 0.2 1.0 Mean, Variance, Covariance • So... • The covariance is 0 because these r.v. are independent. • What if we change the problem a little:
Mean, Variance, Covariance • Now: • Now X and Y are no longer independent, in fact they have a negative covariance. • Correlation is CORR(X,Y) = -0.1/(0.756637*0.979796) = -0.13489
Mean, Variance, Covariance • Consider r.v. X,Y of means X, Y and standard deviations X,y respectively. • Let a,b be some fixed numbers. • Define Z=aX+bY, then:
Some Derivations • First we show that E(aX+bY)=aE(X)+bE(Y), we will use this formula in the remaining derivations. • In the fourth equality it helps to think in terms of a table to link the joint distribution with the ‘marginal’ distributions.
Some Derivations • VAR(X) = E((X-E(X))2) = E(X2 -2E(X)X+ E(X)2) = = E(X2) -2E(X)E(X) + E(X)2 = = E(X2) -E(X)2 • COV(X,Y) = E( (X-E(X))(Y-E(Y)) ) = E(XY- E(X)Y- E(Y)X+ E(X)E(Y))= = E(XY)- E(X)E(Y)- E(Y)E(X) + E(Y)E(X)= = E(XY)- E(X)E(Y) • VAR(aX+bY)= E((aX +bY)2) - (E(aX+bY))2 = = E(a2X2+2abXY+b2Y2)-(aE(X)+bE(Y))2 = = a2E(X2)+2abE(XY)+b2E(Y2)-a2E(X)2-2abE(X)E(Y)-b2E(Y)2 = = a2(E(X2)-E(X)2)+ b2(E(Y2)- E(Y)2)+2ab(E(XY)-E(X)E(Y)) = = a2VAR(X)+b2VAR(Y)+2abCOV(X,Y)
Mean, Variance, Covariance • We know that an investment in Snowboard Inc. has a return that is a random variable with mean .9 and standard deviation 0.075. Also an investment in Skiboots Inc. has a return that is a random variable that we know has mean .9 and standard deviation 0.27. Also the return for these stocks has a correlation of -0.75. • If you decide to invest 30% of your capital in Snowboard Inc, and 70% in Skiboots Inc. What is the mean and variance of the return of the resulting portfolio? • What if you invest 50% on each?