View source: R/adjustReversible.R
adjustReversible | R Documentation |
The Metropolis - Hastings conversions may give a mutation matrix balancedMutmat
with too small expected mutation rate (gamma). The balancedMutmat
matrix is adjusted
to have expected mutation rate a equal to that of the original mutation matrix mutmat
.
adjustReversible(
mutmat,
balancedMutmat,
method = "MH",
afreq = NULL,
check = TRUE
)
mutmat |
Original, non balanced, mutation matrix. |
balancedMutmat |
Balanced, mutation matrix. |
method |
Character. MH, PM or BA conversions. |
afreq |
A vector with allele frequencies.
of the same length as the size of |
check |
Logical. Checks if |
If balancedMutmat == NULL
, mutmat
is first balanced.
The adjusted balanced matrix is
alpha * balancedMutmat + (1-alpha) * I
where
alpha
is the ratio of the (expected mutation) rates of the original matrix,
mutmat
to the balanced version balancedMutmat
and I
is the identity matrix.
Adjusted mutation matrix.
Thore Egeland.
[makeReversible()]
library(pedmut)
afreq = c(0.1, 0.3, 0.4, 0.2)
names(afreq) = 1:4
mutmat = mutationMatrix("onestep", rate = 0.02, alleles = 1:4)
adj = adjustReversible(mutmat, balancedMutmat = NULL,
method = "BA", afreq = afreq, check = TRUE)
attr(mutmat, "rate") - attr(adj, "rate")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.