Description Usage Arguments Details Value Author(s) See Also Examples
Extract variance-covariance matrices from maxLik
objects.
1 2 |
object |
a ‘maxLik’ object. |
eigentol |
eigenvalue tolerance, controlling when the Hessian matrix is treated as numerically singular. |
... |
further arguments (currently ignored). |
The standard errors are only calculated if the ratio of the smallest and largest eigenvalue of the Hessian matrix is less than “eigentol”. Otherwise the Hessian is treated as singular.
the estimated variance covariance matrix of the coefficients. In
case of the estimated Hessian is singular, it's values are
Inf
. The values corresponding to fixed parameters are zero.
Arne Henningsen, Ott Toomet
1 2 3 4 5 6 7 8 9 10 11 | ## ML estimation of exponential random variables
t <- rexp(100, 2)
loglik <- function(theta) log(theta) - theta*t
gradlik <- function(theta) 1/theta - t
hesslik <- function(theta) -100/theta^2
## Estimate with numeric gradient and hessian
a <- maxLik(loglik, start=1, control=list(printLevel=2))
vcov(a)
## Estimate with analytic gradient and hessian
a <- maxLik(loglik, gradlik, hesslik, start=1)
vcov(a)
|
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/
----- Initial parameters: -----
fcn value: -54.79315
parameter initial gradient free
[1,] 1 45.20685 1
Condition number of the (active) hessian: 1
-----Iteration 1 -----
-----Iteration 2 -----
-----Iteration 3 -----
-----Iteration 4 -----
-----Iteration 5 -----
--------------
gradient close to zero
5 iterations
estimate: 1.825046
Function value: -39.8395
[,1]
[1,] 0.03333432
[,1]
[1,] 0.03330792
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.