# NOT RUN {
set.seed(123)
# Y ~ N(0, Sigma) and probability of left/right censored values equal to 0.05
n <- 100L
p <- 3L
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, Sigma = Sigma, probl = 0.05, probr = 0.05)
out <- cglasso(Z)
summary(out) # models evaluation by aic
summary(out, GoF = bic) # models evaluation by bic
summary(out, GoF = bic, mle = TRUE, g = 0.5) # models evaluation by ebic
# Y ~ N(b0 + XB, Sigma) and probability of left/right censored values equal to 0.05
n <- 100L
p <- 3L
q <- 2
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, b0 = b0, X = X, B = B, Sigma = Sigma, probl = 0.05, probr = 0.05)
out <- cglasso(Z, lambda = 0.01)
summary(out) # models evaluation by aic
summary(out, GoF = bic) # models evaluation by bic
summary(out, GoF = bic, mle = TRUE, g = 0.5) # models evaluation by ebic
out <- cglasso(Z, rho = 0.01)
summary(out) # models evaluation by aic
summary(out, GoF = bic) # models evaluation by bic
summary(out, GoF = bic, mle = TRUE, g = 0.5) # models evaluation by ebic
out <- cglasso(Z)
summary(out) # models evaluation by aic
summary(out, GoF = bic) # models evaluation by bic
summary(out, GoF = bic, mle = TRUE, g = 0.5) # models evaluation by ebic
# }
Run the code above in your browser using DataLab