rcggm: Simulate Data from a Conditional Gaussian Graphical Model...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/datacggm_tools.R

Description

rcggm’ function is used to produce one or more samples from a conditional Gaussian graphical model with censored and/or missing values.

Usage

1
rcggm(n, p, b0, X, B, Sigma, probl, probr, probna, ...)

Arguments

n

the number of samples required (optional, see below for a description).

p

the number of response variables (optional, see below for a description).

b0

a vector of length p used to specify the intercepts. Default is a zero vector of length p (optional, see below for a description).

X

a matrix of dimension n x q used to model the expected values of the response variables (optional, see below for a description).

B

a matrix of dimension q x p used to specify the regression coefficients. If X is missing then B is set equal to NULL (optional, see below for a description).

Sigma

a positive-definite symmetric matrix specifying the covariance matrix of the response variables. Default is the identity matrix (optional, see below for a description).

probl

a vector giving the probabilities that the response variables are left-censored.

probr

a vector giving the probabilities that the response variables are right-censored.

probna

the probability that a response value is missing-at-random. By default ‘probna’ is set equal to zero.

...

further arguments passed to the function ‘mvrnorm’.

Details

‘The rcggm’ function simulates a dataset from a conditional Gaussian graphical model with censored or missing values and returns an object of class ‘datacggm’. Censoring values are implicitly specified using arguments probl and probr, that is, lo and up are computed in such a way that the average probabilities of left and right censoring are equal to probl and probr, respectively. Missing-at-random values are simulated using a Bernoulli distribution with probability probna.

The dataset is simulated through the following steps:

  1. lower and upper censoring values (lo and up) are computed according to the arguments probl and probr;

  2. The function mvrnorm is used to simulate one or more samples from the multivariate Gaussian distribution specified by the arguments b0, X, B and Sigma;

  3. The response values that are outside of the interval [lo, up] are replaced with the corresponding censoring values;

  4. if probna is greater than zero, then missing-at-random values are simulated using a Bernoulli distribution with probability probna.

Model n p b0 X B Sigma Gaussian distribution
1 x x Y ~ N(0, I)
2 x x Y ~ N(0, Sigma)
3 x x Y ~ N(b0, I)
4 x x x Y ~ N(b0, Sigma)
5 x x Y ~ N(XB, I)
6 x x x Y ~ N(XB, Sigma)
7 x x x Y ~ N(b0 + XB, I)
8 x x x x Y ~ N(b0 + XB, Sigma)

The previous table sums up the default setting of the multivariate Gaussian distribution used in step 2 (specified arguments are marked by the symbol ‘x’). See also below for some examples.

Value

rcggm returns an object of class ‘datacggm’. See datacggm for further details.

Author(s)

Luigi Augugliaro (luigi.augugliaro@unipa.it)

References

Augugliaro, L., Sottile, G., and Vinciotti, V. (2020a) <doi: 10.1007/s11222-020-09945-7>. The conditional censored graphical lasso estimator. Statistics and Computing 30, 1273–1289.

Augugliaro, L., Abbruzzo, A., and Vinciotti, V. (2020b) <doi: 10.1093/biostatistics/kxy043>. l1-Penalized censored Gaussian graphical model. Biostatistics 21, e1–e16.

See Also

datacggm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
set.seed(123)

n <- 100
p <- 3
q <- 2
b0 <- rep(1, p)
X <- matrix(rnorm(n * q), n, q)
B <- matrix(rnorm(q * p), q, p)
Sigma <- outer(1:p, 1:p, function(i, j) 0.3^abs(i - j))
probl <- 0.05
probr <- 0.05
probna <- 0.05

# Model 1: Y ~ N(0, I)
Z <- rcggm(n = n, p = p, probl = probl, probr = probr, probna = probna)
summary(Z)

# Model 2: Y ~ N(0, Sigma)
Z <- rcggm(n = n, Sigma = Sigma, probl = probl, probr = probr, probna = probna)
summary(Z)

# Model 3: Y ~ N(b0, I)
Z <- rcggm(n = n, b0 = b0, probl = probl, probr = probr, probna = probna)
summary(Z)

# Model 4: Y ~ N(b0, Sigma)
Z <- rcggm(n = n, b0 = b0, Sigma = Sigma, probl = probl, probr = probr, 
           probna = probna)
summary(Z)

# Model 5: Y ~ N(XB, I)
Z <- rcggm(X = X, B = B, probl = probl, probr = probr, probna = probna)
summary(Z)

# Model 6: Y ~ N(XB, Sigma)
Z <- rcggm(X = X, B = B, Sigma = Sigma, probl = probl, probr = probr, 
           probna = probna)
summary(Z)

# Model 7: Y ~ N(b0 + XB, I)
Z <- rcggm(b0 = b0, X = X, B = B, probl = probl, probr = probr, probna = probna)
summary(Z)

# Model 8: Y ~ N(b0 + XB, Sigma)
Z <- rcggm(b0 = b0, X = X, B = B, Sigma = Sigma, probl = probl, probr = probr, 
           probna = probna)
summary(Z)

cglasso documentation built on April 9, 2021, 9:07 a.m.