Skip to content
Prev 269043 / 398502 Next

Error message: object of type 'closure' is not subsettable

Newbie wrote:
You haven't given all your data. Spot csv is missing.

You are using nlminb incorrectly.
It expects the objective function to take a numeric vector as argument as
clearly stated in the documentation.
Which should have been clear after your first post.

This would possibly help (NOT tested because of lack of data)

y <- function(par) {kappahat<-par[1]; rhohat<-par[2]; etahat<-par[3];
thetahat<-par[4]; v0hat<-par[5]; sum(difference(k, t, S0, X, r, implvol, q,
kappahat, rhohat, etahat, thetahat, v0hat)^2)}

nlminb(start=c(kappa, rho, eta, theta, v0), objective = y, lower =lb, upper
=ub)

Berend


--
View this message in context: http://r.789695.n4.nabble.com/Error-message-object-of-type-closure-is-not-subsettable-tp3752886p3754511.html
Sent from the R help mailing list archive at Nabble.com.