prior_sampling {graphicalEvidence}R Documentation

Sample The Precision Matrix

Description

Takes specified prior_name and relevant parameters to sample the precision matrix nmc times after discarding the first number of runs specified by burnin.

Usage

prior_sampling(
  p,
  burnin,
  nmc,
  prior_name = c("BGL", "GHS", "G_Wishart"),
  G = NULL,
  V = NULL,
  alpha = NULL,
  lambda = NULL
)

Arguments

p

The dimension of the precision matrix that will be sampled

burnin

The number of iterations the MCMC sampler should iterate through and discard before beginning to save results

nmc

The number of samples that will be drawn

prior_name

The name of the prior for which the marginal should be calculated, this is one of 'Wishart', 'BGL', 'GHS', 'G_Wishart'

G

The adjacency matrix when specifying 'G_Wishart' prior

V

The scale matrix when specifying 'Wishart' or 'G_Wishart' prior

alpha

A number specifying alpha for the priors of 'Wishart' and 'G_Wishart'

lambda

A number specifying lambda for the priors of 'BGL' and 'GHS' prior

Value

An array of dim nmc x p x p where each p x p slice is one sample of the precision matrix

Examples

# Draw 5000 samples of the precision matrix for GHS prior distribution with
# parameter lambda set to 1
ghs_samples <- prior_sampling(5, 1e3, 5e3, 'GHS', lambda=1)

[Package graphicalEvidence version 1.1 Index]