test_kimura_par: Generalised MC KS test for genetic drift

View source: R/test_kimura_par.R

test_kimura_parR Documentation

Generalised MC KS test for genetic drift

Description

This function is a generalisation of the test_kimura function from the lbozhilova/kimura package. It corresponds to a Monte Carlo Kolmogorov-Smirnov test to detect genetic drift by examining deviation from a Kimura distribution.

Usage

test_kimura_par(h, p, b, num_MC = 1000, round = FALSE)

Arguments

h

A vector containig heteroplasmy measurements. Every observation should be in [0,1].

p

The p parameter of the Kimura distribution. Should be in [0,1].

b

The b parameter of of the Kimura distribution. Should be in [0,1].

num_MC

number of Monte Carlo runs

round

a logical argument. True if heteroplasmy fractions are rounded to two significant digits. Be cautious as rounding can impact the calculated p-values. Default value is FALSE

Value

object of class htest

Examples

data_ex=rnorm(n,0.5,0.1)
  fit = estimate_parameters_ml(data_ex)
  p=fit[1]
  b=fit[2]
test_kimura_par(data_ex,p,b)

kostasgian21/heteroplasmy documentation built on Jan. 30, 2024, 12:30 a.m.