Learn R Programming

BEDASSLE (version 1.6.1)

posterior.predictive.sample: Generates posterior predictive samples

Description

This function simulates data using the inference model parameterized from the joint posterior of the MCMC and the observed independent variables (\(D_{ij} and E_{ij}\)). These posterior predictive samples can be compared to the observed data to see how well the model is able to describe the observed data.

Usage

posterior.predictive.sample(MCMC.output, posterior.predictive.sample.size, output.file, 
prefix = "")

Arguments

MCMC.output

The standard MCMC output file generated from a BEDASSLE run.

posterior.predictive.sample.size

The number of posterior predictive datasets the user wishes to simulate.

output.file

The name that will be assigned to the R object containing the posterior predictive datasets. The suffix ".Robj" will be appended to the user-specified name.

prefix

If specified, this prefix will be added to the output file name.

Author

Gideon Bradburd

Details

This function simulates datasets like those the user analyzed with BEDASSLE, using the same independent variables (sample.sizes, \(D_{ij}\) and \(E_{ij}\)) as in the user's dataset and plugging them into the inference model, which is parameterized by randomly drawing parameter values from the joint posterior output of the MCMC analysis. These posterior predictive simulated allelic count data are summarized as unbiased pairwise \(F_{ST}\) (using calculate.all.pairwise.Fst), which may then be compared to the observed unbiased pairwise \(F_{ST}\) to determine how well the model is able to describe the user's data. The output of posterior.predictive.sample can be visualized using plot.posterior.predictive.sample.