01.11.2014 Views

Prácticas de Estadística en R - Departamento de Estadística e ...

Prácticas de Estadística en R - Departamento de Estadística e ...

Prácticas de Estadística en R - Departamento de Estadística e ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

60 6. Variables aleatorias<br />

Otras distribuciones univariantes cotinuas <strong>de</strong> interés son la Erlang, la Weibull o la<br />

beta.<br />

6.8. Variables aleatorias bidim<strong>en</strong>sionales<br />

A veces nos pue<strong>de</strong> interesar obt<strong>en</strong>er probabilida<strong>de</strong>s conjuntas <strong>de</strong> varias variables<br />

aleatorias, es <strong>de</strong>cir, buscamos:<br />

F (x, y) = P (X ≤ x, Y ≤ y) =<br />

∫ x ∫ y<br />

−∞ −∞<br />

f (x, y) dydx.<br />

El caso más simple es cuando las variables son in<strong>de</strong>p<strong>en</strong>di<strong>en</strong>tes. En este caso,<br />

P (X ≤ x, Y ≤ y) = P (X ≤ x)P (Y ≤ y)<br />

es <strong>de</strong>cir,<br />

por lo que<br />

F (x, y) = F (x)F (y) ,<br />

F (x, y) = P (X ≤ x, Y ≤ y) =<br />

∫ x<br />

∫ y<br />

f (x, y) dydx =<br />

∫ x<br />

f (x)dx<br />

∫ y<br />

f (y) dy.<br />

−∞ −∞<br />

−∞<br />

−∞<br />

Veamos algún ejemplo. Tomamos como <strong>de</strong>nsida<strong>de</strong>s la gamma <strong>de</strong> parámetros λ = 20<br />

y r = 10 y la normal <strong>de</strong> parámetros µ = 0 y σ = 1, po<strong>de</strong>mos repres<strong>en</strong>tar la función <strong>de</strong><br />

<strong>de</strong>nsidad conjunta mediante: mediante:<br />

> lam=20<br />

> r=10<br />

> x=seq(0,5,.05)<br />

> mu=0<br />

> sig=1<br />

> y=seq(-5,5,.05)<br />

> persp(x, y, outer(x,y,function(x,y){dgamma(x,lam,r)*dnorm(y,mu,sig)}),<br />

theta = 30,phi = 30, expand = 0.5, col = "lightblue",<br />

main="X: Gamma(20,10) Y: Normal(0,1)")<br />

Si tomamos como <strong>de</strong>nsida<strong>de</strong>s la expon<strong>en</strong>cial <strong>de</strong> parámetros λ = 20 y la normal<br />

<strong>de</strong> parámetros µ = 0 y σ = 1, po<strong>de</strong>mos repres<strong>en</strong>tar la función <strong>de</strong> <strong>de</strong>nsidad conjunta<br />

mediante:<br />

> lam=20<br />

> x=seq(0,0.5,.05)<br />

> mu=0<br />

> sig=1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!