glmBayes: glmBayes: Bayesian Generalized Linear Models

Description Usage Arguments Details Examples

View source: R/bayesglm.R View source: R/bayesglm.R

Description

glmBayes: Bayesian Generalized Linear Models

This implements the Zellner-Siow Cauchy g-prior for generalized linear models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
glmBayes(
  formula,
  data,
  family = "gaussian",
  link = NULL,
  g = NULL,
  max_iter = 9000,
  sim = FALSE,
  nsim = 4000,
  threshold = 1e-09
)

glmBayes(
  formula,
  data,
  family = "gaussian",
  link = NULL,
  g = NULL,
  max_iter = 9000,
  sim = FALSE,
  nsim = 4000,
  threshold = 1e-09
)

Arguments

formula

model formula

data

a data frame

family

"gaussian", "poisson", "negbinom", "binomial", "gamma", "invgauss"

link

the link function. see details for available options.

g

a custom value for g prior. If left as NULL, the default is the ratio of sample size to predictors.

max_iter

max iterations for IRWLS algoritm

sim

if TRUE, draws the specified number of samples from the posterior distribution. defaults to FALSE.

nsim

the number of posterior samples. defaults to 4000.

threshold

tolerance for convergence

x

argument

...

other arguments

Details

This implements the Zellner-Siow Cauchy g-prior for generalized linear models

The following distributions and corresponding link functions are available:

Gaussian: "identity"
Binomial: "logit", "probit", "cauchit", "robit" (Student T with 3 df), and "cloglog"
Poisson & Negative Binomial: "log"
Gamma: "inverse" (1 / x)
Inverse Gaussian: "invsquare" (1/x^2)

Examples

1

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.