chaingibbs {netchain}R Documentation

Generate Gibbs samplers for counterfactual collective outcomes.

Description

This function generates the outcomes using Gibbs sampling under the given treatment assignment and edge information.

Usage

chaingibbs(pars, n.obs, treatment, covariates, initprob = 0.5,
  yvalues = c(0, 1), Neighborind, Neighborpar, n.burn)

Arguments

pars

a set of parameters

n.obs

the number of Gibbs samples.

treatment

a set of given treatment assignment of length m.

covariates

given confounder(s):

  • NULL: no confounder.

  • a vector of length m: under unique confounder.

  • a [q x m] matrix: a set of q different confounders.

initprob

an initial probability generating outcomes. Defaults to initprob = 0.5

yvalues

distinct binary values for outcomes. Defaults to (0,1).

Neighborind

a list of matrix specifying edge information of which first column illustrates a type of variables (1:outcome, 2:treatment, 3~:confounders) and of which second column presents the index of those variable.

Neighborpar

index for parameters in the order of Neighborind.

n.burn

the number of burn-in sample in Gibbs sampling ( n.obs).

Value

a [n.obs x m] matrix each row of which consists of outcomes.


[Package netchain version 0.1.0 Index]