Description Usage Arguments Value Author(s) See Also Examples
View source: R/summary.maxim.R
Summarizes the maximization results
1 2 3 4 5 6 7 |
object |
optimization result, object of class
|
hessian |
logical, whether to display Hessian matrix. |
unsucc.step |
logical, whether to describe last unsuccesful step
if |
x |
object of class |
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. |
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 |
message |
a brief message, explaining the outcome (see
|
unsucc.step |
description of last unsuccessful step, only if
requested and |
maximum |
function value at maximum |
estimate |
matrix with following columns:
|
constraints |
information about the constrained optimization.
|
hessian |
estimated hessian at maximum (if requested) |
Ott Toomet
maxNR
, returnCode
,
returnMessage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## 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 )
|
Loading required package: miscTools
Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.
If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
--------------------------------------------
Newton-Raphson maximisation
Number of iterations: 25
Return code: 5
Infinite value
Function value: Inf
Estimates:
estimate gradient
[1,] -7.034857e+155 -1.406971e+156
[2,] -1.055228e+156 -2.110457e+156
--------------------------------------------
--------------------------------------------
Newton-Raphson maximisation
Number of iterations: 24
Return code: 5
Infinite value
Function value: Inf
Estimates:
estimate gradient
[1,] 2.110451e+155 4.220903e+155
[2,] -1.641470e+155 -3.282940e+155
--------------------------------------------
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.