bp: MCMC with bipartite graph

Description Usage Arguments Details Value Examples

View source: R/bp.R

Description

MCMC with bipartite graph

Usage

1
2
3
bp(whole, part, edge, alpha = 0.05, beta = 0.2, pi = 0.01,
  nburn = 10000, ngen = 100000, sub = 1000, penalty = 2,
  initial = c("inactive", "random", "high"))

Arguments

whole

Vector of character strings with names of whole nodes

part

Vector of 0's and 1's indicating active part nodes; names are the names of the part nodes

edge

Matrix with two columns; each row indicates an edge between a whole node and a part node

alpha

Parameter alpha (0 < alpha < beta < 1)

beta

Parameter alpha (0 < alpha < beta < 1)

pi

Parameter pi (0 < pi < 1)

nburn

Number of burn-in generations

ngen

Number of sample generations

sub

Subsample rate for burn-in and sample files

penalty

Penalty per illegal node to loglikelihood

initial

Initial state (see Details)

Details

The initial argument can take one of three values: "inactive" - all whole nodes inactive; "random" - all whole nodes active with probability pi, no illegal nodes; or "high" - all nodes with proportion of connected part nodes with response equal to 1 above 0.4 are active, no illegal nodes.

Value

data frame with "whole" results; burn+sample detail are included as an attribute, "samples", which is a matrix

Examples

1
2
3
data(t2d)
bp.out <- bp(whole=t2d$whole, part=t2d$part, edge=t2d$edge,
             nburn=1000, ngen=1000, sub=100)

kbroman/bp documentation built on May 20, 2019, 8:11 a.m.

Related to bp in kbroman/bp...