Usage
bevimed(y, G, min_ac = 1L, q_shape = c(2, 100), p_shape = c(10, 2),
omega_shape = if (min_ac == 1L) c(2, 9) else c(2, 2),
samples_per_chain = 2000, stop_early = FALSE, max_samples = 5000,
burn = as.integer(samples_per_chain/10), temperatures = (0:10/10)^2,
tune_temperatures = 0, marginal_likelihood_only = FALSE,
store_Z = !marginal_likelihood_only,
swaps = as.integer(length(temperatures)/2), optimise_Z0 = FALSE,
tune_omega_and_phi_proposal_sd = FALSE, tune_block_size = 100,
variant_weights = NULL, estimate_phi = !is.null(variant_weights),
log_phi_mean = -1.5, log_phi_sd = 1, tandem_variant_updates = if (min_ac
== 1) 0 else sum(y), ...)
Arguments
y
Logical vector of case (TRUE) control (FALSE) status.
G
Integer matrix of variant counts per individual, one column per individual and one row per variant.
min_ac
Minimum allele count per individual to be considered to have a pathogenic combination of variants. '1' could correspond to a dominant inheritance hypothesis whereas '2' could correspond to a recessive inheritance hypothesis.
q_shape
Beta shape hyper-priors for prior on rate of affection (i.e. being a case) amongst individuals with non-pathogenic variant combinations (i.e. they have less than min_ac variants.
p_shape
Beta shape hyper-priors for prior on rate of affection (i.e. being a case) amongst individuals with pathogenic variant combinations (i.e. they have at least min_ac variants.
omega_shape
Beta shape hyper-priors for prior on rate of pathogenicity amongst variants.
samples_per_chain
Number of samples to draw from each chain.
stop_early
Logical value determining whether to attempt to stop the sampling as soon as certain conditions are met (i.e. either the estimated marginal log likelihood lies within a certain confidence interval, or we are sufficiently confidence that the log Bayes fact
max_samples
Maximum number of samples to take before terminating the sampling.
burn
Number of samples to drop from the start of the chain.
temperatures
Numeric vector of temperatures of power posteriors. One chain will be created for each element of the vector at the corresponding temperature.
tune_temperatures
Integer value - if greater than 0, the temperatures argument is ignored, and instead tune_temperatures tuned temperatures are used instead.
marginal_likelihood_only
Logical value determining whether to only return the estimated log marginal likelihood of the data under v as a numeric value, or to return an object of class BeviMed containing the full output of the MCMC sampling routine.
store_Z
Logical value determining whether to store the Z-vectors for each chain, which uses alot of memory, particularly if samples_per_chain, k and length(temperatures) are high.
swaps
Number of swaps between adjacent tempered chains to perform per update cycle.
optimise_Z0
Logical value determining whether to use a simulated annealing optimisation run to tune the initial values of Z.
tune_omega_and_phi_proposal_sd
Logical value determining whether the proposal SDs of the Metropolis-Hastings estimated parameters should be tuned for a target acceptance range (see tune_proposal_sds, tune_block_size
Integer value giving number of samples to draw when estimatating the acceptance rate of the omega/phi proposals in call to tune_proposal_sds. variant_weights
Vector of log-odds off-sets for rates of pathogenicity of individual variants relative to the global rate, omega.
estimate_phi
Logical value determining whether to estimate a scaling factor of variant_weights.
log_phi_mean
Mean for normal prior on scaling factor phi.
log_phi_sd
SD for normal prior on scaling factor phi.
tandem_variant_updates
Number of tandem variant updates to make per update cycle.