Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

summary.maxim

Summary method for maximization


Description

Summarizes the maximization results

Usage

## S3 method for class 'maxim'
summary( object, hessian=FALSE, unsucc.step=FALSE, ... )
## S3 method for class 'summary.maxim'
print(x,
                              max.rows=getOption("max.rows", 20),
                              max.cols=getOption("max.cols", 7),
                              ... )

Arguments

object

optimization result, object of class maxim. See maxNR.

hessian

logical, whether to display Hessian matrix.

unsucc.step

logical, whether to describe last unsuccesful step if code == 3

x

object of class summary.maxim, summary of maximization result.

max.rows

maximum number of rows to be printed. This applies to the resulting coefficients (as those are printed as a matrix where the other column is the gradient), and to the Hessian if requested.

max.cols

maximum number of columns to be printed. Only Hessian output, if requested, uses this argument.

...

currently not used.

Value

Object of class summary.maxim, intended to print with corresponding print method. There are following components:

type

type of maximization.

iterations

number of iterations.

code

exit code (see returnCode.)

message

a brief message, explaining the outcome (see returnMessage).

unsucc.step

description of last unsuccessful step, only if requested and code == 3

maximum

function value at maximum

estimate

matrix with following columns:

results

coefficient estimates at maximum

gradient

estimated gradient at maximum

constraints

information about the constrained optimization. NULL if unconstrained maximization.

hessian

estimated hessian at maximum (if requested)

Author(s)

Ott Toomet

See Also

Examples

## minimize a 2D quadratic function:
f <- function(b) {
  x <- b[1]; y <- b[2];
  val <- (x - 2)^2 + (y - 3)^2
  attr(val, "gradient") <- c(2*x - 4, 2*y - 6)
  attr(val, "hessian") <- matrix(c(2, 0, 0, 2), 2, 2)
  val
}
## Note that NR finds the minimum of a quadratic function with a single
## iteration.  Use c(0,0) as initial value.  
result1 <- maxNR( f, start = c(0,0) ) 
summary( result1 )
## Now use c(1000000, -777777) as initial value and ask for hessian
result2 <- maxNR( f, start = c( 1000000, -777777)) 
summary( result2 )

maxLik

Maximum Likelihood Estimation and Related Tools

v1.4-8
GPL (>= 2)
Authors
Ott Toomet <otoomet@gmail.com>, Arne Henningsen <arne.henningsen@gmail.com>, with contributions from Spencer Graves and Yves Croissant
Initial release
2021-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.