Ders 2 Beklenen Değer Olasılık Teorisi

Chapter 2
September 2, 2005
Some Basic
Probability
Concepts
2.1
Random Variable
(Rassal Değişkenler)
Rassal Değişken:
Bir değişkenin değeri belirsizdir taki o değişken bir
gözlem sonucu değeri elde edilsin.
Ekonomistlerin sıklıkla kullandıkları değişkenlerden
fiyat satışlar faiz ve issizlik oranı rassal değişkendir.
Bu değişkenler 100% tahmin edilemez taki
gerçekleşene kadar.
2.2
2.3
Controlled experiment --values
of explanatory variables are chosen
with great care in accordance with
an appropriate experimental design.
Uncontrolled experiment --values
of explanatory variables consist of
nonexperimental observations over
which the analyst has no control.
Continuous Random Variable
Sürekli Rassal Degişkenler
Sürekli Rassal Degişkenler :
Bir sürekli rassal degişken alabilecegi değerler bir
gerçek sayılar serisindeki belirli bir aralık içerisinde
Herhangi bir degerdir.
Örnek:
Gayri Safi Milli Hasıla (GSMH)
Para Arzı
Faiz Oranı
Yumurta Fiyatı
Herhangi Bir Ailenin Geliri
Bir ayakkabının satış fiyatı
2.4
Discrete Random Variable
Kesikli Rassal Değişken
2.5
Kesikli Rassal Değişken :
Bir kesikli rassal değişken sınırlı bir seri içerisinde pozitif
Sayılarca sayılabilen elemanların serisi.
Örnek:Milli Piyango tarafından verilecek
Ödül dağılımı şöyledir.Ödül dağılımı kesikli
bir dağılım gösterir.
Birinci Ödül: $1,000
İkinci Ödül: $50
Üçüncü Ödül: $5.75
Sayılabilen bu tip seriye
$0.00; $5.75; $50.00; $1,000.00
2.6
Başka Kesikli Rassal Değişken
Örnekleri
• Bir yıl boyunca doktor ziyaretlerinin sayısı
• Araba kredisinin ödemeleri kaç defa geç
yapıldı
• Bir ailenin toplam çocuk sayısı.
• Bir kişinin kaç hafta işsiz kaldığının sonucu.
• İstatistik sınıfının öğrenci sayıları.
Dummy Variable
-Gölge DeğişkenKesikli bir rassal değişkenlerin değeri
şayet kısıtlanmış ise bu değerlere gölge
Değişken denir. ( genelde kısıtlanmış değer
Olarak 0 veya 1 alınır).
Qualitetif farklılığı ortaya koymak için gölge değişkene
Çevirilir örneğin
cinsiyet sorularından alınan cevaplar (Erkek-0 ve Kadın-1)
Irk (Beyaz-0, Zenci-1)
Vatandaşlık US-0 TR-1
Gelir Sınıfı (0=Fakir, 1=Zengin).
2.7
Probability Distributions
-Olasılık DağılımıRassal değişkenlerin dağılımı nedir?
farklı sonuçların olasılıklarının birleşimi o serinin
olasılıklar dağılımını oluşturur.
Olasılıklar dağılımı farklı karakteristikleri yansıtır
ve bir kesikli rassal değişkenlerin göstereceği
dağılım ile sürekli değişkenlerden oluşan olasılıklar
dağılımı farklılık arz eder.
2.8
What is a Probability?
-Olasılık NedirKesikli değişkenlerden oluşan bir seride
X herhangi bir değişkeni temsil ederken
bu değişkenin belirli bir deneme
sonucunda gerçekleşme olasılığı
,x,olsun. Bunun anlamı tüm denemelerin
toplam sayısı ile bu denemelerde X
sonucunun kaç defa gerçekleştiği (ortaya
çıktığının) oranıdır.
2.9
2.10
Probability Distributions for Discrete Random Variables
-Kesikli Rassal Değişkenlerin Olasılıklar Dağılımı-
Burdan devam edın
Kesikli rassal değişkenler
A list of all of the possible values taken
by a discrete random variable along with
their chances of occurring is called a probability
function or probability density function (pdf).
It can be a table, a graph or a formula.
2.11
Experiment: roll a fair die. Let
random variable X = number of dots
showing.
die
one dot
two dots
three dots
four dots
five dots
six dots
x
1
2
3
4
5
6
f(x)
1/6
1/6
1/6
1/6
1/6
1/6
2.12
A discrete random variable X
has pdf, f(x), which is the probability
that X takes on the value x.
f(x) = P(X=x)
Therefore, 0  f(x)  1
If X takes on the n values: x1, x2, . . . , xn,
then f(x1) + f(x2)+. . .+f(xn) = 1.
2.13
Probability, f(x), for a discrete random
variable, X, can be represented by height
of a bar graph
0.4
0.3
f(x)
0.2
0.1
0
1
2
3
X
Random Variable X: Number on Dean’s List
of three roommates
2.14
Probability Distribution for a
Continuous Random Variable
Since a continuous random variable has an
uncountably infinite number of values,
the probability of one occurring is zero.
P[X=a] = 0
2.15
We can ask questions like, “What is the
probability that X is between a and b?
P[a < X < b] = ?
What does it mean? In an experiment, the
probability P[a < X < b] is the proportion of
the time, in many experiments, that X will fall
between a and b.
2.16
A continuous random variable uses
area under a curve rather than the
height, f(x), to represent probability:
f(x)
red area
0.1324
green area
0.8676
.
.
$34,000
$55,000
per capita income, X, in the United States
X
2.17
For a Continuous Random Variable
Probability is represented by area.
An interval for X is needed to get
an area under the curve.
Experiment: Randomly draw the name of an adult
person in the U.S. and let X=income. P[X> $55,000]=
.1324 this implies that 13.24% of adults have income
greater than $55,000.
2.18
The area under a curve is the integral of
the equation that generates the curve:
P[aXb]=

