bootstrap_maxlogL: Bootstrap computation of standard error for 'maxlogL' class...

View source: R/bootstrap_maxlogL.R

bootstrap_maxlogLR Documentation

Bootstrap computation of standard error for maxlogL class objects.

Description

[Experimental]

bootstrap_maxlogL computes standard errors of maxlogL class objects by non-parametric bootstrap.

Usage

bootstrap_maxlogL(object, R = 2000, silent = FALSE, ...)

Arguments

object

an object of maxlogL class whose standard errors are going to be computed by bootstrap.

R

numeric. It is the number of resamples performed with the dataset in bootstrap computation. Default value is 2000.

silent

logical. If TRUE, notifications of bootstrap_maxlogL are suppressed.

...

arguments passed to boot used in this routine for estimation of standard errors.

Details

The computation performed by this function may be invoked when Hessian from optim and hessian fail in maxlogL or in maxlogLreg.

However, this function can be run even if Hessian matrix calculation does not fails. In this case, standard errors in the maxlogL class object is replaced.

Value

A modified object of class maxlogL.

Author(s)

Jaime Mosquera GutiƩrrez, jmosquerag@unal.edu.co

References

\insertRef

Canty2017EstimationTools

See Also

maxlogL, maxlogLreg, boot

Examples

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)


#--------------------------------------------------------------------------------


EstimationTools documentation built on Dec. 10, 2022, 9:07 a.m.