fasano.franceschini.test {fasano.franceschini.test} | R Documentation |
Computes the 2-D Kolmogorov-Smirnov two-sample test as described by Fasano and Franceschini (1987).
fasano.franceschini.test(S1, S2, nBootstrap = 0, nPermute = 0, cores = 1)
S1 |
a |
S2 |
a |
nBootstrap |
a depreciated |
nPermute |
a |
cores |
a |
Code adapted from Press, W. H., Teukolsky, S. A., Vetterling, W. T.,, Flannery, B. P. (2007). Numerical Recipes 3rd Edition: The Art of Scientific Computing. Cambridge University Press. ISBN: 0521880688
the 2-D ks statistic and p-value
Fasano, G., Franceschini, A. (1987) doi: 10.1093/mnras/225.1.155. A multidimensional version of the Kolmogorov-Smirnov test. Monthly Notices of the Royal Astronomical Society 225:155-170.
Peacock J.A. (1983) doi: 10.1093/mnras/202.3.615. Two-dimensional goodness-of-fit testing in astronomy. Monthly Notices of the Royal Astronomical Society 202:615-627.
Press, W. H., Teukolsky, S. A., Vetterling, W. T.,, Flannery, B. P. (2007). Numerical Recipes 3rd Edition: The Art of Scientific Computing. Cambridge University Press. ISBN: 0521880688
#Underlying distributions are different #set seed for reproducible example set.seed(123) #create 2-D samples with different underlying distributions sample1Data <- data.frame(x = rnorm(n = 50, mean = 0, sd = 3), y = rnorm(n = 50,mean = 0, sd = 1)) sample2Data <- data.frame(x = rnorm(n = 50, mean = 0, sd = 1), y = rnorm(n = 50,mean = 0, sd = 3)) fasano.franceschini.test(S1 = sample1Data, S2 = sample2Data) #Underlying distributions are the same #set seed for reproducible example set.seed(123) #create 2-D samples with the same underlying distributions sample1Data <- data.frame(x = rnorm(n = 50, mean = 0, sd = 1), y = rnorm(n = 50,mean = 0, sd = 1)) sample2Data <- data.frame(x = rnorm(n = 50, mean = 0, sd = 1), y = rnorm(n = 50,mean = 0, sd = 1)) fasano.franceschini.test(S1 = sample1Data, S2 = sample2Data)