chain_ll | R Documentation |
Calculate the log-likelihood for the outcome of a branching process
chain_ll(
x,
offspring,
stat = c("size", "length"),
obs_prob = 1,
infinite = Inf,
exclude = NULL,
individual = FALSE,
nsim_obs,
...
)
x |
vector of sizes or lengths of transmission chains |
offspring |
Offspring distribution: a character string corresponding to
the R distribution function (e.g., "pois" for Poisson, where
|
stat |
statistic given as |
obs_prob |
observation probability (assumed constant) |
infinite |
any chains of this size/length will be treated as infinite |
exclude |
any sizes/lengths to exclude from the log-likelihood calculation |
individual |
if TRUE, a vector of individual log-likelihood contributions will be returned rather than the sum |
nsim_obs |
number of simulations if the log-likelihood is to be approximated for imperfect observations |
... |
parameters for the offspring distribution |
log-likelihood, or vector of log-likelihoods
(if obs_prob
< 1), or a list of individual log-likelihood
contributions (if individual=TRUE
)
Sebastian Funk
pois_size_ll, nbinom_size_ll, gborel_size_ll, pois_length_ll, geom_length_ll, offspring_ll
chain_sizes <- c(1, 1, 4, 7) # example of observed chain sizes
chain_ll(chain_sizes, "pois", "size", lambda = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.