Check for conditional independence (d-separation)
# S3 method for class 'lvm'
dsep(object, x, cond = NULL, return.graph = FALSE, ...)
The argument 'x' can be given as a formula, e.g. x~y|z+v or ~x+y|z+v With everything on the rhs of the bar defining the variables on which to condition on.
m <- lvm(x5 ~ x4+x3, x4~x3+x1, x3~x2, x2~x1)
if (interactive()) {
plot(m,layoutType='neato')
}
dsep(m,x5~x1|x2+x4)
#> [1] FALSE
dsep(m,x5~x1|x3+x4)
#> [1] TRUE
dsep(m,~x1+x2+x3|x4)
#> [1] FALSE