Wellner's (1979, Example 1a) Rayleigh-style T-statistic, which quantifies the dissimilarity between two sets of vectors. The statistic increases with the degree of difference between the datasets.
Usage
wellner(x, y, n_perm, level)
# S3 method for class 'Ray'
wellner(x, y, n_perm = 1000L, level = 0.95)
# S3 method for class 'Line'
wellner(x, y, n_perm = 1000L, level = 0.95)
# S3 method for class 'Vec3'
wellner(x, y, n_perm = 1000L, level = 0.95)
# S3 method for class 'Plane'
wellner(x, y, n_perm = 1000L, level = 0.95)Details
P-values are estimated using permutation-based inference to assess whether the two datasets are drawn from the same population.
#' wellner() computes Wellner's T-statistic, a non-negative measure of
dissimilarity between two datasets. The value is zero when the datasets
are identical.
Inference estimates the fraction of permutation tests in which the computed T-statistic exceeds the observed T for the original data (a number between 0 and 1). This value can be interpreted as a p-value for the null hypothesis that the two populations are identical (not merely that their means coincide). Thus, smaller p-values indicate stronger evidence that the two populations differ in a meaningful way.
References
Jon A. Wellner. "Permutation Tests for Directional Data." Ann. Statist. 7(5) 929-943, September, 1979. doi:10.1214/aos/1176344779
Examples
set.seed(20250411)
test <- rvmf(100)
wellner(test, Line(120, 50))
#>
#> Wellner permutation test
#>
#> statistic = 8.2327, p-value = 0.03896
#> critical value (95% confidence level) = 8.2246
#> null hypothesis rejected at the 95% confidence level: yes
#> further statistics:
#> n_perm df_uniform p_uniform
#> 1000.0000000 5.0000000 0.1438671
#> source: Wellner (1979), Ann. Statist. 7, 929-943
#>
