library(EstimationTools)
#--------------------------------------------------------------------------------
# First example: Comparison between standard error computation via Hessian matrix
# and standard error computation via bootstrap
N <- rbinom(n = 100, size = 10, prob = 0.3)
phat1 <- maxlogL(x = N, dist = 'dbinom', fixed = list(size = 10),
link = list(over = "prob", fun = "logit_link"))
## Standard error computation method and results
print(phat1$outputs$StdE_Method) # Hessian
summary(phat1)
## 'bootstrap_maxlogL' implementation
phat2 <- phat1 # Copy the first 'maxlogL' object
bootstrap_maxlogL(phat2, R = 100)
## Standard error computation method and results
print(phat2$outputs$StdE_Method) # Bootstrap
summary(phat2)
#--------------------------------------------------------------------------------
Run the code above in your browser using DataLab