Skip to contents

Performs a single chain execution in the Metropolis-Hastings algorithm for Bayesian inference, specifically tailored for cancer risk estimation without considering sex differentiation. It estimates parameters related to cancer penetrance based on family data, genetic information, and baseline database estimates.

Usage

mhChain_noSex(
  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 vector, containing baseline risk estimates for different ages.

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

Logical, indicates if the maximum median age should be used 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.

Value

A list containing samples, log likelihoods, acceptance ratio, and rejection rate for each iteration.