Learn R Programming

Bergm (version 3.0.1)

bbeta: Bayesian beta model

Description

Function to fit the Bayesian beta model using an MCMC algorithm.

Usage

bbeta(formula, burn.in = 100, main.iters = 1000, m.prior = NULL, sigma.prior = NULL, sigma.epsilon = NULL, ...)

Arguments

formula
formula; an R formula object, of the form ~ where is a network object and are ergm-terms.
burn.in
count; number of burn-in iterations at the beginning of an MCMC run.
main.iters
count; number of iterations for the MCMC chain excluding burn-in.
m.prior
vector; mean of the multivariate Normal prior. By default set to a vector of 0's.
sigma.prior
variance/covariance matrix for the multivariate Normal prior. By default set to a diagonal matrix with every diagonal entry equal to 100.
sigma.epsilon
variance/covariance matrix for the multivariate Normal proposal. By default set to a diagonal matrix with every diagonal entry equal to 0.0025.
...
additional arguments, to be passed to lower-level functions.

Examples

Run this code
# Make sure the observed network does not have isolated nodes
set.seed(27)

y <- network(7, directed = FALSE)

post.est <- bbeta(y ~ sociality(base = 0), 
                  main.iters = 3000,
                  sigma.epsilon = diag(1.3, dim(y[,])[1]))

bbeta.output(post.est, plot = TRUE)

Run the code above in your browser using DataLab