b
f(x) dx
a
For continuous random variables it is the
area under f(x), and not f(x) itself, which
defines the probability of an event.
Toplama Kuralı
n
Özellik 1:
xi = x1 + x2 + . . . + xn

i=1
n
Özellik 2:
i=1
n
n
 axi = a  xi
i=1
n
n
i=1
i=1
xi + yi =  xi +  yi

i=1
Özellik 3:
2.19
2.20
Toplama Kuralı
n
Özellik 4:
5:
Devam……
n
n
i=1
i=1
axi + byi = a  xi + b  yi

i=1
x
n
= n  xi =
i=1
1
x1 + x2 + . . . + xn
n
Beşinci Özellik için bir ilave özellikte şudur
n
xi x) = 0

i=1
2.21
Toplama Kuralı
Özellik 6:
devam….
n
f(xi) = f(x1) + f(x2) + . . . + f(xn)

i=1
Notation:
n m
x f(xi) = i f(xi) = i =1 f(xi)
Özellik 7 :  f(xi,yj) =
i=1 j=1
n
n
[ f(xi,y1) + f(xi,y2)+. . .+ f(xi,ym)]

i=1
Toplamdaki sıra önemli değildir
n m
m n
f(xi,yj)
  f(xi,yj) =j =

1 i=1
i=1 j=1
2.22
Rassal (Random) Değişkenin
Aritmetik Ortalaması
Rassal değişkenin aritmetik
ortalaması o serinin matematiksel
beklentileri (umulan) değerine eşittir.
E( X )
Expected Value
Beklenen Değer
E( X )
2.23
İki farklı tanım yapabiliriz fakat sonuçta elde
edilen değerler eşittir.
1. Empirically:
The expected value of a random variable, X,
is the average value of the random variable in an
infinite number of repetitions of the experiment.
Deneysel işlemlerin bir çok defa tekrarlandığında
Ortalama olarak kaç defa X değerinin tekrar ettiği
yada sonuçta ortaya çıktığının değeridir.
Expected Value
2.24
2. Analytically:
The expected value of a discrete random
variable, X, is determined by weighting all
the possible values of X by the corresponding
probability density function values, f(x), and
summing them up.
In other words:
E[X] = x1f(x1) + x2f(x2) + . . . + xnf(xn)
Örnek: Oyun Zarının Bir Defa Atılmasında
olası sonuçlarının ortalaması
2.25
E  X    xi f  xi 
6
i 1
 11 / 6  2 1 / 6  3 1 / 6  4 1 / 6
 5 1 / 6  6 1 / 6
 21 / 6  3.5
