bCorrelatedTtest | R Documentation |
Implementation of the Bayesian version of the correlated t-test as presented in Benavoli et al. 2017
bCorrelatedTtest(x, y = NULL, rho = 0, rope = c(-0.01, 0.01))
x |
First sample |
y |
Second sample (if not provided, x is assumed to be the difference) |
rho |
Correlation factor (see details) |
rope |
Interval for the difference considered as "irrelevant" |
Note that the default value for rho is 0, wich converts the test in the equivalent of the standard t-test. To correct due to correlation you need to set the rho parameter. In the case of classifiers compared using any validation scheme the heuristic typically used is to set rho to num. test instances / total num. of instance The function has been implemented to be used in the comparison of classifiers and, in such situation, the heuristic used to fix the correlation factor is the size of the training set divided by the total size of the data. For the same reason, the reference value (the midpoint for the rope) is 0. However, this may be changed (though it matches the prior for the paremter, which follows a Gaussian distribution of 0 mean). The results includes the typicall information relative to the three areas of the posterior density (left, right and rope probabilities), but also the basic functions (density, cummulative and quantile), as well as the parameters of the posterior density function, which is a Student's t.
A list with the following elements:
method |
a string with the name of the method used |
posterior.probabilities |
a vector with the left, rope and right probabilities |
approximated |
a logical value, |
parameters |
parameters used by the method |
posterior |
posterior density function if the method is exact and the obtained sample if the method is approximated |
additional |
a list that contains the posterior cumulative function ( |
A. Benavoli, G. Corani, J. Demsar, M. Zaffalon (2017) Time for a Change: a Tutorial for Comparing Multiple Classifiers Through Bayesian Analysis. Journal of Machine Learning Research, 18, 1-36.
sample1 <- rnorm(25, 1, 1)
sample2 <- rnorm(25, 1.2, 1)
correlatedTtest (x=sample1, y=sample2, rho=0.1, alternative="less")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.