GWishart_PAS_DMH: Gaussian Non-decomposable graph determination using PAS...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/GWishart_PAS_DMH.R

Description

MCMC algorithm for Gaussian Non-decomposable graph determination using PAS algorithm.

Usage

1
GWishart_PAS_DMH(b_prior, D_prior, n, S, C, beta, burnin, nmc)

Arguments

b_prior

d.f.

D_prior

location

n
S
C

initial partial covariance matrix

beta
burnin

number of MCMC burnin

nmc

number of MCMC samples

Details

Sample C from Gwishart distribution with density: p(C) \propto |C|^{(bG-2)/2} exp(-1/2 tr(C DG)) where (1) bG : d.f. (2) DG: location C: initial partial covariance matrix;

Value

C

Samples from G-Wishart distribution. The result is 3D array with c(dim(C)[1],dim(C)[2], nmc ).

Sig

Inverse of C The result is 3D array with c(dim(C)[1],dim(C)[2], nmc ).

adj

Sampled adjacency matrix. The result is 3D array with c(dim(C)[1],dim(C)[2], nmc ).

Author(s)

Hao Wang ; Sophia Zhengzi Li

References

Wang and Li (2011) "Efficient Gaussian Graphical Model Determination without Approximating Normalizing Constant of the G-Wishart distribution " http://www.stat.sc.edu/~wang345/RESEARCH/GWishart/GWishart.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
    p = 6; tedge = p*(p-1)/2; beta = 0.5; 
    indmx = matrix(1:(p^2),p,p); 
    b_prior = 3; 
    D_prior = diag(p); 
    n = 3*p; 
    b_post = b_prior+n;
    A = toeplitz(c(1,0.5,matrix(0,1,p-2))); 
    A[1,p] = 0.4; 
    A[p,1] = 0.4;
    S = solve(A)*n; 
    D_post = D_prior + S;
    adjTrue = 1*(abs(A)>0.001);  
    burnin  = 30; nmc = 100; C = diag(p); 
    resPAS_DMH <- GWishart_PAS_DMH(b_prior,D_prior,n,S,C,beta,burnin,nmc);
    C_save  <- resPAS_DMH[[1]]
    Sig_save<- resPAS_DMH[[2]]
    adj_save<- resPAS_DMH[[3]]

NonDecompGraph documentation built on May 31, 2017, 4:56 a.m.