This function is intended for internal use only.

.get_partial_ub(obs_sizes, obs_probs, size_max, error_max)

Arguments

obs_sizes

the number of cases in all incompletely observed chains

obs_probs

the per-case observation probabilities for all chains in obs_sizes

size_max

optional integer override directly specifying the maximum unobserved chain size; if this is not NA, it will be used regardless of error_max, though with a warning if it yields a smaller truncation.

error_max

binomial tail probability for dynamic size computation (see details)

Value

maximum size for summing observation probabilities

Details

If size_max is an integer, it will be returned. Otherwise, following the math outlined in the "Implementation details" vignette, an upper bound is chosen such that the error in the marginal probability of observing a chain of size c is no more than error_max.