mjmcmc | R Documentation |
Main algorithm for MJMCMC (Genetically Modified MJMCMC)
mjmcmc(
x,
y,
N = 1000,
probs = NULL,
params = NULL,
loglik.pi = NULL,
mlpost_params = list(family = "gaussian", beta_prior = list(type = "g-prior")),
intercept = TRUE,
fixed = 0,
sub = FALSE,
verbose = TRUE
)
x |
matrix containing the design matrix with data to use in the algorithm, |
y |
response variable |
N |
The number of MJMCMC iterations to run for (default 100) |
probs |
A list of various probability vectors used by GMJMCMC, generated by |
params |
A list of various parameter vectors used by MJMCMC, generated by |
loglik.pi |
A function specifying the marginal log-posterior of the model up to a constant, including the logarithm of the model prior:
|
mlpost_params |
All parameters for the estimator function loglik.pi |
intercept |
Logical. Whether to include an intercept in the design matrix. Default is |
fixed |
Integer specifying the number of leading columns in the design matrix to always include in the model. Default is 0. |
sub |
Logical. If |
verbose |
Logical. Whether to print messages during execution. Default is |
A list containing the following elements:
models |
All visited models in both mjmcmc and local optimization. |
accept |
Average acceptance rate of the chain. |
mc.models |
All models visited during mjmcmc iterations. |
best.crit |
The highest log marginal probability of the visited models. |
marg.probs |
Marginal probabilities of the features. |
model.probs |
Marginal probabilities of all of the visited models. |
model.probs.idx |
Indices of unique visited models. |
populations |
The covariates represented as a list of features. |
result <- mjmcmc(
y = matrix(rnorm(100), 100),
x = matrix(rnorm(600), 100),
loglik.pi = gaussian.loglik)
summary(result)
plot(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.