activePar {maxLik}R Documentation

free parameters under maximisation

Description

Return a logical vector, indicating which parameters were free under maximisation, as opposed to the fixed parameters, treated as constants.

Usage

activePar(x, ...)
## Default S3 method:
activePar(x, ...)

Arguments

x

object, created by a maximisation routine, or derived from a maximisation object. Currently only maxNR and it's derivations support activePar

...

further arguments for methods

Details

Several optimisation 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 optimisation-related information.

Value

A logical vector, indicating whether the parameters were free to change during optimisation algorithm.

Author(s)

Ott Toomet, otoomet@econ.au.dk

See Also

maxNR, nObs

Examples

# a simple 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)
# allow only the second parameter to vary
cons <- maxNR(f, start=1:2, activePar=c(FALSE,TRUE))
summary(cons) # result should be around (1,0)
activePar(cons)

[Package maxLik version 1.1-0 Index]