JeffreyRacine / R-Package-np

R package np (Nonparametric Kernel Smoothing Methods for Mixed Data Types)
https://socialsciences.mcmaster.ca/people/racinej
47 stars 18 forks source link

npindexbw and npindex do not have option to change bandwidth type #6

Open stavrospoupakis opened 9 years ago

stavrospoupakis commented 9 years ago

The single index model with Klein & Spady should have the option to change bwtype (Bandwidth Type.) Currently takes Fixed as default, but Adaptive nearest-neighbor ("adaptive_nn") should also be allowed.

library(np) 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)

model <- npindexbw(y~x1+x2, method="kleinspady", gradients=TRUE) summary(model)