Documentos de Académico
Documentos de Profesional
Documentos de Cultura
𝑦𝑡 = (𝑥𝑡 + 𝛽)𝑢𝑡
Donde 𝑦𝑡 representa niveles de renta, 𝑥𝑡 niveles de educación y 𝑢𝑡 es una variable aleatoria de
1 1
distribución exponencial con 𝜆 = 1 , es decir 𝐸(𝑢𝑡 ) = 𝜆 = 1 y 𝐸(𝑢𝑡 2 ) = 𝜆2 = 1 por lo que
𝐸(𝑦𝑡 ) = (𝑥𝑡 + 𝛽) y 𝑉(𝑦𝑡 ) = (𝑥𝑡 + 𝛽)2 .
1 −𝑦𝑡
𝑓(𝑦𝑡 , 𝑥𝑡 , 𝛽) = 𝑒 𝑡+𝛽
𝑥
𝑥𝑡 + 𝛽
Dada las observaciones de la tabla 2:
2. Contrasta 𝐻0 : 𝛽 = 10 mediante los estadísticos LR, Wald Y LM. En el caso de los estadísticos
1 𝜕2 𝑙𝑛𝐿
de Wald y LM utiliza 𝐵̃ = − 𝐸( ). Compara e interpreta los resultados.
𝑇 𝜕𝛽𝜕𝛽
SOLUCIÓN.
Estimamos el Beta :
> LogL <- function(B){
beta<- B[1]
LL <- (-sum(log(educacion+B))-sum(renta/(educacion+B)))
}
>
> starting.values <- c ( 0.0 )
>
> LogL.opt <- maxLik(LogL,start= starting.values,
print.level=3,
+ method="BFGS")
Initial function value: -95.34443
Initial gradient value:
[1] 1.513381
initial value 95.344429
iter 2 value 93.379930
iter 3 value 90.267990
iter 4 value 89.122279
iter 5 value 89.065062
iter 6 value 88.505787
iter 7 value 88.445434
iter 8 value 88.445009
iter 9 value 88.436292
iter 10 value 88.436263
iter 10 value 88.436263
final value 88.436263
converged
> LogL.opt$maximum
[1] -88.43626
> LogL.opt$estimate
[1] 15.59981
> LogL.opt$hess
[,1]
[1,] -0.01421085
Por lo tanto, el Beta tiene un valor de 𝛽 = 15,59981 , además, la altura del monte es de
-88,43 y el Hessiano sale -0,014210985.
2.1 CONTRASTE LR
𝐿𝑅 = 2 (𝑙𝑛𝐿(𝛽̃ ) − 𝑙𝑛𝐿(𝛽̃𝑅 )) → 𝜒 2 𝑟
𝑡 𝑡
𝑦𝑡
𝑙𝑛𝐿(𝛽̃ ) = − ∑ 𝑙𝑛 (𝑥𝑡 + 𝛽̃ ) − ∑
𝑖=1
𝑥 + 𝛽̃
𝑖=1 𝑡
𝑡 𝑡
𝑦𝑡
𝑙𝑛𝐿(𝛽̃𝑅 ) = 𝑙𝑛𝐿(𝛽) = − ∑ 𝑙𝑛 (𝑥𝑡 + 𝛽) − ∑
𝑥𝑡 + 𝛽
𝑖=1 𝑖=1
# modelo no restringido
> LogL_MNR <- function(B){
+ beta<- B[1]
+ MNR<- (-sum(log(educacion+B))-sum(renta/(educacion+B)))
+ }
> MV_MNR <- maxBFGS(LogL_MNR, start=c(0.0), print.level=2)
initial value 95.344429
iter 2 value 93.379930
iter 3 value 90.267990
iter 4 value 89.122279
iter 5 value 89.065062
iter 6 value 88.505787
iter 7 value 88.445434
iter 8 value 88.445009
iter 9 value 88.436292
iter 10 value 88.436263
iter 10 value 88.436263
final value 88.436263
converged
> summary(MV_MNR)
--------------------------------------------
BFGS maximization
Number of iterations: 11
Return code: 0
successful convergence
Function value: -88.43626
Estimates:
estimate gradient
[1,] 15.59981 6.311041e-05
--------------------------------------------
> lnL_MNR <-(-sum(log(educacion+MV_MNR$estimate))-sum((renta/(educacio
n+MV_MNR$estimate))))
> lnL_MNR
[1] -88.43626
#modelo restringido
> LogL_MR <- function(B){
+ beta<- 10
+ MR<- (-sum(log(educacion+10))-sum(renta/(educacion+10)))
+ }
> MV_MR <- maxBFGS(LogL_MR, start=c(0.0), print.level=2)
initial value 88.883320
iter 1 value 88.883320
final value 88.883320
converged
> summary(MV_MR)
--------------------------------------------
BFGS maximization
Number of iterations: 1
Return code: 0
successful convergence
Function value: -88.88332
Estimates:
estimate gradient
[1,] 0 0
--------------------------------------------
𝐿𝑅 = 0.8941
Si comparamos con respecto a una 𝜒 2 (0.05,1) = 3.84
𝐿𝑅 < 𝜒2
por lo tanto, no rechazamos 𝐻0 ,es decir, el valor es 𝛽 = 10.
Este estadístico tiene solo en cuenta la diferencia entre los valores de la función de
verosimilitud de 𝑙𝑛𝐿(10) y 𝑙𝑛𝐿(𝛽̃ ).
𝑡
1 1
𝛽̃ = ∑
𝑇 (𝑥𝑡 + 𝛽)2
𝑖=1
−1 −1
𝑡
′ 1 1
𝑊 = 𝑇(𝛽̃ − 10) [1′ . ( ∑ ) . 1] . (𝛽̃ − 10)
𝑇 (𝑥𝑡 + 𝛽)2
𝑖=1
(𝛽̃ − 10)2
𝑊=
1
∑𝑡𝑖=1
(𝑥𝑡 + 𝛽)2
> wald<-(MV_MNR$estimate-10)^2/sum(1/((educacion+10)^2))
> wald
[1] 906.5321
𝑊 = 906.5321
Si comparamos con respecto a una 𝜒 2 (0.05,1) = 3.84
𝑊 > 𝜒2
por lo tanto, rechazamos 𝐻0 ,es decir, el valor es 𝛽 ≠ 10.
EL Estadístico de Wald tiene en cuenta tanto la diferencia entre los valores 𝛽̃ y 10 como
la curvatura de la función de verosimilitud 𝑙𝑛𝐿(𝛽) evaluada en 𝛽 = 𝛽̃. Dos muestras distintas
pueden producir el mismo valor de (𝛽̃ − 10)2 pero una de ellas puede ser menos favorables
para realizar el contraste H0 : β = 10 como ha sucedido en este caso , sin embargo esta función
de verosimilitud indica más precisión y por lo tanto (𝛽̃ − 10) es relativamente más grande.
2.3 Contraste LM
1 ′ −1
𝐿𝑀 = 𝑆̃(𝜃̃𝑅 ) 𝐵̃(𝜃̃𝑅 ) 𝑆̃(𝜃̃𝑅 )
𝑇
Para este caso tenemos:
𝑡 𝑡
𝜕𝑙𝑛𝐿(𝛽) 1 𝑦𝑡
𝑆(10) = ( )| =−∑ +∑
𝜕𝛽 (𝑥𝑡 + 10) (𝑥
2
𝛽=10 𝑖=1 𝑖=1 𝑡 + 10)
𝑡
1 𝜕2 𝑙𝑛𝐿(𝛽) 1 1
𝛽̃ (10) = − (𝐸 ( ))| = −( ∑ )|
𝑇 𝜕𝛽𝜕𝛽 𝑇 ( 𝑥𝑡 + 𝛽 ) 2
𝛽=10 𝑖=1 𝛽=10
𝑡
1 1
𝛽̃ (10) = ∑
𝑇 (𝑥𝑡 + 10)2
𝑖=1
De esta forma:
1 ̃ (10)−1 𝑆(10)
𝐿𝑀 = 𝑆(10)′ 𝛽
𝑇
1 ̃ (10)−1
𝐿𝑀 = 𝑆(10)2 𝛽
𝑇
2 −1
𝑡 𝑡 𝑡
1 1 𝑦𝑡 1 1
𝐿𝑀 = [− ∑ +∑ ] [ ∑ ]
𝑇 (𝑥𝑡 + 10) (𝑥 + 10 )
2 𝑇 (𝑥𝑡 + 10)2
𝑖=1 𝑖=1 𝑡 𝑖=1
2 −1
𝑡 𝑡 𝑡
1 𝑦𝑡 1
𝐿𝑀 = [− ∑ +∑ ] [∑ ]
(𝑥 + 10) 2 (𝑥𝑡 + 10)2
𝑖=1 𝑡 𝑖=1 (𝑥𝑡 + 10) 𝑖=1
> LM<-(-sum(1/(educacion+10))+sum(renta/(educacion+10)^2))^2*(sum(1/(e
ducacion+10)^2))^-1
> LM
[1] 0.9756824
𝐿𝑀 = 0.9756824
Si comparamos con respecto a una 𝜒 2 (0.05,1) = 3.84
𝐿𝑀 < 𝜒2
por lo tanto, no rechazamos 𝐻0 ,es decir, el valor es 𝛽 = 10.
Para este caso se puede comparar que 𝑊 ≥ 𝐿𝑀 ≥ 𝐿𝑅 por lo que esta desigualdad sugiere que
la hipótesis nula puede ser talvez rechazada al mismo nivel de significación por 𝑊 pero no por
𝐿𝑀 𝑦 𝐿𝑅.