estimate.d.sequential: Estimate d using sequential method

Description Usage Arguments Details Value Examples

View source: R/d_estimation_fnxs.R

Description

Estimate d using sequential method

Usage

1
2
estimate.d.sequential(geno.matrix, fit.matrix, d.hat.MLE, d.hat.RDB, d.range,
  d.max.adj = 1.1)

Arguments

geno.matrix

Genotype matrix generated in generate.geno.matrix or read in.

fit.matrix

Fitness matrix generated in sim.stick.data or read in.

d.hat.MLE

The MLE estimate of d from estimate.d.MLE

d.hat.RDB

The estimate of d from estimate.d.RDB

d.range

Interval of d where MLE was searched. Defines when valid MLE exists (see details).

d.max.adj

When forced to use the maximum estimator, the estimate is adjusted upwards by this factor (see details). Default = 1.1 (inflate observation 10%).

Details

If a valid MLE exists, function returns it. When MLE is at the boundary as defined by d.range or less than the observed distance from wild type fitness to the maximum fitness, this is not considered a valid estimate. If MLE is not valid, but RDB estimate exists, it returns RDB estimate. If neither exists, returns the Max estimated. The Max estimate is based on the largest observed fitness times a factor d.max.adj. Name of the returned object indicates the method estimate is based on (MLE, RDB or Max).

Value

Estimate of d. Name indicates methods used.

Examples

1
2
3
4
5
6
n.muts <- length(Khan.data[1,])-1
geno.matrix <- Khan.data[,seq(1, n.muts)]
fit.matrix <- as.matrix(Khan.data[,(n.muts+1)])
d.hat.MLE <- estimate.d.MLE(geno.matrix, fit.matrix,c(0.1, 10),0.001,c(2,1))
d.hat.RDB <- estimate.d.RDB(geno.matrix, fit.matrix,-100)$d.hat.RDB
estimate.d.sequential(geno.matrix, fit.matrix, d.hat.MLE, d.hat.RDB, c(0.1, 10), 1.1)

jtvanleuven/Stickbreaker documentation built on May 20, 2019, 3:18 a.m.