Learn R Programming

TimeMachine (version 1.2.1)

pophistory: History of Population Size

Description

Estimates the sequential event number (SEN) quantiles for each simulated population size.

Usage

# S3 method for tm
pophistory(x, probs=seq(0, 1, 0.25))

Arguments

x

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

probs

Probabilities passed to quantile

Value

A matrix of column vectors containing the estimated SEN quantiles, with row names specifying the population size.

Examples

Run this code
# NOT RUN {
# 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 minimum, median and maximum SEN as a function of population size
h <- pophistory(est.res, probs=c(0, 0.5, 1))
matplot(h, rownames(h), type="s", lty=c(3, 1, 3), col="black",
        xlab="Population size", ylab="SEN")
# }

Run the code above in your browser using DataLab