Yorumu: Çok büyük bir deneme sonucunda (10000
defa zarın atıldığını düşünün) zar sonuçlarının ortalama
degerinin e 3.5
Empirical vs. Analytical
2.26
Her iki yöntemin uygulanmasında elde edilecek
bulacağı sonuç aynı olacaktır şayet deneme
rakamı sonsuz gibi büyük bir rakam olduğunda
Ortalama değerlerde aynı olur.
The empirical method for computing expected values
can be used even when the probability distribution is
not known--for example when the die is not fair.
Population Mean vs. Sample Mean
2.27
Anakütle Ortalaması ve Örnek Kütle Ortalaması
Ana Kütle Ortalaması
=Umulan Deger(Expected value)
= Analytical mean
= =E[X]
= Birçok denemenin ortalaması
Sample mean
Örnek Kütle Ortalaması
Örnek Kütle Ortalaması = örnek kütlenin aritmetik
ortalamac bazi örnek kütle degerlerinin ortalaması =
Empirical Mean.
Örnek: T defa zar atarsak ve diyelimki xt t’ci zar
atışının ortalamazı (empirical ortalaması)…
T
x
 xt
t 1
T
2.28
X değerinin umulan (Beklenen) değeri:
2.29
n
EX =
xi f(xi)
i=1
X-karesi ….Umulan (Beklenen) değeri :
2
EX =
n
xi
2
i=1
f(xi)
Burdaki önemli özellik f(xi) hiçbir zaman degişmez!
X-küp (Beklenen) Umulan degeri:
3
EX =
n

