View source: R/makeStationary.R
makeStationary | R Documentation |
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.
makeStationary(mutmat, afreq = NULL, method = "PM")
mutmat |
A square mutation matrix; typically a |
afreq |
A vector of allele frequencies. Extracted from |
method |
A character string indicating the method to use. Currently only "PM" is implemented. |
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.
An object of the same class the input mutmat
; either a matrix, a
mutationMatrix
or a mutationModel
.
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")}
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.