bootstrap_rho: Perform a parametric bootstrapping correction on an estimated...

View source: R/simulation_pipelines.R

bootstrap_rhoR Documentation

Perform a parametric bootstrapping correction on an estimated rho vector

Description

Takes an estimate of rho, and a two-column format genetic data frame containing both reference and mixture data. Returns a new rho corrected by parametric bootstrapping

Usage

bootstrap_rho(
  rho_est,
  pi_est,
  D,
  gen_start_col,
  niter = 100,
  reps = 2000,
  burn_in = 100,
  pi_prior = NA,
  pi_prior_sum = 1
)

Arguments

rho_est

the rho value previously estimated from MCMC GSI from the provided reference and mixture data

pi_est

the pi value previously estimated from MCMC GSI from the provided reference and mixture data

D

a two-column genetic dataframe containing the reference and mixture data from which rho_est was computed; with "repunit", "collection", and "indiv" columns

gen_start_col

the first column of genetic data in D. All columns after gen_start_col must be genetic data

pi_prior

The prior to be added to the collection allocations, in order to generate pseudo-count Dirichlet parameters for the simulation of a new pi vector. Non-default values should be a vector of length equal to the number of populations in the reference dataset. Default value of NA leads to the calculation of a symmetrical prior based on pi_prior_sum.

pi_prior_sum

total weight on default symmetrical prior for pi.

In parametric bootstrapping, niter new mixture datasets are simulated by individual from the reference with reporting unit proportions rho_est, and the mean of their MCMC GSI outputs is used to calculate an average bias. This bias is subtracted from rho_est to give the output. The number of individuals in each simulated bootstrap dataset is equal to the number of "mixture" individuals in D.

Value

bootstrap_rho returns a new rho value, corrected by parametric bootstrapping.


benmoran11/rubias documentation built on Feb. 1, 2024, 10:52 p.m.