xi
i=1
3
f(xi)
2.30
Kesikli Rassal Değişkenler`de X fonksiyonun
beklenen (umulan) değeri
Eg( X )   g( xi ) f ( xi )
n
i 1
• This is for discrete random variables. For
continuous random variables the rule is similar but
with “integration” replacing “summation.”
2.31
Expected Value of g(X)
Recall "Dean' s List" Example
x
0
1
2
3
f ( x ) .2 .4 .1 .3
X = number of 3 roommates on Dean’s List
2.32
EX
= 0 (.1) + 1 (.3) + 2 (.3) + 3 (.2) + 4 (.1)
= 1.9
2
2
2
2
2
2
EX = 0 (.1) + 1 (.3) + 2 (.3) + 3 (.2) + 4 (.1)
= 0 + .3 + 1.2 + 1.8 + 1.6
= 4.9
3
3
3
3
3
3
EX = 0 (.1) + 1 (.3) + 2 (.3) + 3 (.2) +4 (.1)
= 0 + .3 + 2.4 + 5.4 + 6.4
= 14.5
2.33
n
E[g(X)] =

g(xi)
i=1
f(xi)
g(X) = g1(X) + g2(X)
n
E[g(X)] =

g1(xi) + g2(xi)] f(xi)
i=1
n
E[g(X)] =
n

g1(xi) f(xi) +i 
g
(x
)
f(x
)
2
i
i
=1
i=1
E[g(X)] = E[g1(X)] + E[g2(X)]
Toplam ve Çıkarma
Rassal Değişkenler
2.34
E(X+Y) = E(X) + E(Y)
E(X-Y) = E(X) - E(Y)
Sabit bir sayının değişkene ilave
edilmesi :
E(X+a) = E(X) + a
Sabit bir sayının Çarpımı:
E(bX) = b E(X)
2.35
2.36
Varyans
var(X) = X degerlerinin
Ortalamadan sapmaların karesi
var(X) = expected value of the squared deviations
around the expected value of X.
2
var(X) = E [(X - EX) ]
2.37
2
var(X) = E [(X - EX) ]
2
var(X) = E [(X - EX) ]
2
2
= E [X - 2XEX + (EX) ]
2
2
= E(X ) - 2 EX EX + E (EX)
2
2
2
= E(X ) - 2 (EX) + (EX)
2
2
= E(X ) - (EX)
2
2
var(X) = E(X ) - (EX)
2.38
Kesikli Rassal Degişkenlerde
Varyans
n
var (X) =
)
(x
EX
)
(x
f
i
 i
2
i=1
Standart Sapma varyansın karekök degeridir.
2.39
Semboller
var X    
2
2
X
The standard deviation is denoted by
  var X   
2
2.40
Kesikli Rassal Degişken olan X”ler için
Varyans hesabi:
2
xi
f(xi)
(xi - EX)
(xi - EX) f(xi)
2
3
4
5
6
.1
.3
.1
.2
.3
2 - 4.3 = -2.3
3 - 4.3 = -1.3
4 - 4.3 = - .3
5 - 4.3 = .7
6 - 4.3 = 1.7
5.29 (.1) =
1.69 (.3) =
.09 (.1) =
.49 (.2) =
2.89 (.3) =
.529
.507
.009
.098
.867
n
 xi f(xi) = .2 + .9 + .4 + 1.0 + 1.8 = 4.3
i=1
n
2
(xi - EX) f(xi) = .529 + .507 + .009 + .098 + .867
= 2.01
i=1
2.41
Z = a + cX
var(Z) = var(a + cX)
2
= E [(a+cX) - E(a+cX)]
2
= c var(X)
2
var(a + cX) = c var(X)
Joint pdf
A joint probability density function,
f(x,y), provides the probabilities
associated with the joint occurrence
of all of the possible pairs of X and Y.
2.42
City College,NY Anket sonuçları
joint pdf
f(x,y)
vacation X = 0
homes
owned
X=1
college grads
in household
Y=2
Y=1
f(0,1)
.45
f(0,2)
.15
.05
f(1,1)
.35
f(1,2)
2.43
2.44
İki Random Değişkenin Beklenen
Değerlerinin hesabı
E[g(X,Y)] =   g(xi,yj) f(xi,yj)
i
j
E(XY) =   xi yj f(xi,yj)
i
j
E(XY) = (0)(1)(.45)+(0)(2)(.15)+(1)(1)(.05)+(1)(2)(.35)=.75
2.45
Marginal pdf
The marginal probability density functions,
f(x) and f(y), for discrete random variables,
can be obtained by summing over the f(x,y)
with respect to the values of Y to obtain f(x)
with respect to the values of X to obtain f(y).
f(xi) =  f(xi,yj)
j
f(yj) =  f(xi,yj)
i
Marginal Probabilitiess
Y=1
Y=2
2.46
marginal
pdf for X:
X=0
.45
.15
.60 f(X = 0)
X=1
.05
.35
.40 f(X = 1)
.50
.50
f(Y = 2)
marginal
pdf for Y:
f(Y = 1)
Conditional pdf
2.47
The conditional probability density
functions of X given Y=y , f(x|y),
and of Y given X=x , f(y|x),
are obtained by dividing f(x,y) by f(y)
to get f(x|y) and by f(x) to get f(y|x).
f(x,y)
f(x|y) =
f(y)
f(x,y)
f(y|x) =
f(x)
Conditional Probabilities
f(Y=1|X = 0)=.75
Y=1
.75
X=0
f(X=0|Y=1)=.90 .90
f(X=1|Y=1)=.10 .10
X=1
.45
Y=2
f(Y=2|X= 0)=.25
.25
.60
.15
.05 .35
.30
.70
f(X=0|Y=2)=.30
f(X=1|Y=2)=.70
.40
.125 .875
f(Y=1|X = 1)=.125
.50
2.48
.50 f(Y=2|X = 1)=.875
Independence
X and Y are independent random
variables if their joint pdf, f(x,y),
is the product of their respective
marginal pdfs, f(x) and f(y) .
f(xi,yj) = f(xi) f(yj)
for independence this must hold for all pairs of i and j
2.49
X & Y not independent
Y=1
Y=2
.50x.60=.30
.50x.60=.30
2.50
marginal
pdf for X:
X=0
.45
.15
.60 f(X = 0)
X=1
.05
.35
.40 f(X = 1)
.50x.40=.20
marginal
pdf for Y:
.50
f(Y = 1)
.50x.40=.20
.50
f(Y = 2)
The calculations
in the boxes show
the numbers
required to have
independence.
2.51
Statistical Independence
f ( x| y )  f ( x )
• P[X=x|Y=y]=P[X=x]
• Knowing Y=y does not affect
probability that X=x
2.52
Example: Promotion and Sex
M
Total
Promoted Not
Promoted
230
184
46
F
8
Sex
Total 54
32
40
216
270
2.53
Are Sex and Promotion
Statistically Independent?
P[ Prom.] = 54 / 270 =.20
46 / 270
P[ Prom.|male] =
.20
230 / 270
Yes, since conditonal and unconditional
probabilities are equal in this population
2.54
Covariance
The covariance between two random
variables, X and Y, measures the
linear association between them.
cov(X,Y) = E[(X - EX)(Y-EY)]
Note that variance is a special case of covariance.
2
cov(X,X) = var(X) = E[(X - EX) ]
2.55
cov(X,Y) = E [(X - EX)(Y-EY)]
cov(X,Y) = E [(X - EX)(Y-EY)]
= E [XY - X EY - Y EX + EX EY]
= E(XY) - EX EY - EY EX + EX EY
= E(XY) - 2 EX EY + EX EY
= E(XY) - EX EY
cov(X,Y) = E(XY) - EX EY
Y=1
X=0
.45
2.56
Y=2
.15
.60
EX=0(.60)+1(.40)=.40
X=1
.05
.50
.35
.50
EY=1(.50)+2(.50)=1.50
.40
covariance
cov(X,Y) = E(XY) - EX EY
= .75 - (.40)(1.50)
= .75 - .60
= .15
E(XY) = (0)(1)(.45)+(0)(2)(.15)+(1)(1)(.05)+(1)(2)(.35)=.75
Correlation
2.57
The correlation between two random
variables X and Y is their covariance
divided by the square roots of their
respective variances.
(X,Y) =
cov(X,Y)
var(X) var(Y)
Correlation is a pure number falling between -1 and 1.
Y=1
Y=2
2.58
EX=.40
2
2
2
EX=0(.60)+1(.40)=.40
X=0
.45
.05
X=1
.15
.35
.60
2
var(X) = E(X ) - (EX)
2
= .40 - (.40)
= .24
.40
cov(X,Y) = .15
.50
EY=1.50
2 2
2
.50
EY=1(.50)+2(.50)
2
2
var(Y) = E(Y ) - (EY)
= .50 + 2.0
= 2.50 - (1.50)2
= 2.50
= .25
correlation
(X,Y) =
cov(X,Y)
var(X) var(Y)
(X,Y) = .61
2
2.59
What does correlation look like??
=0
=.7
=.3
=.9
2.60
Zero Covariance & Correlation
Independent random variables
have zero covariance and,
therefore, zero correlation.
The converse is not true.
The Normal Distribution
Y~
f(y) =
2.61
2
N(, )
(y - )2
exp
2
1
2
2  2
f(y)

y
The Standardized Normal
Z = (y - )/
Z ~ N(,)
f(z) =
1
2
exp
- z2
2
2.62
2.63
Y ~ N(,2)
f(y)

P[Y>a]
= P
Y-

>
a
a-

= P Z >
y
a-

2.64
Y ~ N(,2)
f(y)

a
P[a<Y<b] = P
=
P
a-

a-

b
<
y
Y-

<Z<
<
b-
b-

