compute_BFCS_vectorized: Vectorized function for efficiently computing the Bayes...

Description Usage Arguments Value Examples

View source: R/compute_BFCS_vectorized.R

Description

Vectorized function for efficiently computing the Bayes Factors of many three-variable covariance structures at the same time.

Usage

1
compute_BFCS_vectorized(c12, c13, c23, num_samples)

Arguments

c12

Vector of correlations between X_1 and X_2.

c13

Vector of correlations between X_1 and X_3.

c23

Vector of correlations between X_2 and X_3.

num_samples

Integer number of samples.

Value

BFCS for all correlation combinations contained in the vectors

Examples

1
2
3
4
5
6
7
cor_matrices <- apply(rWishart(100, 4, diag(3)), 3, cov2cor)
compute_BFCS_vectorized(
  c12 = cor_matrices[2, ], 
  c13 = cor_matrices[3, ], 
  c23 = cor_matrices[6, ], 
  num_samples = 1000
 )

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