skygrowth.mcmc.covar: A gibbs-metropolis algorithm for sampling Ne(t) with a 1st...

Description Usage Arguments Value

Description

A gibbs-metropolis algorithm for sampling Ne(t) with a 1st order moving average model and using covariate data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
skygrowth.mcmc.covar(
  tre,
  formula,
  data,
  maxSampleTime,
  iter = 1e+05,
  iter0 = 10,
  tau0 = 10,
  tau_logprior = "exponential",
  res = 50,
  beta_logpriors = list(),
  prop_beta_sd = NULL,
  quiet = FALSE,
  control = NULL,
  gamma = NA,
  logRmean = NULL,
  logRsd = 1,
  maxHeight = NULL
)

Arguments

tre

A dated phylogeny in ape::phylo format (see documentation for ape)

formula

An R formula with empty left-hand-side; the right-hand-side specifies relationship of covariates with growth rate of Ne

data

A data.frame, must include 'time' column

maxSampleTime

The scalar time that the most recent sample was collected

iter

iter

iter0

iter0

tau0

Initial guess of the precision parameter

tau_logprior

Prior for precision parameter (character string (gamma or exponential) or function)

res

Number of time points (integer)

beta_logpriors

Optional list of functions providing log density for coefficients (must correspond to data)

prop_beta_sd

Standard deviation of beta proposal kernel

quiet

Provide verbose output?

control

List of options passed to optim

gamma

Death rate. If provided will compute R

logRmean

Mean of R in log space. Determines a lognormal prior on R(t). If used, _gamma_ must be provided

logRsd

SD of R in log space. Determines a lognormal prior on R(t). If used, _gamma_ must be provided

maxHeight

If supplied, will only compute Ne(t) estimates this far back in time. Otherwise will compute to the root of the tree.

mhsteps

Number of mcmc steps

Value

A fitted model including effective size through time


mrc-ide/skygrowth documentation built on May 19, 2020, 5:10 p.m.