lectu ra

21
Lectura: Valores esperados, Covarianza y Correlaci ´ on. Lina Mar´ ıa Acosta Avena * ASESORIAS: LUNES DE 4:00 pm - 6:00 pm. VIERNES DE 9:00 am - 11:00 am, B43-103 Escuela de Estad´ ıstica Universidad Nacional de Colombia, Sede Medellin [email protected] * Estudiante de la Maestr´ ıa en Ciencias Estad´ ıstica Estad´ ıstica I. 1

Upload: stiiven-mg

Post on 05-Jan-2016

215 views

Category:

Documents


1 download

DESCRIPTION

estadistik

TRANSCRIPT

Page 1: Lectu Ra

Lectura: Valores esperados, Covarianza y Correlaci on.

Lina Marıa Acosta Avena*

ASESORIAS: LUNES DE 4:00 pm - 6:00 pm. VIERNES DE

9:00 am - 11:00 am, B43-103

Escuela de Estadıstica

Universidad Nacional de Colombia, Sede Medellin

[email protected]

*Estudiante de la Maestrıa en Ciencias Estadıstica

Estadıstica I.

1

Page 2: Lectu Ra

VALORES ESPERADOS

Definici on:Sean X y Y variables aleatorias conjuntamente distribuıdas con funcion masa

de probabilidad p(x,y) o funcion de densidad de probabilidad f (x,y) ya sea

que las variables sean discretas o continuas. Entonces el valor esperado de

una funcion g(X,Y), denotado por E[g(X,Y)] esta dado por

E[g(X,Y)] =

∑x

∑y

g(X,Y)p(x,y) ;Si X y Y son discretas∫ ∞

−∞

∫ ∞

−∞g(X,Y) f (x,y)dxdy ;Si X y Y son continuas

Estadıstica I.

2

Page 3: Lectu Ra

COVARIANZAS

Definici on:Sean X y Y variables aleatorias conjuntamente distribuıdas con funcion masa

de probabilidad p(x,y) o funcion de densidad de probabilidad f (x,y) ya sea

que las variables sean discretas o continuas. La covarianza* entre dos vari-

ables aleatorias X y Y, denotado por Cov(X,Y)= E[(X−µx)(Y−µy)] esta da-

do por

Cov(X,Y)=

∑x

∑y(x−µx)(y−µy)p(x,y) ;Si X y Y son discretas

∫ ∞

−∞

∫ ∞

−∞(x−µx)(y−µy) f (x,y)dxdy ;Si X y Y son continuas

*Mide la relacion lineal entre dos variables

Estadıstica I.

3

Page 4: Lectu Ra

COVARIANZAS

TEOREMA:Sean X y Y dos variables aleatorias con media µx y µy, respectivamente. En-

tonces

Cov(X,Y) = E[XY]−µxµy

Dm:

Cov(X,Y) = E[(X−µx)(Y−µy)]

= E[XY−Xµy−µxY +µxµy]

= E[XY]−E[Xµy]−E[µxY]+E[µxµy]

= E[XY]−E[X]µy−µxE[Y]+µxµy

= E[XY]−µxµy−µxµy+µxµy

= E[XY]−µxµy

Estadıstica I.

4

Page 5: Lectu Ra

CORRELACION

Definici on:El coeficiente de correlacion* de X y Y, denotado por Corr(X,Y) o ρxy o

simplemente ρ esta definido por

ρxy =Cov(X,Y)

σxσy

*Mide el grado de relacion lineal entre las variables

Estadıstica I.

5

Page 6: Lectu Ra

CORRELACION

TEOREMA:

1. Sean a,b,c y d cuatro constantes. Si a y c son ambas positivas o ambasnegativas, se tiene que

Corr(aX+b,cY+d) = Corr(X,Y)

2. Para dos variables aleatorias cualesquiera X y Y, se tiene que

−1 ≤Corr(X,Y) ≤ 1

Dm: Sabemos que

ρ =Cov(X,Y)

σxσy

Estadıstica I.

6

Page 7: Lectu Ra

CORRELACION

Cov(aX+b,cY+d) = E[(aX+b−µaX+b)(cY+d−µcY+d)]

= E[(aX+b−E[aX+b])(cY+d−E[cY+d])]

= E[(aX+b−aE[X]−b)(cY+d−cE[Y]−d)]

= E[a(X−E[X])c(Y−E[Y])]

= acE[(X−E[X])(Y−E[Y])] = acCov(X,Y)

σ2(aX+b) = Var[aX+b] = a2Var[X] = a2σ2

x =⇒ σ(aX+b) = aσx

σ2(cY+d) = Var[cY+d] = c2Var[Y] = c2σ2

y =⇒ σ(cY+d) = cσy

ρ =Cov(aX+b,cY+d)

σ(aX+b)σ(cY+d)=

acCov(X,Y)

(aσx)(cσy)=

Cov(X,Y)

σxσy= Corr(X,Y)

Estadıstica I.

7

Page 8: Lectu Ra

EJEMPLOS

1. La funcion de distribucion de una variable aleatoria bidimensional (X,Y)

es f (x,y) = 2, 0 ≤ x≤ 1, 0 ≤ y≤ x.

Encuentre la correlacion entre X y Y

Sln:

Se sabe que la correlacion ρ entre X y Y se calcula como

ρ =Cov(X,Y)

σxσy

Ası que se debe hallar la desviacion estandar de X, la desviacion estandar de

Y y la covarianza entre X y Y.

Estadıstica I.

8

Page 9: Lectu Ra

EJEMPLOS

Recuerde dibujar el espacio de positividad de las variables , ya que estas

son dependientes, pues 0 ≤ y≤ x

Se sabe que Var[X] = E[X2]− (E[X])2

