BNPR: Bayesian nonparametric phylodynamic reconstruction.

Description Usage Arguments Value Functions Examples

View source: R/calculate.R

Description

Bayesian nonparametric phylodynamic reconstruction.

Usage

1
2
3
4
5
6
7
BNPR(data, lengthout = 100, pref = FALSE, prec_alpha = 0.01,
  prec_beta = 0.01, beta1_prec = 0.001, fns = NULL, log_fns = TRUE,
  simplify = TRUE, derivative = FALSE, forward = TRUE)

BNPR_PS(data, lengthout = 100, prec_alpha = 0.01, prec_beta = 0.01,
  beta1_prec = 0.001, fns = NULL, log_fns = TRUE, simplify = TRUE,
  derivative = FALSE, forward = TRUE)

Arguments

data

phylo object or list containing vectors of coalescent times coal_times, sampling times samp_times, and number sampled per sampling time n_sampled.

lengthout

numeric specifying number of grid points.

pref

logical. Should the preferential sampling model be used?

prec_alpha, prec_beta

numerics specifying gamma prior for precision τ.

beta1_prec

numeric specifying precision for normal prior on β_1.

fns

list containing functions of covariates.

log_fns

logical whether or not to to apply a log-transformation to the output of the functions in fns.

simplify

logical whether to fully bucket all Poisson points.

derivative

logical whether to calculate estimates of the log-derivative.

forward

logical whether to use the finite difference approximations of the log-derivative as a forward or backward derivative.

Value

Phylodynamic reconstruction of effective population size at grid points. result contains the INLA output, data contains the information passed to INLA, grid contains the grid end points, x contains the grid point centers, effpop contains a vector of the posterior median effective population size estimates, effpop025 and effpop975 contain the 2.5th and 97.5th posterior percentiles, summary contains a data.frame of the estimates, and derivative (if derivative = TRUE) contains a data.frame summarizing the log-derivative.

Functions

Examples

1
2
3
4
5
data("NY_flu")
if (requireNamespace("INLA", quietly = TRUE)) {
 res = BNPR(NY_flu)
 plot_BNPR(res)
}

phylodyn documentation built on May 29, 2017, 1:28 p.m.