These methods return summary information about the estimated model. Both require the tibble package to be installed.

# S3 method for class 'maxLik'
tidy(x,  ...)
# S3 method for class 'maxLik'
glance(x, ...)

Arguments

x

object of class 'maxLik'.

...

Not used.

Value

For tidy(), a tibble with columns:

term

The name of the estimated parameter (parameters are sequentially numbered if names missing).

estimate

The estimated parameter.

std.error

The standard error of the estimate.

statistic

The \(z\)-statistic of the estimate.

p.value

The \(p\)-value.

This is essentially the same table as summary-method prints, just in form of a tibble (data frame).

For glance(), a one-row tibble with columns:

df

The degrees of freedom of the model.

logLik

The log-likelihood of the model.

AIC

Akaike's Information Criterion for the model.

nobs

The number of observations, if this is available, otherwise NA.

See also

The functions tidy and glance in package generics, and summary to display the “standard” summary information.

Author

David Hugh-Jones

Examples

## Example with a single parameter
t <- rexp(100, 2)
loglik <- function(theta) log(theta) - theta*t
a <- maxLik(loglik, start=2)
tidy(a)
#> # A tibble: 1 × 5
#>   term  estimate std.error statistic  p.value
#>   <chr>    <dbl>     <dbl>     <dbl>    <dbl>
#> 1 1         2.31     0.231     10.00 1.55e-23
glance(a)
#> # A tibble: 1 × 4
#>      df logLik   AIC  nobs
#>   <int>  <dbl> <dbl> <int>
#> 1     1  -16.3  34.6   100
## Example with a parameter vector
x <- rnorm(100)
loglik <- function(theta) {
   dnorm(x, mean=theta[1], sd=theta[2], log=TRUE)
}
a <- maxLik(loglik, start=c(mu=0, sd=1))
tidy(a)
#> # A tibble: 2 × 5
#>   term  estimate std.error statistic  p.value
#>   <chr>    <dbl>     <dbl>     <dbl>    <dbl>
#> 1 mu     -0.0775    0.0962    -0.805 4.21e- 1
#> 2 sd      0.962     0.0680    14.1   2.09e-45
glance(a)
#> # A tibble: 1 × 4
#>      df logLik   AIC  nobs
#>   <int>  <dbl> <dbl> <int>
#> 1     2  -138.  280.   100