sim.mult.data: Simulate data under multiplicative model.

Description Usage Arguments Details Value Examples

View source: R/simulate_data_fnxs.R

Description

Simulate data under multiplicative model.

Usage

1
sim.mult.data(n.muts, selcoes, sigma, w.wt, geno.matrix)

Arguments

n.muts

Number of mutations.

selcoes

Vector of selection coefficients for each mutation

sigma

Noise to add to expectations

w.wt

Fitness of the wildtype

geno.matrix

Specifies which genotypes are simulated.

Details

Function takes selection coefficients (selcoes) and generates the expected fitness values for each genotype. This set of expected values is returned as fit.matrix.exp. Then it adds normal error to them to produce the "observed" data (fit.matrix).

Value

List:
[[1]] fit.matrix is matrix with (simulated) observed data
[[2]] fit.matrix.exp is same matrix without error

Examples

1
2
3
 geno.matrix <- generate.geno.matrix(3)
 selcoes <- rep(0.3, 3)
 sim.mult.data(3, selcoes, 0.1, 1, geno.matrix)

Example output

$fit.matrix.exp
      [,1]
[1,] 1.000
[2,] 1.300
[3,] 1.300
[4,] 1.690
[5,] 1.300
[6,] 1.690
[7,] 1.690
[8,] 2.197

$fit.matrix
         [,1]
[1,] 1.000000
[2,] 1.456364
[3,] 1.174114
[4,] 1.703405
[5,] 1.252324
[6,] 1.710341
[7,] 1.653706
[8,] 2.047931

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