geom.series: Geometric series

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/geom.series.R

Description

Function to simulate haplotype abundances in the quasispecies by geometric series.

Usage

1
geom.series(n,p=0.001)

Arguments

n

Number of frequencies to compute.

p

Numeric parameter of the geometric function.

Details

The abundances, as counts, are computed according to the following equation:

p ~(1-p)^{i-1}, ~~ i=1..n

The lower r, the faster the decrease in abundances.

Value

Numeric vector with n decreasing counts.

Author(s)

Mercedes Guerrero-Murillo and Josep Gregori

See Also

GetRandomSeq, GenerateVars, Diverge

Examples

1
2
3
4
5
# Simulate a quasispecies alignment.
m1 <- GetRandomSeq(50)
v1 <- GenerateVars(m1,50,2,c(10,1)) 
qs <- c(m1,v1)
w <- geom.series(100,0.8)

VHIRHepatiques/QSutils documentation built on Oct. 24, 2018, 12:06 p.m.