-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hi,
I am benchmarking various methods for tree regressions, including the dbarts implementation for BART. (https://github.com/szcf-weiya/benchmark.tree.regressions)
I found that when p >= n - 1, the dbarts::bart failed and threw that
Error in .Object$initialize(...) : sigma estimate is NaN
For example, (or check more details here szcf-weiya/benchmark.tree.regressions#15)
dbarts_fit = function(x, y, xtest, ntree = 200) {
fit = dbarts::bart(x, y, ntree = ntree, keeptrees = TRUE, ndpost = 1000L, nskip = 100L)
ypred = predict(fit, xtest)
colMeans(ypred)
}
sim_friedman = function(n = 500, p = 200, sigma = 1, structure = "indep") {
x = gen_x(n, p, structure = structure)
y0 = 10 * sin(pi * x[, 1] * x[, 2]) + 20 * (x[, 3] - 0.5)^2 + 10 * x[, 4] + 5 * x[, 5]
y = y0 + rnorm(n) * sigma
list(x = x, y = y)
}it would be better to give a reasonable estimate for sigma when p is large
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