E[X] y E[X2] lo podemos hallar de dos formas: usando la f.d.p.c de X y Y, o

usando la funcion de densidad marginal de X.

Estadıstica I.

9

Page 10: Lectu Ra

EJEMPLOS

• Para E[X]

Forma 1: Usando la f.d.p.c

E[X] =∫ ∞

−∞

∫ ∞

−∞x f(x,y)dydx=

∫ 1

0

∫ x

0x(2)dydx

= 2∫ 1

0

(

xy

x

0

)

dx= 2∫ 1

0x2dx

= 2

(

x3

3

)

1

0=

23

Estadıstica I.

10

Page 11: Lectu Ra

EJEMPLOS

Forma 2: Usando la f.d.p. marginal de X

f (x) =∫ x

02dy= 2y

x

0= 2x ; 0 ≤ x≤ 1

E[X] =∫ 1

0x(2x)dx

= 2∫ 1

0x2dx

= 2

(

x3

3

)

1

0=

23

Estadıstica I.

11

Page 12: Lectu Ra

EJEMPLOS

• Ahora para E[X2]

Forma 1: Usando la f.d.p.c

E[X2] =∫ ∞

−∞

∫ ∞

−∞x2 f (x,y)dydx=

∫ 1

0

∫ x

0x2(2)dydx

= 2∫ 1

0

(

x2y

x

0

)

dx= 2∫ 1

0x3dx

= 2

(

x4

4

)

1

0=

24

=12

Estadıstica I.

12

Page 13: Lectu Ra

EJEMPLOS

Forma 2: Usando la f.d.p. marginal de X

E[X2] =∫ 1

0x2(2x)dx

= 2∫ 1

0x3dx

= 2

(

x4

4

)

1

0=

24

=12

Ası

σ2x = Var[X] =

12−(

23

)2=

118

=⇒ σx =1

√18

Estadıstica I.

13

Page 14: Lectu Ra

EJEMPLOS

• Para E[Y]

Forma 1: Usando la f.d.p.c

E[Y] =∫ ∞

−∞

∫ ∞

−∞y f(x,y)dydx=

∫ 1

0

∫ x

0y(2)dydx

= 2∫ 1

0

(

y2

2

x

0

)

dx=∫ 1

0x2dx

=x3

3

1

0=

13

Estadıstica I.

14

Page 15: Lectu Ra

EJEMPLOS

Forma 2: Usando la f.d.p. marginal de Y

f (y) =∫ 1

y2dx= 2x

1

y= 2(1−y) ; 0 ≤ y≤ 1

E[Y] =∫ 1

0y[2(1−y)]dy= 2

∫ 1

0(y−y2)dy

= 2

(

y2

2−

y3

3

)

1

0

= 2

(

12−

13

)

= 2

(

16

)

=13

Estadıstica I.

15

Page 16: Lectu Ra

EJEMPLOS

• Ahora para E[Y2]

Forma 1: Usando la f.d.p.c

E[Y2] =∫ ∞

−∞

∫ ∞

−∞y2 f (x,y)dydx=

∫ 1

0

∫ x

0y2(2)dydx

= 2∫ 1

0

(

y3

3

x

0

)

dx=23

∫ 1

0x3dx

=23

(

x4

4

)

1

0=

23

(

14

)

=16

Estadıstica I.

16

Page 17: Lectu Ra

EJEMPLOS

Forma 2: Usando la f.d.p. marginal de Y

E[Y2] =∫ 1

0y2[2(1−y)]dy= 2

∫ 1

0(y2−y3)dy

= 2

(

y3

3−

y4

4

)

1

0

= 2

(

13−

14

)

= 2

(

112

)

=16

Ası

σ2y = Var[Y] =

16−(

13

)2=

118

=⇒ σy =1

√18

Estadıstica I.

17

Page 18: Lectu Ra

EJEMPLOS

Se sabe que Cov(X,Y) = E[XY]−E[X]E[Y]

E[XY] =∫ ∞

−∞

∫ ∞

−∞xy f(x,y)dydx=

∫ 1

0

∫ x

0xy(2)dydx

= 2∫ 1

0

(

xy2

2

x

0

)

dx=∫ 1

0x3dx

=x4

4

1

0=

14

Luego, Cov(X,Y) = 14 −(

23

)(

13

)

= 136 y ası

ρ =1/36

(1/√

18)(1/√

18)=

1/361/18

=12

Estadıstica I.

18

Page 19: Lectu Ra

EJEMPLOS

2. Sean X y Y variables aleatorias independientes tales que

f (x) = 3x2, 0 < x < 1 f (y) = 2y, 0 < y < 1. Calcule la probabilidad

de P(X < 1/2,Y < 1/2)

Sln: Se puede hacer de dos formas

(a) Usando la f.d.p.c de X y Y,

f (x,y) = f (x) f (y) = (3x2)(2y) = 6x2y, 0 < x < 1, 0 < y < 1

Estadıstica I.

19

Page 20: Lectu Ra

EJEMPLOS

P(X < 1/2,Y < 1/2) =∫ 1/2

0

∫ 1/2

0(6x2y)dydx

=62

∫ 1/2

0

(

x2y2∣

1/2

0

)

dx

= 3∫ 1/2

0x2(

12

)2dx= 3

14

(

x3

3

)

1/2

0

=14

(

18

)

=1

32

Estadıstica I.

20

Page 21: Lectu Ra

EJEMPLOS

(b) Usando las marginales,

P(X < 1/2,Y < 1/2) = P(X < 1/2)P(Y < 1/2) porque X y Y son independientes

=

(

∫ 1/2

03x2dx

)(

∫ 1/2

02ydy

)

= 3x3

3

1/2

02

y2

2

1/2

0

=18

(

14

)

=1

32

Estadıstica I.

21