sim.data.calculate.posteriors: Simulate data from priors then use to calculate posterior...

Description Usage Arguments Value Examples

View source: R/model_selection_functions.R

Description

Simulate data from priors then use to calculate posterior probability of models given data

Usage

1
2
3
sim.data.calculate.posteriors(fit.smry, data, analysis.name, coes.prior,
  sig.prior, d.range, d.adj.max, wts, n.samps.per.mod, min.R2,
  print.interval = NA, outdir = tempdir())

Arguments

fit.smry

fit.smry contains the R^2 and P values for all models and is generated in fit.models

data

Dataset to fit

analysis.name

Make up some unique name. Simulate data is saved into inst directory

coes.prior

A vector with the lower and upper bounds on the coefficients

sig.prior

A vector with the lower and upper bound on sigma

d.range

Interval of d to search for maximum over

d.adj.max

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

wts

Weights when estimating coefficients and d.

n.samps.per.mod

The number of datasets to simulate per model

min.R2

Minimum R^2 value. Suggest -1.

print.interval

Outputs progress of simulation.

outdir

Specify a directory for outputting results and temporary files. default=tempdir()

Value

List:
$posteriors Posterior probability of each epistasis model.
$multinomial.model Multinomial model fit to the simulated data used to assign posterior probabilities.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
fit.results <- fit.models(Chou.data, c(0.1, 10), 1.1, c(2,1))
sim.data.calculate.posteriors(fit.results$fit.smry,
                           Chou.data,
                           "Test",
                           c(0.05, 0.5),
                           c(0, 0.25),
                           c(0.1, 10),
                           1.1,
                           c(2,1),
                           50,
                           -1,25,
                           outdir="~/Desktop")
 
## End(Not run)

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