fit.models: Fit all models to data

Description Usage Arguments Details Value See Also Examples

View source: R/model_fitting_functions.R

Description

Fit all models using fit.models. Used as a wrapper to combine outputs from estimate.d.MLE, estimate.d.RDB, estimate.d.sequential, fit.stick.model.given.d, fit.mult.model, fit.add.model, and summarize.fits.for.posterior.calc.

Usage

1
fit.models(data, d.range, d.adj.max = 1.1, wts = c(2, 1))

Arguments

data

(Required). A list containing fitness values for allele combinations. See examples in data or in the vignette.

d.range

(Required). Range of realistic fitness changes from WT. "d" is the difference between maximal fitness and WT fitness. For example, WT fitness for the virus phix174 is about 20, but values up to about 25 have been observed, so d.range was set to: d.range <- c(0.1,10).

d.adj.max

(Optional). Default 1.1. When the estimation of d fails in estimate.d.MLE, estimate.d.RDB, or estimate.d.sequential then d becomes 1.1*WT fitness so that models can be fit.

wts

(Optional). Default c(2,1).

Details

Function is a wrapper that fits the data to all three models. First, it estimates $d$ and, using this estimate, fits the stickbreaking model. Then it fits the multiplicative and additive models.

Value

List:
[[1]] fit.smry contains the R^2 and P values for all models coefficients
[[2]] fit.stick contains stickbreaking model details like the intercept, slope, and predicted fitness values for the given allele combinations.
[[2]] fit.mult contains multiplicative model details like the intercept, slope, and predicted fitness values for the given allele combinations.
[[2]] fit.stick contains additive model details like the intercept, slope, and predicted fitness values for the given allele combinations.

See Also

estimate.d.MLE, estimate.d.RDB, estimate.d.sequential, fit.stick.model.given.d, fit.mult.model, fit.add.model, summarize.fits.for.posterior.calc, estimate.d.MLE, estimate.d.RDB, estimate.d.sequential

Examples

1
fit.models(Chou.data, d.range=c(0.1, 10), d.adj.max=1.1, wts=c(2,1))

Stickbreaker documentation built on May 29, 2017, 9:01 a.m.