Learn R Programming

BeviMed (version 1.2)

call_cpp: R interface to BeviMed c++ MCMC procedure

Description

Allows other functions in the package to call the c++ function passing arguments more succinctly and by name.

Usage

call_cpp(samples_per_chain, y, block_starts, block_ends, cases, counts, min_ac,
  q_shape, p_shape, omega_shape, temperatures, Z0_matrix, estimate_omega,
  logit_omegas, logit_omega_proposal_sds, variant_weights, estimate_phi,
  log_phis, log_phi_mean, log_phi_sd, log_phi_proposal_sds,
  chain_swaps_per_cycle, annealing, tandem_variant_updates,
  case_variant_block_starts, case_variant_block_ends, case_variants, store_Z,
  burn = 0, check = TRUE)

Arguments

samples_per_chain
Number of samples to draw from each chain.
y
Logical vector of subject affectedness status.
block_starts
Integer vector of k 0-indexed start positions (with respect to cases and counts) for contiguous blocks relating to the k variants.
block_ends
Integer vector of (exclusive) k 0-indexed end positions.
cases
0 based vector of case indices with respect to y.
counts
Vector of variant counts.
min_ac
Minimum allele count required for pathogenic configuration.
q_shape
Beta distribution parameterisation of benign variant configuration rate of affection, q.
p_shape
Beta distribution parameterisation of pathogenic variant configuration rate of affection, p.
omega_shape
Beta distribution of global rate of pathogenicty of variants in gene given pathogenicity of gene, omega.
temperatures
Numeric vector of temperatures of power posteriors. One chain will be created for each element of the vector at the corresponding temperature.
Z0_matrix
Matrix of logicals, where the rows are used as an initial Zs for the chains.
estimate_omega
Logical value determining whether to estimate the parameter omega.
logit_omegas
Numeric vector of logit omega values, one value per chain.
logit_omega_proposal_sds
Numeric vector of proposal standard deviations for Metropolis-Hastings sampling of logit omega parameter, one value per chain.
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_phis
Numeric vector of log phi values, one value per chain.
log_phi_mean
Mean for normal prior on scaling factor phi.
log_phi_sd
SD for normal prior on scaling factor phi.
log_phi_proposal_sds
Numeric vector of proposal standard deviations for Metropolis-Hastings sampling of log phi parameter, one value per chain.
chain_swaps_per_cycle
Number of chain swaps to propose per update cycle.
annealing
Logical value determining whether to anneal the chains, e.g. for optimisation.
tandem_variant_updates
Number of tandem variant updates to make per update cycle.
case_variant_block_starts
0-indexed start positions for contiguous blocks of variants in case_variants.
case_variant_block_ends
As case_variant_block_starts for (exclusive) stop positions.
case_variants
Integer vector giving variant numbers (0-based, i.e. between 0 and k-1). Used to pick pairs of variants for tandem updates from.
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.
burn
Number of samples to drop from the start of the chain.
check
Logical value indicating whether to perform validation on the arguments before calling the c++ function.

Value

  • Object of class BeviMed, containing the output of the MCMC sampling.