Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/datacggm_tools.R
‘rcggm
’ function is used to produce one or more samples from a conditional Gaussian graphical model with censored and/or missing values.
1 
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 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 
Sigma 
a positivedefinite 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 leftcensored. 
probr 
a vector giving the probabilities that the response variables are rightcensored. 
probna 
the probability that a response value is missingatrandom. By default ‘ 
... 
further arguments passed to the function ‘ 
‘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. Missingatrandom values are simulated using a Bernoulli distribution with probability probna
.
The dataset is simulated through the following steps:
lower and upper censoring values (lo
and up
) are computed according to the arguments probl
and probr
;
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
;
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 missingatrandom 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.
rcggm
returns an object of class ‘datacggm
’. See datacggm
for further details.
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro, L., Sottile, G., and Vinciotti, V. (2020a) <doi: 10.1007/s11222020099457>. 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>. l1Penalized censored Gaussian graphical model. Biostatistics 21, e1–e16.
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)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.