rcggm {cglasso} | R Documentation |
Simulate Data from a Conditional Gaussian Graphical Model with Censored and/or Missing Values
Description
‘rcggm
’ function is used to produce one or more samples from a conditional Gaussian graphical model with censored and/or missing values.
Usage
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 |
X |
a matrix of dimension |
B |
a matrix of dimension |
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 ‘ |
... |
further arguments passed to the function ‘ |
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:
lower and upper censoring values (
lo
andup
) are computed according to the argumentsprobl
andprobr
;The function
mvrnorm
is used to simulate one or more samples from the multivariate Gaussian distribution specified by the argumentsb0
,X
,B
andSigma
;The response values that are outside of the interval
[lo, up]
are replaced with the corresponding censoring values;if
probna
is greater than zero, then missing-at-random values are simulated using a Bernoulli distribution with probabilityprobna
.
Model | n | p | b0 | X | B | Sigma | Gaussian distribution |
1 | x | x | Y\sim N(0, I) |
||||
2 | x | x | Y\sim N(0, \Sigma) |
||||
3 | x | x | Y\sim N(b0, I) |
||||
4 | x | x | x | Y\sim N(b0, \Sigma) |
|||
5 | x | x | Y\sim N(XB, I) |
||||
6 | x | x | x | Y\sim N(XB, \Sigma) |
|||
7 | x | x | x | Y\sim N(b0 + XB, I) |
|||
8 | x | x | x | x | Y\sim 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., Wit E.C., and Vinciotti V. (2023) <doi:10.18637/jss.v105.i01>. cglasso: An R Package for Conditional Graphical Lasso Inference with Censored and Missing Values. Journal of Statistical Software 105(1), 1–58.
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>.
\ell_1
-Penalized censored Gaussian graphical model.
Biostatistics 21, e1–e16.
See Also
Examples
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)