[R] npindex: specifying manual bandwiths

Greenerpole greenerpole at gmail.com
Fri Feb 13 17:37:48 CET 2009


Dear R-users, 

I am very enthusiastic about the capacities offered by the np package and
pretty fond of it. 
Nevertheless, trying to estimate Ichimura and Klein and Spady models on my
data, I would like to be able to provide the npindex function with my
guesses for the bandwidth (eventually computed by other means). 
The fact that the option 'bandwidth.compute' in the function npindexbw
exists and seems to be switchable (TRUE/FALSE) makes be believe that it
might be possible, but i couldn't manage so far; could you help ?

For instance, 

#Simulation
n <- 200
x1 <- runif(n, min=-1, max=1)
x2 <- runif(n, min=-1, max=1)
y <- ifelse(x1 + x2 + rnorm(n) > 0, 1, 0)

#Klein and Spady estimation, letting np compute the bandwidth 
npindexbw(bws=c(1,1,.5),xdat=cbind(x1,x2),ydat=y,bandwidth.compute=TRUE,method="kleinspady")
#Works fine!

#Klein and Spady estimation, attempting to constrain the bandwidth to .5
npindexbw(bws=c(1,1,.5),xdat=cbind(x1,x2),ydat=y,bandwidth.compute=FALSE,method="kleinspady")
#Returns a result with the starting values: no estimation has been done...

Do you know how (or whether) constraining the bandwidth to a given value is
possible. 
Many thanks, 
Cheers. 
Roland
--


-- 
View this message in context: http://www.nabble.com/npindex%3A-specifying-manual-bandwiths-tp22000068p22000068.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list