Propiedades de los estimadores

La simulación ayuda a entender y validad las propiedades de los estimadores estadísticos como son. insesgadez, eficiencia y la consistencia principalmente. El siguiente problema permite evidenciar las principales características de un grupo de estimadores propuestos para la estimación de un parámetro asociado a un modelo de probabilidad.

Sean X1, X2, X3 y X4, una muestra aleatoria de tamaño n=4, cuya población la conforma una distribución exponencial con parámetro θ desconocido. Determine las características de cada uno de los siguientes estimadores propuestos:

Estimador 1

\[ \hat{\theta}_1=[\frac{(X_1+X_2)}{6}+\frac{(X_3+X_4)}{3}] \]

Estimador 2

\[ \hat{\theta}_2=[\frac{(X_1+2X_2+3X_3+4X_4)}{5}] \]

Estimador 3

\[\hat{\theta}_3=[\frac{(X_1+X_2+X_3+X_4)}{4}]\]

Estimador 4

\[ \hat{\theta}_4=[\frac{\min(X_1+X_2+X_3+X_4)+\max(X_1+X_2+X_3+X_4)}{2}] \]

Ejercicio

  1. Genere una muestras de n=20, 50, 100 y 1000 para cada uno de los estimadores planteados.

  2. En cada caso evalue las propiedades de insesgadez, eficiencia y consistencia

Solución

  1. Generamos la muestras de n=20, 50, 100 y 1000 para cada uno de los estimadores planteados.

20 replicas del experimento

lambda <- 3                               # suponemos valor para rate=3
n <- 4                                     # n: tamaño de muestra
m1 <- 20                                   
ym1 <- rexp(m1, rate=lambda)           
mx1 <- matrix(ym1,nrow = m1,ncol = n, byrow = TRUE)
head(mx1)
##            [,1]       [,2]        [,3]      [,4]
## [1,] 0.04680716 0.05088842 0.151228231 1.0016485
## [2,] 0.59140181 0.12316072 0.744878132 0.4428063
## [3,] 0.78793152 0.59646365 0.339109094 0.2638310
## [4,] 0.08024318 0.92756573 0.106144502 0.6798952
## [5,] 0.12822531 0.17908298 0.009080873 0.1872319
## [6,] 0.04680716 0.05088842 0.151228231 1.0016485

50 replicas del experimento

m2 <- 50
ym2 <- rexp(m2, rate=lambda)           
mx2 <- matrix(ym2,nrow = m2,ncol = n, byrow = TRUE)
head(mx2)
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.54197339 0.31789042 0.12813156 0.16787508
## [2,] 0.07356873 0.93363493 0.06326085 0.38821204
## [3,] 0.23070659 0.02627067 0.13313003 0.14087698
## [4,] 0.49691147 0.02940836 0.03518005 0.14251150
## [5,] 0.25638144 0.55914121 0.20239743 0.06845060
## [6,] 0.33413444 0.40276692 0.20895782 0.03936883

100 replicas del experimento

m3 <- 100
ym3 <- rexp(m3, rate=lambda)           
mx3 <- matrix(ym3,nrow = m3,ncol = n, byrow = TRUE)
head(mx3)
##            [,1]      [,2]       [,3]      [,4]
## [1,] 0.16812461 0.2536670 0.29383400 0.6448410
## [2,] 0.70022706 0.1661566 0.37224164 0.3936270
## [3,] 0.50018129 0.5184938 0.06617143 0.6616912
## [4,] 0.18287040 0.5711591 1.19620209 0.5885298
## [5,] 0.27696724 0.4324722 0.24366926 0.7194888
## [6,] 0.03734332 0.1724717 0.44756411 0.3756995

1000 replicas del experimento

m4 <- 1000
ym4 <- rexp(m4, rate=lambda)           
mx4 <- matrix(ym4,nrow = m4,ncol = n, byrow = TRUE)

head(mx4)
##           [,1]       [,2]       [,3]       [,4]
## [1,] 0.3162996 0.43945374 0.29872942 0.57174892
## [2,] 0.3765764 0.08899359 0.10269711 0.11644753
## [3,] 0.1841000 0.06048815 0.16234790 0.03315826
## [4,] 0.5554899 0.12449076 0.21894954 0.59655666
## [5,] 0.1507025 0.14394873 0.02453441 0.69383187
## [6,] 0.1193144 0.03445205 0.50146302 0.39197964
  1. Evaluamos la insesgadez, eficiencia y consistencia para θ1, θ2, θ3, y θ4

Modelado matemático

si suponemos un valor para el parametro θ

\[ (\theta)=parámetro[\beta= E(_X),\beta^{2} = V(_X)],\lambda=3\]


Insesgadez:

Para θ1:

\[ \hat{\theta}_1=[\frac{(X_1+X_2)}{6}+\frac{(X_3+X_4)}{3}]\]

\[\Rightarrow E[\hat{\theta}_1]=E[\frac{(X_1+X_2)}{6}+\frac{(X_3+X_4)}{3}] \]

