nppackages / lpcde

R implementation of bandwidth selection, point estimation and inference procedures for local polynomial conditional distribution and density methods.
https://nppackages.github.io/lpcde/
4 stars 0 forks source link

JOSS review: Automatic bandwidth selection error #10

Open salbalkus opened 1 week ago

salbalkus commented 1 week ago

Raising as part of JOSS review openjournals/joss-reviews#7241

Having an automatic bandwidth selection for conditional density estimation is a very useful feature -- kudos for implementing this. I may be incorrect about this, but the documentation for lpcde seems to imply that when the bw is not specified, the bandwidth is chosen according to the optimization strategy implemented in lpbwcde. However, when I run the following code:

n=100
x_data = matrix(rbeta(n, 2, 4))
y_data = matrix(rgamma(n, 10, 1/x_data))
y_grid = seq(from=1, to=5, length.out=10)

model1 = lpcde::lpcde(x_data=x_data, y_data=y_data, y_grid=y_grid, x= 0.5)

it returns Error in matrix(0L, ncol = eff_n) : data is too long. Is this correct? I'm not sure what the true problem is based on the error message.

salbalkus commented 1 week ago

On a somewhat related note, there's a slight typo in the lpbwcde documentation: "conditionaldensity" should be "conditional density"