compute_BGe_score_vectorized: Vectorized compute Bayes factors of covariance structures...

Description Usage Arguments Value Examples

View source: R/compute_BGe_score_vectorized.R

Description

Vectorized compute Bayes factors of covariance structures using the Bayesian Gaussian equivalent (BGe) score.

Usage

1
compute_BGe_score_vectorized(suffstat_list, num_samples, graph_list)

Arguments

suffstat_list

List of sufficient statistics for a data set, containing the means of the variables and their covariance matrix.

num_samples

number of samples

graph_list

List containing objects of class "bn", each of which represents a graph structure for which we compute the BGe score.

Value

Matrix of size (number datasets) x (number graph structures) that contains the BGe score for each combination of (dataset, graph).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
mec_list <- get_Markov_equivalence_class_list(format = "bnlearn")
suffstat_list = list(
  # three independent variables, zero mean
  list( 
    means = rep(0, 3),
    covmat = diag(3)
  ),
  # three independent variables, mean one
  list(
    means = rep(1, 3),
    covmat = diag(3)
  ),
  # a single variable repeated three times (correlation one)
  list(
    means = rep(0, 3),
    covmat = matrix(1, 3, 3)
  )
)
compute_BGe_score_vectorized(suffstat_list, num_samples = 10000, mec_list)

igbucur/BFCS documentation built on Oct. 20, 2020, 7:39 a.m.