R.gibbs: The expectation of covariance matrix using Gibbs sampling

View source: R/R.gibbs.R

R.gibbsR Documentation

The expectation of covariance matrix using Gibbs sampling

Description

This function implements the Gibbs sampling method within Gaussian copula graphical model to estimate the conditional expectation for the data that not follow Gaussianity assumption (e.g. ordinal, discrete, continuous non-Gaussian, or mixed dataset).

Usage

R.gibbs(y, theta, gibbs.iter = 1000, mc.iter = 500, 
                   ncores = NULL, verbose = TRUE)

Arguments

y

An (n \times p) matrix or a data.frame corresponding to the data matrix (n is the sample size and p is the number of variables). It also could be an object of class "simgeno".

theta

A p \times p precision matrix. Default is a diagonal matrix.

gibbs.iter

The number of burn-in for the Gibbs sampling. The default value is 1000.

mc.iter

The number of Monte Carlo samples to calculate the conditional expectation. The default value is 500.

ncores

If ncores = NULL, the algorithm internally detects number of available cores and run the calculations in parallel on (available cores - 1). Typical usage is to fix ncores = 1 when p is small ( p < 500 ), and ncores = NULL when p is very large.

verbose

If verbose = FALSE, printing information is disabled. The default value is TRUE.

Details

This function calculates \bar{R} using Gibbs sampling method within the E-step of EM algorithm, where

\bar{R} = n ^ {-1} \sum_{i=1}^{n} E( Z^{(i)} Z^{(i)t} | y^{(i)}, \hat{\Theta}^{(m)})

which n is the number of sample size and Z is the latent variable which is obtained from Gaussian copula graphical model.

Value

ES

Expectation of covariance matrix ( diagonal scaled to 1) of the Gaussian copula graphical model

Author(s)

Pariya Behrouzi, Danny Arends and Ernst C. Wit
Maintainers: Pariya Behrouzi pariya.behrouzi@gmail.com

References

1. Behrouzi, P., Arends, D., and Wit, E. C. (2023). netgwas: An R Package for Network-Based Genome-Wide Association Studies. The R journal, 14(4), 18-37.
2. Behrouzi, P., and Wit, E. C. (2019). Detecting epistatic selection with partially observed genotype data by using copula graphical models. Journal of the Royal Statistical Society: Series C (Applied Statistics), 68(1), 141-160.

Examples

D <- simgeno(p = 100, n = 50, k = 3)
R.gibbs(D$data, ncores=1)

netgwas documentation built on Aug. 7, 2023, 5:10 p.m.