Execution of a Single Chain in Metropolis-Hastings for Cancer Risk Estimation with Sex Differentiation
Source:R/mhChain.R
mhChain.Rd
Performs a single chain execution in the Metropolis-Hastings algorithm for Bayesian inference, specifically tailored for cancer risk estimation. It estimates parameters related to cancer penetrance based on family data, genetic information, and baseline database estimates.
Usage
mhChain(
seed,
n_iter,
burn_in,
chain_id,
ncores,
data,
twins,
max_age,
baseline_data,
prior_distributions,
af,
median_max,
max_penetrance,
BaselineNC,
var,
ageImputation,
removeProband
)
Arguments
- seed
Integer, the seed for the random number generator to ensure reproducibility.
- n_iter
Integer, the number of iterations to perform in the Metropolis-Hastings algorithm.
- burn_in
Integer, the number of initial iterations to discard (burn-in period).
- chain_id
Integer, the identifier for the chain being executed.
- ncores
Integer, the number of cores to use for parallel computation.
- data
Data frame, containing family and genetic information used in the analysis.
- twins
Information on monozygous twins or triplets in the pedigrees.
- max_age
Integer, the maximum age considered in the analysis.
- baseline_data
Numeric matrix, containing baseline risk estimates for different ages and sexes.
- prior_distributions
List, containing prior distributions for the parameters being estimated.
- af
Numeric, the allele frequency of the risk allele in the population.
- median_max
Numeric, the maximum median age for the Weibull distribution.
- max_penetrance
Numeric, the maximum penetrance value allowed.
- BaselineNC
Logical, indicates if non-carrier penetrance should be based on SEER data.
- var
Numeric, the variance for the proposal distribution in the Metropolis-Hastings algorithm.
- ageImputation
Logical, indicates if age imputation should be performed.
- removeProband
Logical, indicates if the proband should be removed from the analysis.