run.bedassle | R Documentation |
run.bedassle
runs a BEDASSLE analysis
run.bedassle( genDist, geoDist = NULL, envDist = NULL, nLoci, prefix, n.chains = 4, n.iter = 2000, make.figs = TRUE, save.stanfit = TRUE, ... )
genDist |
A |
geoDist |
A |
envDist |
A |
nLoci |
The number of loci used in the calculation of the pairwise
pi |
prefix |
A character |
n.chains |
An integer indicating the number of MCMC chains to be run in the analysis. Default is 4. |
n.iter |
An |
make.figs |
A |
save.stanfit |
A |
... |
Further options to be passed to rstan::sampling (e.g., adapt_delta). |
This function runs an analysis that estimates the relative contributions of geographic and environmental/ecological distances to patterns of genetic differentiation between samples.
This function acts as a wrapper around a STAN model block determined
by the user-specified model (e.g., just geographic distance, or geographic distance
plus 2 environmental/ecological distance variables).
User-specified data are checked for appropriate format and consistent dimensions,
then formatted into a data.block
,
which is then passed to the STAN model block.
The model output is written to three tab-delimited text files described above.
The parameter values are rounded to 4 decimal places
The full stanfit
model output is also saved if save.stanfit=TRUE
.
If make.figs=TRUE
, running run.bedassle
will also generate figures
depicting different aspects of model output; these are detailed in the function
make.all.bedassle.plots
in this package.
This function writes all output to three tab-delimited text files
for each chain run (specified with n.chains
). The output files
associated with each chain have "chain_X" for the Xth chain appended
to the file name, and begin with the prefix specified with the
prefix
argument. The three output files associated with each
chain are described below:
posterior
contains the posterior probability and
parameter estimates over the sampled posterior distribution
of the MCMC. Each entry described below has its own named
column in the output text file. Columns are separated by tabs.
lpd
log posterior density over the retained
MCMC iterations.
alpha0
posterior draws for alpha0 parameter.
alphaD
posterior draws for alphaD parameter.
alphaE
posterior draws for alphaE parameter(s).
Named "alphaE_E" for the Eth environmental distance
matrix specified.
alpha2
posterior draws for alpha2 parameter.
nuggets
posterior draws for nugget parameters.
Named "nugget_N" for the Nth sample in the dataset.
MAP
contains point estimates of the parameters listed in
the posterior
file described above. Values are
indexed at the MCMC iteration with the greatest
posterior probability.
parCov
contains the covariance matrix parameterized by the
MAP parameter point estimates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.