Documentos de Académico
Documentos de Profesional
Documentos de Cultura
DISTRIBUCIONES
MUESTRALES POR
SIMULACIÓN
Apunte de clase
Autor: Marcos Prunello
Revisado: Nora Arnesi
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
1
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
2
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
3
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
4
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
5
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
6
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
BIBLIOGRAFÍA CONSULTADA
SOFTWARE UTILIZADO
R Core Team (2014). R: A language and environment for statistical computing. R Foundation for Statistical
Computing, Vienna, Austria. URL http://www.R-project.org/.
7
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
CÓDIGO DE R
library(lattice)
library(gridExtra)
8
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
))}
print(hist.y.qq(1)[[1]], position=c(0,0.5,0.5,1), more=T)
print(hist.y.qq(2)[[1]], position=c(0.5,0.5,1,1), more=T)
print(hist.y.qq(3)[[1]], position=c(0,0,0.5,0.5), more=T)
print(hist.y.qq(4)[[1]], position=c(0.5,0,1,0.5), more=F)
print(hist.y.qq(1)[[2]], position=c(0,0.5,0.5,1), more=T)
print(hist.y.qq(2)[[2]], position=c(0.5,0.5,1,1), more=T)
print(hist.y.qq(3)[[2]], position=c(0,0,0.5,0.5), more=T)
print(hist.y.qq(4)[[2]], position=c(0.5,0,1,0.5), more=F)
9
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
prepanel = prepanel.qqmathline,
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})))}
print(hist.y.qq(1)[[1]], position=c(0,0.5,0.5,1), more=T)
print(hist.y.qq(2)[[1]], position=c(0.5,0.5,1,1), more=T)
print(hist.y.qq(3)[[1]], position=c(0,0,0.5,0.5), more=T)
print(hist.y.qq(4)[[1]], position=c(0.5,0,1,0.5), more=F)
print(hist.y.qq(1)[[2]], position=c(0,0.5,0.5,1), more=T)
print(hist.y.qq(2)[[2]], position=c(0.5,0.5,1,1), more=T)
print(hist.y.qq(3)[[2]], position=c(0,0,0.5,0.5), more=T)
print(hist.y.qq(4)[[2]], position=c(0.5,0,1,0.5), more=F)
# Histogramas
histogramas <- function(i){
tabla <- matrix( data = rnorm(cant * n[i], mean = mu, sd = sigma), nrow = n[i],
ncol = cant )
s2 <- apply(tabla,2,var)
y <- s2 * (n[i]-1) / (sigma^2)
return(
histogram(y,
type = "density",
main = list(paste("Distribución de la variancia muestral.\n", cant,
" muestras de tamaño n = ",n[i],".",sep=""), cex = 1.3),
xlab = list(expression( Y == (n-1) * S^2 / sigma^2), cex=1.1),
ylab = list("Densidad", cex=1.1),
col = "darkolivegreen3",
ylim = c(0,0.2),
xlim = c(0,70),
scales = list( tck=c(1,0), cex = 1.2),
10
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
)}
print(histogramas(1), position=c(0,0.5,0.5,1), more=T)
print(histogramas(2), position=c(0.5,0.5,1,1), more=T)
print(histogramas(3), position=c(0,0,0.5,0.5), more=T)
print(histogramas(4), position=c(0.5,0,1,0.5), more=F)
# Histogramas
histogramas <- function(i){
tabla <- matrix( data = rexp(cant * n[i], rate=1), nrow = n[i], ncol = cant )
s2 <- apply(tabla,2,var)
y <- s2 * (n[i]-1)
return(
histogram(y,
type = "density",
main = list(paste("Distribución de la variancia muestral.\n", cant,
" muestras de tamaño n = ",n[i],".",sep=""), cex = 1.3),
xlab = list(expression( Y == (n-1) * S^2 / sigma^2), cex=1.1),
ylab = list("Densidad", cex=1.1),
col = "darkolivegreen3",
ylim = c(0,0.14),
xlim = c(0,110),
scales = list( tck=c(1,0), cex = 1.2),
)}
print(histogramas(1), position=c(0,0.5,0.5,1), more=T)
print(histogramas(2), position=c(0.5,0.5,1,1), more=T)
print(histogramas(3), position=c(0,0,0.5,0.5), more=T)
print(histogramas(4), position=c(0.5,0,1,0.5), more=F)
11
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
12
[MÉTODOS ESTADÍSTICOS I] ESTUDIO DE DISTRIBUCIONES MUESTRALES POR SIMULACIÓN
13