Skip to content

bootdht giving output inconsistent with analytical results #212

@LHMarshall

Description

@LHMarshall

I'm not convinced everything is fine with bootdht, even when merely dealing with geographic stratification. Here is an example with the sikadeer data set, indirect survey with creation and decay rate plus strata.

library(Distance)
data(sikadeer)
cu <- convert_units("centimeter", "kilometer", "square kilometer")
easy <- ds(sikadeer, key="hn", truncation="10%", convert_units = cu)
# Create list of multipliers
mult <- list(creation = data.frame(rate=25, SE=5),
             decay    = data.frame(rate=163, SE=14.2))
print(mult)
deer.ests <- dht2(easy, flatfile=sikadeer, strat_formula=~Region.Label,
                  convert_units=cu, multipliers=mult, 
                  stratification="geographical")
print(deer.ests, report="density")
plain.estimates <- attr(deer.ests, which = "density")
analy.cis <- plain.estimates[, c("Region.Label", "LCI", "UCI")]

How does the bootstrap handle this?

bootnosf <- bootdht(easy, flatfile = sikadeer, resample_transects = TRUE,
                  convert_units=cu, summary_fun=bootdht_Dhat_summarize,
                  multipliers = mult, cores=10, nboot=200)
library(dplyr)
boot.cis <- bootnosf %>%
  group_by(Label) %>%
  summarize(quant025 = quantile(Dhat, probs = 0.025), 
            quant975 = quantile(Dhat, probs = 0.975))
print(boot.cis)

Output

Analytical

analy.cis
  Region.Label       LCI        UCI
1            A 43.006276 127.032567
2            B 19.374792  71.306900
3            C  1.905592   7.983742
4            E  1.101750  12.052725
5            F  9.747757  22.992961
6            G  1.573342  43.363109
7            H  1.008389   2.378582
8            J  4.705814  11.100050
9        Total 12.643932  34.370969

Bootstrap result

as.data.frame(boot.cis)
  Label    quant025   quant975
1     A  51.3049436  98.679598
2     B  19.2213441  55.138872
3     C   2.7838666   5.298189
4     E   0.7472652   6.551853
5     F  13.2874121  16.994035
6     G   4.2230542  27.781516
7     H   1.3745599   1.758004
8     J   6.4146128   8.204017
9 Total 118.9993812 188.353451

Stratum-specific confidence interval bounds are roughly comparable, but the interval for the entire study area are quite disparate. I don't suspect bootdht is calculating a weighted average, weighted by stratum areas. It cannot be taking a simple average because thse values are larger than any stratum-specific estimates. I don't know what calculation is being made by bootdht

Whatever the situation, the documentation for bootdht that states
Note that only geographical stratification as supported in dht is allowed.

is not accurate.

Originally posted by @erex in #155

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNew items to look at and decide what to do

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions