Dimitris.Kapetanakis
2011-Jul-25 13:17 UTC
[R] error in optimization when I include constant term in Klein and Spady (np package)
Dear all, I am trying to use the np package for the estimation of a model with Klein and Spady's semiparametric estimator. When though, I include a constant term ( a column with 1s in X) then the following message appear: Multistart 1 of 3...Error in optim(c(beta, h), fn = optim.fn, gr = NULL, method = optim.method, : non-finite value supplied by optim So, how can I include a constant term in Klein and Spady's estimator or how can I solve the problem with the optimzation? (I already tried all the possible optimization methods) The code that I run is: library(np) N<-250 q<-2 BETA<-matrix(1,3,1) X<-matrix(c(rnorm(N,0,1), rnorm(N,1,1)), ncol=q) X<-cbind(X,1) L<-rlogis(N,location=0, scale=1) Y <-as.vector(X%*%BETA+L>=0)*1 KS <- npindexbw(xdat=X, ydat=Y, bandwidth.compute=TRUE, method="kleinspady", optim.maxit=10^3, ckertype="epanechnikov", ckerorder=2) Thank you Dimitris -- View this message in context: http://r.789695.n4.nabble.com/error-in-optimization-when-I-include-constant-term-in-Klein-and-Spady-np-package-tp3692728p3692728.html Sent from the R help mailing list archive at Nabble.com.
Apparently Analagous Threads
- np package, estimating the standard errors of Klein and Spady's estimator
- np package, KleinSpady estimator, error when I estimate the bootstrapped standard errors
- npindex: specifying manual bandwiths
- npindex: fitted values of the function itself?
- problem on semiparametric single index estimator