glm.loglik: Log likelihood function for glm regression with a Jeffreys...

glm.loglikR Documentation

Log likelihood function for glm regression with a Jeffreys parameter prior and BIC approximations of the posterior This function is created as an example of how to create an estimator that is used to calculate the marginal likelihood of a model.

Description

Log likelihood function for glm regression with a Jeffreys parameter prior and BIC approximations of the posterior This function is created as an example of how to create an estimator that is used to calculate the marginal likelihood of a model.

Usage

glm.loglik(
  y,
  x,
  model,
  complex,
  mlpost_params = list(r = exp(-0.5), family = "Gamma")
)

Arguments

y

A vector containing the dependent variable

x

The matrix containing the precalculated features

model

The model to estimate as a logical vector

complex

A list of complexity measures for the features

mlpost_params

A list of parameters for the log likelihood, supplied by the user, family must be specified

Value

A list with the log marginal likelihood combined with the log prior (crit) and the posterior mode of the coefficients (coefs).

Examples

glm.loglik(abs(rnorm(100))+1, matrix(rnorm(100)), TRUE, list(oc = 1))



FBMS documentation built on Sept. 13, 2025, 1:09 a.m.