confint.maxLik.RdWald confidence intervals for Maximum Likelihood Estimates
# S3 method for class 'maxLik'
confint(object, parm, level=0.95, ...)object of class “maxLik” returned by maxLik function
the name of parameters to compute the confidence intervals. If omitted, confidence intervals for all parameters are computed.
the level of confidence interval
additional arguments to be passed to the other methods
A matrix of lower and upper confidence interval limits (in the first and second column respectively). The matrix rows are labeled by the parameter names (if any) and columns by the corresponding distribution quantiles.
## compute MLE parameters of normal random sample
x <- rnorm(100)
loglik <- function(theta) {
dnorm(x, mean=theta[1], sd=theta[2], log=TRUE)
}
m <- maxLik(loglik, start=c(mu=0, sd=1))
summary(m)
#> --------------------------------------------
#> Maximum Likelihood estimation
#> Newton-Raphson maximisation, 4 iterations
#> Return code 1: gradient close to zero (gradtol)
#> Log-Likelihood: -135.882
#> 2 free parameters
#> Estimates:
#> Estimate Std. error t value Pr(> t)
#> mu 0.0005696 0.0941649 0.006 0.995
#> sd 0.9416532 0.0665846 14.142 <2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> --------------------------------------------
confint(m)
#> 2.5 % 97.5 %
#> mu -0.1839902 0.1851294
#> sd 0.8111497 1.0721567
confint(m, "mu", level=0.1)
#> 45 % 55 %
#> mu -0.01126331 0.01240247