sim.partial.data.from.priors.for.mod.selection: Simulate partial data from priors for doing model selection

Description Usage Arguments Details Value

View source: R/model_selection_functions.R

Description

Simulate partial data from priors for doing model selection

Usage

1
2
3
4
sim.partial.data.from.priors.for.mod.selection(geno.matrix, coes.prior,
  sigs.prior, mods.to.sim, d.true, d.range, d.adj.max, w.wt, wts, outpath,
  n.samps.per.mod, coe.sim.model = "identical", coe.dist.par = NA,
  print.interval)

Arguments

geno.matrix

Matrix specifying which genotypes to simulate

coes.prior

A vector with the lower and upper bounds on the coefficients

sigs.prior

Range for uniform prior on sigma

mods.to.sim

Models to simulate under. Vector with model names of the form c("stick", "mult", "add").

d.true

True value of d.

d.range

Range of possible values for d. If estimate is outside this, estimate is not considered valid.

d.adj.max

Factor to increase observed distant to max fitness by for ad hoc d estimate (when other estimators fail)

w.wt

Wild type fitness.

wts

Weights when estimating coefficients and d.

outpath

Full path including file name to write results

n.samps.per.mod

Number of datasets to simulate per model

coe.sim.model

Coefficient simulation model. See details.

coe.dist.par

Coefficient distribution parameter. If coe.sim.model=="uniform", then uniform is U(-coe.dist.par, +coe.dist.parm). If coe.sim.model=="normal", then distributed normal with mean given by coe.v and sigma give by coe.dist.parm.

print.interval

Every this many replicates, prints out replicate number. If NA (default) no printing is done.

Details

This function generates datasets by drawing from priors. It generates n.samps.per.mod per model. It then analyzes each dataset under all three models writes one row of summary statistics to the output file (defined by outpath). coe.sim.model: The expected coefficient is sampled from uniform prior (coes.prior): E[coe] The coe.sim.model determines how the individual coefficients are generated. Possible values: "identical" means all coefficients take same value–E[coe]. "uniform" indicates to sample individual coefficients from a uniform distribution: U(E[coe]-coe.dist.par, E[coe]+coe.dist.parm). "normal" means sample coefficients from normal distribution with mean E[coe] and sigma given by coe.dist.par. Default = "identical".

Value

Nothing. Instead results are written to outpath file for later analysis


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