bayesgct: Fitting Gamma-Count Model Based on MCMC

Description Usage Arguments Author(s) Examples

View source: R/gct.R View source: R/mixedgct.R

Description

Build matrices and organize data to use jags.model andcoda.samples for analysis of Bayesian models using Markov Chain Monte Carlo (MCMC).

Usage

1
2
bayesgct(formula, data, .control_model = control_model(),
  .control_samples = control_samples())

Arguments

formula

A formula to define fixed effects.

data

The data frame.

.control_model

See control_model.

.control_samples

See control_samples.

Author(s)

Eduardo Jr

Examples

1
2
3
4
5
6
7
8
# Simulate data
beta <- c(3, -1)
X <- cbind(1, runif(50))
y <- rpois(50, lambda = exp(X %*% beta))

# Sampling and summarise posterior
model <- bayesgct(y ~ X - 1)
vapply(model$samples, function(x) apply(x, 2L, mean), double(3))

jreduardo/bayescm documentation built on May 17, 2019, 7:29 p.m.