nls.sh: Estimate s and h with NLS

Description Usage Arguments Details Value Author(s) References

View source: R/estsh.R

Description

nls.sh estimates s and h with non-linear least squares regression.

Usage

1
nls.sh(ctraj, Ne, h, haploid, s.start = 0.1, h.start = 0.5, approximate = FALSE)

Arguments

ctraj

a consensus trajectory as returned by consensus.traj.

Ne

numeric specifying the effective population size

h

numeric defining the dominance that should be assumed. If h = NA (default) dominance will be estimated alongside with the selection coefficient.

haploid

logical indicating wether a population of haploid (haploid = TRUE) or diploid (default) individuals should be simulated.

s.start

numeric starting value for s provided to nls.

h.start

numeric starting value for h provided to nls.

approximate

logical indicating if a continuous time approximation should be used (approximate = TRUE), or not (default).

Details

Instead of calling this function directly, use estimateSH instead.

Value

A named numeric vector with estimates of both s and h (if h equals NA) is returned.

Author(s)

Thomas Taus

References

Taus T., Futschik A. and Schlötterer C., manuscript in preparation.


ThomasTaus/poolSeq documentation built on Feb. 17, 2020, 1:52 p.m.