mds_test {nzilbb.vowels} | R Documentation |
Generate bootstrapped confidence intervals and permutation based null
distribution for MDS analysis. Output shows how much stress is reduced by
adding an additional dimension to the MDS analysis of
similarity_matrix
,
and bootstrapped iterations of similarity_matrix
,
compared with the stress reduction expected from a matrix with no meaningful
structure. This function is inspired by pca_test()
, but is less connected
with statistical literature than that function. We currently reject
additional dimensions is they reduce less stress than we would expect by
chance. That is, when the distribution from the boostrapped analyses sits
notably lower than the permuted distribution when plotted by plot_mds_test()
mds_test(
similarity_matrix,
n_boots = 50,
n_perms = 50,
test_dimensions = 5,
principal = TRUE,
mds_type = "ordinal",
spline_degree = 2,
spline_int_knots = 2
)
similarity_matrix |
Square matrix of speaker similarity scores. |
n_boots |
Number of bootstrapping iterations (default: 25). |
n_perms |
Number of permutations (default: 25). |
test_dimensions |
Number of MDS dimensions to test for stress reduction (default: 5). |
principal |
Whether to apply principal axis transform to MDS (default: TRUE) |
mds_type |
What kind of MDS to apply, see |
spline_degree |
How many spline degrees when |
spline_int_knots |
How many internal knots when |
object of class mds_test_results
, containing:
$stress_reduction
a tibble containing
$n_boots
Number of bootstrapping iterations.
$n_perms
Number of permutation iterations
$mds_type
Type of MDS analysis (type
argument passed to
smacof::smacofSym()
)
$principal
Whether principal axis transformation is applied (passed to
smacof::smacofSym()
)
# Apply interval MDS to `sim_matrix`, with 5 permutations and bootstraps
# testing up to 3 dimensions. In real usage, increase `n_boots` and `n_perms`
# to at least 50.
mds_test(
sim_matrix,
n_boots = 5,
n_perms = 5,
test_dimensions = 3,
mds_type = 'interval'
)