JeffreyRacine / R-Package-np

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

npcdens with gradients causes R session to abort #10

Open thomas24 opened 8 years ago

thomas24 commented 8 years ago

npcdens with gradients=TRUE causes R session to abort when one continuous and one unordered categorical explanatory variable is used in the formula npcdensbw() to determine bandwidths using least squares cross validation.

Example: bw_np<npcdensbw(formula=y~x1+x2, uykertype='liracine', cxkertype='epanechnikov', uxkertype="liracine", data=df, bwmethod='cv.ls')

( y is levels 0/1, x1 is continuous x2 is levels 0/1.)

npproba <- npcdens(bw_np) # works fine npproba_gradients<- npcdens(bw_np, gradients=TRUE) # this crashes