gmjmcmc {FBMS} | R Documentation |
Main algorithm for GMJMCMC (Genetically Modified MJMCMC)
Description
Main algorithm for GMJMCMC (Genetically Modified MJMCMC)
Usage
gmjmcmc(
data,
loglik.pi = gaussian.loglik,
loglik.alpha = gaussian.loglik.alpha,
transforms,
P = 10,
N.init = 100,
N.final = 100,
probs = NULL,
params = NULL,
sub = FALSE,
verbose = TRUE
)
Arguments
data |
A matrix containing the data to use in the algorithm, first column should be the dependent variable, and the rest of the columns should be the independent variables. |
loglik.pi |
The (log) density to explore |
loglik.alpha |
The likelihood function to use for alpha calculation |
transforms |
A Character vector including the names of the non-linear functions to be used by the modification and the projection operator. |
P |
The number of generations for GMJMCMC (Genetically Modified MJMCMC). The default value is $P = 10$. A larger value like $P = 50$ might be more realistic for more complicated examples where one expects a lot of non-linear structures. |
N.init |
The number of iterations per population (total iterations = (T-1)*N.init+N.final) |
N.final |
The number of iterations for the final population (total iterations = (T-1)*N.init+N.final) |
probs |
A list of the various probability vectors to use |
params |
A list of the various parameters for all the parts of the algorithm |
sub |
An indicator that if the likelihood is inexact and should be improved each model visit (EXPERIMENTAL!) |
verbose |
A logical denoting if messages should be printed |
Value
A list containing the following elements:
models |
All models per population. |
lo.models |
All local optimization models per population. |
populations |
All features per population. |
marg.probs |
Marginal feature probabilities per population. |
model.probs |
Marginal feature probabilities per population. |
model.probs.idx |
Marginal feature probabilities per population. |
best.margs |
Best marginal model probability per population. |
accept |
Acceptance rate per population. |
accept.tot |
Overall acceptance rate. |
best |
Best marginal model probability throughout the run, represented as the maximum value in |
Examples
result <- gmjmcmc(matrix(rnorm(600), 100), P = 2, gaussian.loglik, NULL, c("p0", "exp_dbl"))
summary(result)
plot(result)