summary.maxlogL: Summarize Maximum Likelihood Estimation

Description Usage Arguments Details Value References See Also Examples

View source: R/summary.R

Description

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

Usage

1
2
## S3 method for class '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.

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).

Value

An object of class 'summary.maxlogL'.

References

\insertRef

Canty2017EstimationTools

See Also

maxlogL, boot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#--------------------------------------------------------------------------------
### 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")))


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

Jaimemosg/EstimationTools documentation built on Nov. 16, 2019, 9:05 p.m.