multivariate normal distribution | R Documentation |
Convert a Gaussian Bayesian network into the multivariate normal distribution that is its global distribution, and vice versa.
gbn2mvnorm(fitted)
mvnorm2gbn(dag, mu, sigma)
fitted |
an object of class |
dag |
an object of class |
mu |
a numeric vector, the expectation of the multivariate normal. |
sigma |
a square numeric matrix, the covariance matrix of the multivariate normal. |
gbn2mvnorm()
returns a list with elements "mu"
(the vector of
expectations) and "sigma"
(the covariance matrix).
mvnorm2gbn()
returns an object of class bn.fit
.
Marco Scutari
Pourahmadi M (2011). "Covariance Estimation: The GLM and Regularization Perspectives". Statistical Science, 26(3), 369–387.
bn.fit.
data(gaussian.test)
dag = model2network("[A][B][E][G][C|A:B][D|B][F|A:D:E:G]")
bn = bn.fit(dag, gaussian.test)
mvn = gbn2mvnorm(bn)
bn2 = mvnorm2gbn(dag, mu = mvn$mu, sigma = mvn$sigma)
all.equal(bn, bn2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.