calc_sigma: Calculate the sigma covariance matrix from a fitted BN or DBN

View source: R/gauss_transform.R

calc_sigmaR Documentation

Calculate the sigma covariance matrix from a fitted BN or DBN

Description

Given a "bn.fit" or a "dbn.fit" object, calculate the sigma covariance matrix of the equivalent multivariate Gaussian distribution. Front end of a C++ function.

Usage

calc_sigma(fit)

Arguments

fit

a bn.fit or dbn.fit object

Value

a named numeric covariance matrix of the nodes

Examples

dt_train <- dbnR::motor[200:2500]
net <- bnlearn::mmhc(dt_train)
fit <- bnlearn::bn.fit(net, dt_train, method = "mle-g")
sigma <- dbnR::calc_sigma(fit)

f_dt_train <- dbnR::fold_dt(dt_train, size = 2)
net <- dbnR::learn_dbn_struc(dt_train, size = 2)
fit <- dbnR::fit_dbn_params(net, f_dt_train)
sigma <- dbnR::calc_sigma(fit)

dbnR documentation built on Oct. 5, 2022, 1:07 a.m.