fitBiasedDrift: Fit crypt biased stem cell drift model.

Description Usage Arguments Value Examples

View source: R/fit_BiasedDrift.R

Description

fitBiasedDrift will run an mcmc algorithm to infer the parameters from the biased drift model.

Usage

1
2
3
4
5
6
7
8
9
fitBiasedDrift(
  x,
  time_interval,
  WT_params,
  max_iter = 80000,
  n_par_chains = 2,
  burn_in = 5000,
  thin = 50
)

Arguments

x

Clone size counts. With a column per day and a row per size clone size.

time_interval

vector of time point values. Should have same number of elements as columns in x.

WT_params

List with wild type neutral drift parameters (N, lambda and tau).

max_iter

number of mcmc iterations to run.

n_par_chains

number of parallel chains (and cpus used) to run.

burn_in

mcmc burn in

thin

mcmc thining

Value

Will retrun a list that can be used directly with the plotting functions. The list contains an mcmc matrix, the data and time vector used to fit, as well as the MAP estimate of the parameters.

Examples

1
2
3
4
5
6
7
time_points = c(4, 7, 10, 14, 21)
WT_params = list(lambda = 0.1, N  = 5, tau = 1)
x = simulateBiasedDriftData(WT_params$lambda, WT_params$N, WT_params$tau, Pr = 0.7, time_points, 8, 300)

fit_out = fitBiasedDrift(x, time_points, WT_params)
plotsConvergence_Biased(fit_out)
plotsBiasDrift_Fit(fit_out)

MorrisseyLab/CryptDriftR documentation built on Aug. 7, 2021, 8:22 p.m.