twMCMC: Function to run MCMC sampling for model of Tebaldi & West...

Description Usage Arguments Value References Examples

View source: R/twMCMC.R

Description

Runs MCMC sampling for the gamma-Poisson model presented in Tebaldi & West (1998). The algorithm used is a modification of that presented in the original paper. It uses a joint proposal for (x_k, lambda_k) to greatly accelerate convergence.

Usage

1
twMCMC(Y, A, prior, ndraws = 120000, burnin = 20000, verbose = 0)

Arguments

Y

numeric vector of observed link loads at a single time (length k)

A

routing matrix of dimension (k x n); needs to be full row rank

prior

parameters for conjugate gamma prior (convolution and rate)

ndraws

integer number of draws for sampler to produce (excluding burn-in)

burnin

integer number of additional draws to discard as burnin

verbose

integer level of verbosity; levels > 1 have no effect currently

Value

list consisting of matrix of draws for X XDraws, matrix of draws for X lambdaDraws, and vector of acceptances per OD flow accepts

References

C. Tebaldi and M. West. Bayesian inference on network traffic using link count data. Journal of the American Statistical Association, 93(442):557-573, 1998.

Examples

1
2
3
4
5
6
7
8
data(bell.labs)
# Quick, simple run to test the function
prior <- list(a=rep(1, ncol(bell.labs$A)), b=rep(0, ncol(bell.labs$A)))
mcmcOut <- twMCMC(Y=bell.labs$Y[1,], A=bell.labs$A, prior=prior,
                  ndraws=1000, burnin=100,
                  verbose=0)
print(summary(mcmcOut$XDraws))
print(mcmcOut$accepts)

networkTomography documentation built on May 2, 2019, 3:28 a.m.