generate_Gaussian {latentgraph} | R Documentation |
Generate a Gaussian distributed data set
Description
This function will generate a Gaussian distributed data set with latent variables and correlated replicates.
Usage
generate_Gaussian(n, R, p, l, s, sparsityA, sparsityobserved, sparsitylatent, lwb,
upb, seed)
Arguments
n |
the number of observations. |
R |
the number of replicates. |
p |
the number of observed variables. |
l |
the number of latent variables. |
s |
latent effects are generated as |
sparsityA |
proportion of the number of zeros in the transition matrix |
sparsityobserved |
proportion of the number of zeros in the inverse covariance of the observed variables. Must be a number from 0 to 1. |
sparsitylatent |
proportion of the number of zeros in the inverse covariances among latent variables and between observed variables and latent variables. Must be a number from 0 to 1. |
lwb |
lower bound for the elements in the inverse covariance matrix. |
upb |
upper bound for the elements in the inverse covariance matrix. |
seed |
the seed for the random number generator. |
Details
This function aims to generate a Gaussian distributed data set with latent variables and correlated replicates. For each observation, the latent variables are piecewise constant across replicates, and conditioned on the latent variables, the replicates follow a one-lag vector autoregressive model, where the transition matrix is sparse with non-zero elements set equal to 0.3.
The matrix
is the covariance matrix for the observed variables X and the latent variables
, and we partition
into matrices that quantify the relationships among the observed variables (
), between the observed variables and latent variables (
or
), and of the latent variables (
).
In general, the data is generated with:
where and
.
Value
X |
the generated data, which is a list with |
truegraph |
a matrix that encodes the conditional dependence relationships between sets of two observed variables |
References
Jin, Y., Ning, Y., and Tan, K. M. (2020), ‘Exponential Family Graphical Models with Correlated Replicates and Unmeasured Confounders’, preprint available.
Examples
data <- generate_Gaussian(n = 50, R = 20, p = 30, l = 2, s = 2, sparsityA = 0.95,
sparsityobserved = 0.9, sparsitylatent = 0.2, lwb = 0.3, upb = 0.3, seed = 1)