fitNeutralDrift: Fit crypt neutral drift model.

Description Usage Arguments Value Examples

View source: R/fit_NeutralDrift.R

Description

fitNeutralDrift will run an mcmc algorithm to infer the parameters from the neutral drift model.

Usage

1
2
3
4
5
6
7
8
fitNeutralDrift(
  x,
  time_interval,
  max_iter = 40000,
  n_par_chains = 2,
  burn_in = 5000,
  thin = 20
)

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.

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
time_points = c(4, 7, 10, 14, 21)
x = simulateNeutralDriftData(0.1, 5, 2, time_points, 8, 300)
fit_out = fitNeutralDrift(x, time_points)
plotsConvergence_Neutral(fit_out)
plotsNeutralDrift_Fit(fit_out)

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