bayescmp: Fitting COM-Poisson (mean parametrization) Model Based on...

Description Usage Arguments Author(s) Examples

View source: R/cmp.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
bayescmp(formula, data, sumto, .control_model = control_model(),
  .control_samples = control_samples())

Arguments

formula

A formula to define fixed effects.

data

The data frame.

sumto

Upper bound to infinite sum of the normalization constant

.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 <- bayescmp(y ~ X - 1, sumto = 100L)
vapply(model$samples, function(x) apply(x, 2L, mean), double(3))

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