Description Usage Arguments Details Value Author(s) See Also Examples
Return a logical vector, indicating which parameters were free under
maximization, as opposed to the fixed parameters that are treated as
constants. See argument “fixed” for maxNR
.
1 2 3 |
x |
object, created by a maximization routine, such as
|
... |
further arguments for methods |
Several optimization routines allow the user to fix some parameter values (or do it automatically in some cases). For gradient or Hessian based inference one has to know which parameters carry optimization-related information.
A logical vector, indicating whether the parameters were free to change during optimization algorithm.
Ott Toomet
1 2 3 4 5 6 7 8 9 10 11 12 | ## a two-dimensional exponential hat
f <- function(a) exp(-a[1]^2 - a[2]^2)
## maximize wrt. both parameters
free <- maxNR(f, start=1:2)
summary(free) # results should be close to (0,0)
activePar(free)
## keep the first parameter constant
cons <- maxNR(f, start=1:2, fixed=c(TRUE,FALSE))
summary(cons) # result should be around (1,0)
activePar(cons)
|
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: 7
Return code: 1
gradient close to zero (gradtol)
Function value: 1
Estimates:
estimate gradient
[1,] -3.331680e-11 1.110223e-10
[2,] -5.643347e-11 1.110223e-10
--------------------------------------------
[1] TRUE TRUE
--------------------------------------------
Newton-Raphson maximisation
Number of iterations: 4
Return code: 1
gradient close to zero (gradtol)
Function value: 0.3678794
Estimates:
estimate gradient
[1,] 1.000000e+00 NA
[2,] 3.515097e-07 -2.586265e-07
--------------------------------------------
[1] FALSE TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.