makeStationary: Transformation (stabilisation) to stationarity

View source: R/makeStationary.R

makeStationaryR Documentation

Transformation (stabilisation) to stationarity

Description

For a given mutation model ⁠(M,p)⁠, transform M into another mutation matrix S such that S is stationary with respect to p. Several methods for doing this are described by Simonsson and Mostad (2016); only the "PM" method is included here.

Usage

makeStationary(mutmat, afreq = NULL, method = "PM")

Arguments

mutmat

A square mutation matrix; typically a mutationMatrix() or mutationModel().

afreq

A vector of allele frequencies. Extracted from mutmat if not provided.

method

A character string indicating the method to use. Currently only "PM" is implemented.

Details

These transformations may also be applied by setting transform = "PM" in mutationMatrix() or mutationModel().

For details about the transformation, see Simonsson and Mostad (2016).

This function is a slightly optimised version of the stabilize() method in the Familias R package.

Value

An object of the same class the input mutmat; either a matrix, a mutationMatrix or a mutationModel.

References

Simonsson & Mostad (2016). Stationary mutation models. Forensic Sci. Int. Genet. 23:217–225. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.fsigen.2016.04.005")}

Examples


afreq = c(`1` = .2, `2` = .3, `3` = .5)
m = mutationMatrix("step", afreq = afreq, rate=0.1, rate2=0.01, range=0.1)
m
makeStationary(m, afreq = c(.3,.3,.4))


### Example with full model (i.e., male and female)

M = mutationModel("equal", afreq = afreq, rate = list(male=0.1, female=0.2))
M
makeStationary(M)


pedmut documentation built on June 8, 2025, 9:34 p.m.