time-dist: Time to Coalescent Event or Mutation

Description Usage Arguments Value Examples

Description

Estimates the distribution of the times (expressed in SEN) between two coalescent events or two mutations.

Usage

1
2
3
4
5
    ## S3 method for class 'tm'
ttc(x)

    ## S3 method for class 'tm'
ttm(x)

Arguments

x

An object of class tm as returned by a call to tm

Value

A vector representing the distribution of the time to coalescent event for ttc, or the time to mutation for ttm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Load example dataset
data(pdm)

transitions <- full.transitions(pdm$unitary.transitions, pdm$loci)
pi <- stationary.dist(transitions)
n <- 10
mu <- 1
samples <- 10
est.res <- tm(transitions, pi, pdm$population, n, mu, samples)

# Plot distributions of time to coalescent event and time to mutation
par(mfrow=c(1, 2))
plot(ttc(est.res), type="b", pch=20, lty=3, xlab="SEN", ylab="",
     main="Time to coalescent event")
plot(ttm(est.res), type="b", pch=20, lty=3, xlab="SEN", ylab="",
     main="Time to mutation")

TimeMachine documentation built on Sept. 11, 2018, 5:03 p.m.