\[\Rightarrow[\frac{(1)}{6}(EX_1+EX_2)+\frac{(1)}{3}(EX_3+EX_4)\]

\[\Rightarrow[\frac{(1)}{6}\beta+\beta+\frac{(1)}{3}\beta+\beta]\]

\[\Rightarrow[\frac{(2\beta)}{6}+\frac{(2\beta)}{3}]\]

\[\Rightarrow[\frac{(6\beta)+(12\beta)}{18}]\]

\[\Rightarrow[\frac{(18\beta)}{18}]\]

\[\Rightarrow E[\hat{\theta}_1]=\beta \]


Para θ2:

\[ \hat{\theta}_2=[\frac{(X_1+2X_2+3X_3+4X_4)}{5}] \] \[\Rightarrow E[\hat{\theta}_2]=2\beta \]


Para θ3:

\[\hat{\theta}_3=[\frac{(X_1+X_2+X_3+X_4)}{4}]\]

\[\Rightarrow E[\hat{\theta}_3]=\beta \]


Para θ4:

\[\hat{\theta}_4=[\frac{\min(X_1+X_2+X_3+X_4)+\max(X_1+X_2+X_3+X_4)}{2}]\]

\[\Rightarrow E[\hat{\theta}_4]=\beta \]

El resultado de la estimación para θ2 es de 2β por tanto se dice que hay sesgo. en cambio para el estimador θ4 la estimación tiene como resultado β es decir, es insesgado


Eficiencia:

Para θ1:

\[ \hat{\theta}_1=[\frac{(X_1+X_2)}{6}+\frac{(X_3+X_4)}{3}]\]

\[\Rightarrow V[\hat{\theta}_1]=V[\frac{(X_1+X_2)}{6}+\frac{(X_3+X_4)}{3}] \]

\[\Rightarrow[\frac{(1)}{36}(VX_1+VX_2)+\frac{(1)}{9}(VX_3+VX_4)\]

\[\Rightarrow[\frac{(1)}{36}\beta^2+\beta^2+\frac{(1)}{9}\beta^2+\beta^2]\]

\[\Rightarrow[\frac{(2\beta^2)}{36}+\frac{(2\beta^2)}{9}]\]

\[\Rightarrow[\frac{(18\beta^2)+(72\beta^2)}{324}]\]

\[\Rightarrow[\frac{(90\beta^2)}{324}]\]

\[\Rightarrow V[\hat{\theta}_1]=[\frac{(10\beta^2)}{36}] \]


Para θ2:

\[ \hat{\theta}_2=[\frac{(X_1+2X_2+3X_3+4X_4)}{5}] \] \[\Rightarrow V[\hat{\theta}_2]=[\frac{(2\beta^2)}{5}] \]


Para θ3:

\[\hat{\theta}_3=[\frac{(X_1+X_2+X_3+X_4)}{4}]\]

\[\Rightarrow V[\hat{\theta}_3]=[\frac{(1\beta^2)}{4}] \]


Para θ4:

\[\hat{\theta}_4=[\frac{\min(X_1+X_2+X_3+X_4)+\max(X_1+X_2+X_3+X_4)}{2}]\]

\[\Rightarrow V[\hat{\theta}_4]=\beta^2 \]

Cálculo en R

calculamos los cuatro estimadores para las 1000 replicas del experimento

estimador_t1 <- numeric()
estimador_t2 <- numeric()
estimador_t3 <- numeric()
estimador_t4 <- numeric()

for (x in 1:1000)
{
  
  estimador_t1[x] <- ((mx4[x,1] + mx4[x,2])/6) + ((mx4[x,3] + mx4[x,4])/3)
  
  estimador_t2[x] <- ((mx4[x,1] + 2*mx4[x,2]+3*mx4[x,3] + 4*mx4[x,4])/5)
  
  estimador_t3[x] <- ((mx4[x,1] + mx4[x,2] + mx4[x,3] + mx4[x,4])/4)
  
  estimador_t4[x] <- (min(mx4[x,1],mx4[x,2],mx4[x,3],mx4[x,4]) + max(mx4[x,1],mx4[x,2],mx4[x,3],mx4[x,4]))/2 

  
}

Media, Mediana y SD

df_estimadores <- data.frame(estimador_t1,estimador_t2,estimador_t3,estimador_t4)
head(df_estimadores)
medias_t <- apply(df_estimadores,2,mean)
medias_t
## estimador_t1 estimador_t2 estimador_t3 estimador_t4 
##    0.3252722    0.6493294    0.3233321    0.3749230
desviacion_estandar <- apply(df_estimadores,2,sd)
desviacion_estandar
## estimador_t1 estimador_t2 estimador_t3 estimador_t4 
##    0.1742197    0.3694743    0.1667963    0.2148245
medianas_t <- apply(df_estimadores,2,median)
medianas_t
## estimador_t1 estimador_t2 estimador_t3 estimador_t4 
##    0.2961270    0.5826887    0.2945638    0.3257200

Gráfica Estimadores

boxplot(df_estimadores, # Datos
        ylim=c(0,1.5),
        horizontal = FALSE, # Horizontal o vertical
        lwd = 2, # Lines width
        col = "violet", # Color
        xlab = "Etiqueta eje X",  # Etiqueta eje X
        ylab = "Etiqueta eje Y",  # Etiqueta eje Y
        main = "Propiedades de los estimadores", # Título
        notch = FALSE, # Añade intervalos de confianza para la mediana
        border = "black",  # Color del borde del boxplot
        lty = 1) # Tipo de línea (caja y mediana)

h_t4 <- median(medianas_t)

abline (h = h_t4, col = 'blue', lwd = 3)

Conclusión

De lo anterior se puede demostrar que el estimador con mayor insesgadez y eficiencia es θ4, lo cual prueba el modelado matemático