Closed IndrajeetPatil closed 3 days ago
I am also having this issue:
Error in bw.SJ(x, method = "ste") : sample is too sparse to find TD
18.
stop("sample is too sparse to find TD", domain = NA)
17.
bw.SJ(x, method = "ste")
16.
density.default(x, n = precision, bw = bw, from = x_range[1],
to = x_range[2], ...)
15.
stats::density(x, n = precision, bw = bw, from = x_range[1],
to = x_range[2], ...)
14.
.estimate_density_kernel(x, x_range, precision, bw, ci, ...)
13.
.estimate_density(x, method = method, precision = precision,
extend = extend, extend_scale = extend_scale, bw = bw, ci = ci,
...)
12.
estimate_density.numeric(x, precision = precision, method = method,
...)
11.
estimate_density(x, precision = precision, method = method, ...)
10.
map_estimate.numeric(x)
9.
bayestestR::map_estimate(x) at credible_interval.R#5
8.
credible_interval(rbeta(alt_counts = alt_counts[i], ref_counts = ref_counts[i],
n = n), ci = ci) at hdi_beta.R#17
7.
obelus::hdi_beta(alt_counts = tcga_tp53$rna_alt_counts_tumor,
ref_counts = tcga_tp53$rna_ref_counts_tumor, ci = ci_level)
6.
dplyr::mutate(., imbalance = !(0 >= ci_low & 0 <= ci_high), direction = case_when(ci_high <
0 ~ "wt", ci_low > 0 ~ "mut", TRUE ~ "neutral"))
5.
paste0("beta_", names(.))
4.
setNames(., paste0("beta_", names(.)))
3.
list2(...)
2.
dplyr::bind_cols(tcga_tp53, .)
1.
obelus::hdi_beta(alt_counts = tcga_tp53$rna_alt_counts_tumor,
ref_counts = tcga_tp53$rna_ref_counts_tumor, ci = ci_level) %>%
dplyr::mutate(imbalance = !(0 >= ci_low & 0 <= ci_high),
direction = case_when(ci_high < 0 ~ "wt", ci_low > 0 ~ ...
@mattansb Is it possible to tackle this in the next CRAN release?
@IndrajeetPatil - in you're example you're trying to compute a bootstrap CI for some estimate and failing because the bootstrap samples are too sparse. Returning NA
(=not failing) will result in a biased bootstrap CI.
(I'm not sure what @ramiromagno's example is doing, but since it is failing in a function called credible_interval()
I'm guessing it's also doing something similar?)
So really, this issue should be "resolved" in parameters
- if the bootstrap generally fails, it should catch it and return an [NA, NA]
CI.
Closing in favour of https://github.com/easystats/datawizard/issues/540
This will make
describe_distribution
function inparameters
more robust to failures.It's especially difficult to find out which grouping level doesn't have enough observations when the function fails in
grouped_
context.Created on 2021-06-04 by the reprex package (v2.0.0)
Trace: