datacggm
’The ‘event
’ function is used to create a status indicator matrix from an object with class ‘datacggm
’. The elements of the matrix, denoted by R
, are used to specify the status of an observation:
‘R[i, j] = 0
’ means that the
‘R[i, j] = -1
’ means that the
‘R[i, j] = +1
’ means that the
See examples below.
event(x)
an object with class ‘datacggm
’.
event
returns a
Augugliaro, L., Abbruzzo, A. and Vinciotti, V. (2018).
datacggm
, rdatacggm
and the method function summary.datacggm
.
# NOT RUN {
set.seed(123)
library("cglasso")
# dataset from a left-censored Gaussian graphical model
n <- 100L
p <- 5L
X <- matrix(rnorm(n * p), n, p)
lo <- -1
X[X <= lo] <- lo
X <- datacggm(X, lo = lo)
event(X)
# dataset from a right-censored Gaussian graphical model
n <- 100L
p <- 5L
X <- matrix(rnorm(n * p), n, p)
up <- 1
X[X >= up] <- up
X <- datacggm(X, up = up)
event(X)
# dataset from a censored Gaussian graphical model
n <- 100L
p <- 5L
X <- matrix(rnorm(n * p), n, p)
up <- 1
lo <- -1
X[X >= up] <- up
X[X <= lo] <- lo
X <- datacggm(X, lo = lo, up = up)
event(X)
# }
Run the code above in your browser using DataLab