Last data update: 2014.03.03

R: Summarize optimx object
coef.optimxR Documentation

Summarize optimx object

Description

Summarize an "optimx" object.

Usage

  ## S3 method for class 'optimx'
coef(object, ...) 
  ## S3 replacement method for class 'optimx'
coef(x) <- value 

Arguments

object

Object returned by optimx.

...

Further arguments to be passed to the function. Currently not used.

x

An optimx object.

value

Set parameters equal to this value.

Value

coef.optimx returns the best parameters found by each method that returned such parameters. The returned coefficients are in the form of a matrix with the rows named by the relevant methods and the columns named according to parameter names provided by the user in the vector of starting values, or else by "p1", "p2", ..., if names are not provided.

Examples

ans <- optimx(fn = function(x) sum(x*x), par = 1:2)
coef(ans)

## Not run: 
proj <- function(x) x/sum(x)
f <- function(x) -prod(proj(x))
ans <- optimx(1:2, f)
ans
coef(ans) <- apply(coef(ans), 1, proj)
ans

## End(Not run)

Results