Skip to contents

Builds an objlist with value, gradient and Hessian zero for the parameters of p.

Usage

as.objlist(p)

Arguments

p

Named numeric vector.

Value

An objlist with value 0, gradient rep(0, length(p)) and Hessian matrix(0, length(p), length(p)), named by p.

Examples

p <- c(A = 1, B = 2)
as.objlist(p)
#> value
#> ==================
#> 0
#> gradient[1:2] (full length = 2)
#> ==================
#> A B 
#> 0 0 
#> 
#> hessian[1:2,1:2]
#> ==================
#>   A B
#> A 0 0
#> B 0 0
#> 
#> 
#> attributes
#> ==================