constrained_posterior: Constrained Posterior Distribution

Description Usage Arguments Value References Examples

View source: R/constrained_post.R

Description

Compute the posterior distribution with off-diagonal elements of the precision matrix constrained to zero.

Usage

1
2
3
4
5
6
7
8
constrained_posterior(
  object,
  adj,
  method = "direct",
  iter = 5000,
  progress = TRUE,
  ...
)

Arguments

object

An object of class estimate or explore

adj

A p by p adjacency matrix. The zero entries denote the elements that should be constrained to zero.

method

Character string. Which method should be used ? Defaults to the "direct sampler" (i.e., method = "direct") described in \insertCite@page 122, section 2.4, @lenkoski2013direct;textualBGGM. The other option is a Metropolis-Hastings algorithm (MH). See details.

iter

Number of iterations (posterior samples; defaults to 5000).

progress

Logical. Should a progress bar be included (defaults to TRUE) ?

...

Currently ignored.

Value

An object of class contrained, including

References

\insertAllCited

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# data
Y <- bfi[,1:10]

# sample posterior
fit <- estimate(Y, iter = 100)

# select graph
sel <- select(fit)

# constrained posterior
post <- constrained_posterior(object = fit,
                              adj = sel$adj,
                              iter = 100,
                              progress = FALSE)

BGGM documentation built on Aug. 20, 2021, 5:08 p.m.