As you can see from your error message, boot.ci
calls bca.ci
. Because the boot.out
object doesn't supply L
, the empirical influence values for the statistic you're calculating on the data, bca.ci
tries to calculate them using the empinf
function, and then (as Michael says) it uses them to calculate the acceleration constant:
L <- empinf(boot.out, index = index, t = t.o, ...)
a <- sum(L^3)/(6 * sum(L^2)^1.5)
But with a small number of replications, empinf
sometimes fails and returns a vector of NA
values. The result is that you have no values for L
, a
can't be calculated, and you get your error. As ocram says, increasing the number of boostrap replications will fix this. Even doubling R
to 2000 should probably do it.
Addition I by @cdalitz:
Unfortunately, empinf
also fails in other situations, but fortunately it offers an alternative implementation by setting the option type="jack"
. In our experiments (tested, among others, with the median of an exponential distribution as the statistic of interest), this alternative option worked in all cases, even when the default implementation failed. When both worked, the results were almost indistinguishable. You can thus obtain results with
ci <- boot.ci(boot.out, conf=0.95, type = "bca",
L =empinf(boot.out, index=1L, type="jack"))
Addition II by @cdalitz: I have submitted a bugfix to the maintainer of the boot
package, and it has been merged into boot
since version 1.3-31 from 2024-08-28.