Learn R Programming

EstimationTools (version 1.2.1)

summary.maxlogL: Summarize Maximum Likelihood Estimation

Description

Displays maximum likelihood estimates computed with maxlogL with its standard errors, AIC and BIC. This is a summary method for maxlogL object

Usage

# S3 method for maxlogL
summary(object, Boot_Std_Err = FALSE, ...)

Arguments

object

an object class "maxlogL".

Boot_Std_Err

a logical variable for standard Errors computation by bootstrapping. The default is FALSE. This computation occurs when hessian from optim and hessian fails in maxlogL routine. If this argument is TRUE, standard errors are computed, even if hessian did not fail in maxlogL routine.

...

arguments passed to boot for estimation of stantdard error with non-parametric bootstrap.

Value

An object of class 'summary.maxlogL'.

Details

This summary method takes standard errors from maxlogL object and displays them. If hessian and Hessian from optim fails, standard errors are computed with bootstrap. However, if user sets Boot_Std_Err = TRUE in this summary function, standard errors are calculated by bootstrap, even if hessian or Hessian from optim converges.

Supose that the user creates a variable named fit that stores maxlogL object. The summary method modifies the element fit$outputs$StdE_Method object from Gobal Environment (see the Second Example). If user does not creat a variable, the summary methid it simply calculates standard errors (see the Third Example).

References

Canty2017EstimationTools

See Also

maxlogL, boot

Examples

Run this code
# NOT RUN {
#--------------------------------------------------------------------------------
### First example: One known parameter

x <- rnorm(n = 10000, mean = 160, sd = 6)
theta_1 <- maxlogL(x = x, dist = 'dnorm', control = list(trace = 1),
                 link = list(over = "sd", fun = "log_link"),
                 fixed = list(mean = 160))
summary(theta_1)


#--------------------------------------------------------------------------------
# Second example: Binomial probability parameter estimation with variable
# creation

N <- rbinom(n = 100, size = 10, prob = 0.3)
phat <- maxlogL(x = N, dist = 'dbinom', fixed = list(size = 10),
                link = list(over = "prob", fun = "logit_link"))

## Standard error calculation method
print(phat$outputs$StdE_Method)

## Standard error value (not computed yet, because is computed with 'summary')
print(phat$outputs$StdE)

## 'summary' method
summary(phat)

## Now, standard error is updated
print(phat$outputs$StdE_Method)
print(phat$outputs$StdE)


#--------------------------------------------------------------------------------
# Third example: Binomial probability parameter estimation with no varaible
# creation

N <- rbinom(n = 100, size = 10, prob = 0.3)
summary(maxlogL(x = N, dist = 'dbinom', fixed = list(size = 10),
                link = list(over = "prob", fun = "logit_link")))


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

# }

Run the code above in your browser using DataLab