CVBFtestrsplit: Compute a CVBF, a Bayes factor that checks if two data sets...

View source: R/CVBFFunctions.R

CVBFtestrsplitR Documentation

Compute a CVBF, a Bayes factor that checks if two data sets share the same distribution.

Description

Compute a CVBF, a Bayes factor that checks if two data sets share the same distribution.

Usage

CVBFtestrsplit(
  dataset1,
  dataset2,
  trainsize1,
  trainsize2,
  seed = NULL,
  train1_ids = NULL,
  train2_ids = NULL
)

Arguments

dataset1

One dataset that we want to check if it has the same distribution as another data set

dataset2

Another dataset that we want to check if it has the same distribution as another data set

trainsize1

The training set size of dataset 1

trainsize2

The training set size of dataset 2

seed

The seed used to generate training set and validation sets for both of the data sets

train1_ids

Indices for the training set of dataset 1

train2_ids

Indices for the training set of dataset 2

Value

A list containing a log BF that tests whether two distributions are the same via CVBF, and the training sets used to generate the CVBF.

Examples

set.seed(100)
dataset1 = rnorm(200)
dataset2 = rnorm(200) 
CVBF1 = CVBFtestrsplit(dataset1, dataset2, trainsize1 = 100, trainsize2 = 100)
CVBF1$logBF #Gives back the log Bayes factor
CVBF1$train1_ids #Gives back the training set of the first data set
CVBF1$train2_ids #Gives back the training set of the second data set


naveedmerchant/BayesScreening documentation built on June 13, 2024, 7:56 a.m.