powered by
This function estimates marginal likelihood for generalized linear models using a BIC-style penalty adjusted to approximate Zellner's g-prior effect.
glm.loglik.g( y, x, model, complex, mlpost_params = list(r = NULL, family = "binomial", g = NULL) )
A list with the approximate log marginal likelihood (crit) and the posterior mode of coefficients (coefs)
crit
coefs
A vector containing the dependent variable
The matrix containing the precalculated features
A logical vector indicating which features are included in the model
A list of complexity measures for the features
A list of parameters for the log likelihood, including:
r - scalar tuning parameter for the prior (default is 1 / number of rows of x)
r
x
family - GLM family as string ("binomial", "poisson", "Gamma"), default is "binomial"
family
g - scalar specifying the g prior hyperparameter (default max of model size squared and sample size)
g
glm.loglik.g(as.integer(rnorm(100) > 0), cbind(1, matrix(rnorm(100))), c(TRUE, TRUE), list(oc = 1), list(r = 1/100, family = "binomial", g = 10))
Run the code above in your browser using DataLab