distribuciÓn normal multidimensional. en particular, si n=2

20
DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL

Upload: daniel-enrique-navarro-montero

Post on 23-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

DISTRIBUCIÓN NORMAL

MULTIDIMENSIONAL

Page 2: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL

( )1

... , , ;nn

n

X

N matriz n n simétrica ydefinida nonegativa

X

m m

æ ö÷ç ÷ç ÷ç ÷Î S Î S ´ç ÷ç ÷ç ÷ç ÷÷çè ø

R

( ) ( ) ( )1

12 21

( ) 2 exp2

nt nf x x x xp m m

- - -ì üï ïï ïÛ = S - - S - " Îí ýï ïï ïî þ

r r r rR

En particular, si n=2

21 1 1 2

2 22 1 2 2

,X

NY

m s rs s

m rs s s

æ æ ööæ ö æ ö ÷÷ç ç÷ ÷ç ç ÷÷÷ ç ÷çÎ Ûç ç ÷÷÷ ÷ç çç ç ÷÷÷ ÷ç çç ç ÷÷ç çè ø è øè è øø

( )( ) ( ) ( )( )2 2

1 2 1 22 2 22

1 21 21 2

1 1, exp 2

2(1 )2 1

x y x yf x y

m m m mr

s sr s sps s r

ì æ öüï ï÷- - - -çï ï÷ï ïç ÷= + -çí ý÷çï ï÷- ç- ÷çï ïè øï ïî þ

Page 3: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

Por lo tanto,

2

0 1,

0 1

XN

Y

r

r

æ ö ææöæ öö÷ ÷ ÷÷ç çç ç÷ ÷ ÷÷Î Ûç çç ç÷ ÷ ÷÷ç çç ç÷ ÷ ÷÷ç çç çè ø èè øè øø

( ) ( )2 222

1 1, exp 2 ,

2(1 )2 1f x y x y xyr

rp r

ì üï ïï ïÛ = + -í ýï ï-- ï ïî þ

Equivalentemente a la consideración de normalidad anterior, se tiene que

2(0,1) ( ,1 ),YX N e N xX x

r rÎ Î -=

y en consecuencia, la función de regresión de Y sobre X será

( )( ) .Yy g x E xX x

r= = ==

{ }2 2( , )/ 2( , ) .

x y x y xy kf x y dxdy

ra

+ - £=ò

cuyas curvas de nivel serán tales quea 2 2 2x y xy kr+ - =

Page 4: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

NORMAL BIDIMENSIONAL: Código fuente en R que dibuja curvas de nivel y la función de regresión teórica. Compara por Monte Carlo el comportamiento bajo este modelo de diferentes estimadores da la función de regresión teórica: regresión lineal simple, polinómica de orden 2, Nadaraya-Watson y polinómica local de grado 1.

• require(lokern,KernSmooth,ellipse)• r=0.75• #plot(ellipse(r,scale=c(1,1),centre=c(0,0),level=0.95),lwd=2,type="l",xlim=c(-3,3),ylim=c(-3,3),main="Normal bidimensional (curva de nivel 0.95): r=0.75",sub="MODELO:

X=N(0,1), (Y/X=x)=N(rx,1-r^2)")• #polygon(ellipse(r,scale=c(1,1)),density=20,col=1)• x1<-seq(-3,3,length=1000)• y1<-r*x1• plot(x1,y1,lwd=2,col=7,type="l")• #legend("top",legend="Función de regresión teórica (recta)",lwd=2,col=7)• x<-rnorm(1000,0,1)• y<-r*x+rnorm(1000,0,1-(r^2))• lines(x,y,type="p",xlim=c(-3,3),ylim=c(-3,3),main="Función de regresión",sub="MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2), r=0.5; N=100000")

• poli1<-lm(y~x)• abline(poli1,lwd=2,col=3)

• poli2<-lm(y~x+I(x^2))• df<-data.frame(x=x1)• y1<-predict(poli2,df)• lines(x1,y1,lwd=2,col=5)

• v<-dpill(x,y)• lines(locpoly(x,y,bandwidth=v,gridsize=length(x1),range.x=c(-3,3)),type="l",lwd=2,col=4) #corrige efecto frontera

• res<-glkerns(x,y)• lines(ksmooth(x,y,"normal",bandwidth=res$bandwidth,range.x=c(-3,3),n.points=length(x1)),lwd=2,col=2)• #lines(ksmooth(x,y,bandwidth=0.5),lwd=2,col=2)• legend("top",legend=c("Función de regresión teórica","Estimación por regresión polinómica (grado 1: recta)"• ,"Estimación por regresión polinómica (grado 2)","Estimación por regresión lineal local","Estimación por Nadaraya-Watson"),lwd=2,col=c(7,3,5,4,2))

Page 5: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=-1

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 6: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=-0.75

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 7: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=-0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 8: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=-0.25

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 9: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 10: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.25

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 11: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 12: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.75

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 13: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=1

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

1 2

1 2

0

1

Page 14: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

1 2

1 2

0

2; 1

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

x

y

Page 15: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

1 2

1 2

0

1; 2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

x

y

Page 16: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2)x

y

Función de regresión teórica (recta)

1 2

1 2

0

1

Page 17: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2); N=10x

y

Función de regresión teóricaEstimación por regresión polinómica (grado 1: recta)Estimación por regresión polinómica (grado 2)Estimación por regresión lineal localEstimación por Nadaraya-Watson

1 2

1 2

0

1

Page 18: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2); N=100x

y

Función de regresión teóricaEstimación por regresión polinómica (grado 1: recta)Estimación por regresión polinómica (grado 2)Estimación por regresión lineal localEstimación por Nadaraya-Watson

1 2

1 2

0

1

Page 19: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2); N=1000x

y

Función de regresión teóricaEstimación por regresión polinómica (grado 1: recta)Estimación por regresión polinómica (grado 2)Estimación por regresión lineal localEstimación por Nadaraya-Watson

1 2

1 2

0

1

Page 20: DISTRIBUCIÓN NORMAL MULTIDIMENSIONAL. En particular, si n=2

-3 -2 -1 0 1 2 3

-3-2

-10

12

3

Normal bidimensional (curva de nivel 0.95): r=0.5

MODELO: X=N(0,1), (Y/X=x)=N(rx,1-r^2); N=10000x

y

Función de regresión teóricaEstimación por regresión polinómica (grado 1: recta)Estimación por regresión polinómica (grado 2)Estimación por regresión lineal localEstimación por Nadaraya-Watson

1 2

1 2

0

1