fit_nbbp_homogenous_ml.Rd
Fit a negative binomial branching process model with maximum likelihood inference via rstan
vector containing the size of each outbreak, including the index case
optional, possibly per-chain, censoring, see details.
optional, possibly per-chain, conditioning on minimum observed chain size, see details in fit_nbbp_homogenous_bayes.
target width of the 95% confidence interval (coverage is not guaranteed)
number of parametric bootstrap replicates used for the 95% CI
minimum number of random initializations for checking optimization performance, see details
maximum number of random initializations when encountering optimization errors, see details
adjusts range of r_eff in which likelihood profiling is done instead of parametric bootstrapping, see details.
if not NA, specifies the first seed used in the first rstan::optimizing call spawned by calling this function. Subsequent calls will modify this seed predictably, ensuring no two analyses use the same seed. If NA, each seed is the result of calling sample.int(.Machine$integer.max, 1), as in rstan::optimizing.
further arguments passed to rstan::optimizing.
A list the same as optimizing with the following additional components. $ci: named matrix containing the confidence intervals at the specified width for r_eff and the dispersion parameter. $ci_method: character specifying whether the CI was from the "parametric_bootstrap" or the "likelihood_profile" approach. $convergence: named matrix containing min and max values for r_eff, the dispersion parameter, and the log-likelihood
The likelihood is that used by fit_nbbp_homogenous_bayes.
Unless the user passes initialization information to rstan, rstan's default of random
initialization is used.
Optimization will be attempted at least run_reps
times, with the reported parameters taken
from the replicate with the highest log-likelihood.
Run-to-run variation is reported as the range of values of the log-likelihood, r_eff, and
dispersion.
If issues are encountered in optimizing, up to max_tries
attempts will be made to obtain
run_reps
successful replicates. Results will be returned even if no replicate ran
without incident. See optimizing for more on the provided return_code
.
Confidence intervals are provided, though in testing the coverage may be relatively different from the specified width. The methods applied are not resampling based and thus can provide confidence intervals even if only index cases have been observed. By default, confidence intervals are provided by adaptively choosing between intervals provided by parametric bootstrapping and likelihood profiling (ci_method = "hybrid"), though this can be changed (ci_method = "boot" for parametric bootstrapping, ci_method = "profile" for profiling). The parametric bootstrap has been observed to yield confidence intervals which generally are more consistent in coverage across parameter values than the method of profiling the likelihood surface, except near r_eff = 1, where the coverage is quite bad and profiling the likelihood works better.