R/metrop_hier_priors.R
run_metrop_priors.Rd
Run the hierarchical Metropolis Hastings model to infer priors
run_metrop_priors(
multi.dat,
covar = FALSE,
covar_vec = NULL,
is_covar_categorical = FALSE,
nits = 10000,
thin = 1,
posterior = FALSE,
avg_pik = TRUE,
avg_posterior = TRUE,
pik = FALSE,
alpha_mean = -10,
alpha_sd = 0.5,
beta_shape = 2,
beta_scale = 2,
gamma_shape = 2,
gamma_scale = 2
)
matrix of bf values, rows=traits, named columns=("lBF.Ha","lBF.Hc","nsnps")
whether to include covariates
vector of covariates
only two categories supported (default=FALSE) - Experimental
number of iterations
burnin
default: FALSE, estimate posterior probabilities of the hypotheses
default: FALSE, estimate the average of the pik
default: FALSE, estimate the average of the posterior probabilities of the hypotheses
default: FALSE, inferred prior probabilities
prior for the mean of alpha
prior for the standard deviation of alpha
prior for the shape (gamma distibution) of beta
prior for the scale of beta
prior for the shape (gamma distibution) of gamma
prior for the scale of gamma
List containing the posterior distribution of the parameters alpha, beta, gamma (if covariate included) and the loglikelihood
if avg_posterior=TRUE matrix with average of all the posterior probabilities of Hn, Ha and Hc
if avg_pik=TRUE matrix with average of all the priors: pn, pa and pc
data, nits and thin contain the input data, number of iterations and burnin respectively specified for the hierarchical model