{'fraction_non_alphanumeric': 0.013100436681222707, 'fraction_numerical': 0.001455604075691412, 'mean_word_length': 5.516587677725118, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
THE DISTRIBUTION AND HYPOTHESIS TESTING OF EIGENVALUES FROM THE CANONICAL ANALYSIS OF THE GAMMA MATRIX OF QUADRATIC AND CORRELATIONAL SELECTION GRADIENTS

Canonical analysis measures nonlinear selection on latent axes from a rotation of the gamma matrix (γ) of quadratic and correlation selection gradients. Here, we document that the conventional method of testing eigenvalues (double regression) under the null hypothesis of no nonlinear selection is incorrect. Through simulation we demonstrate that under the null the expectation of some eigenvalues from canonical analysis will be nonzero, which leads to unacceptably high type 1 error rates. Using a two‐trait example, we prove that the expectations for both eigenvalues depend on the sampling variability of the estimates in γ. An appropriate test is to slightly modify the double regression method by calculating permutation P‐values for the ordered eigenvalues, which maintains correct type 1 error rates. Using simulated data of nonlinear selection on male guppy ornamentation, we show that the statistical power to detect curvature with canonical analysis is higher compared to relying on the estimates from γ alone. We provide a simple R script for permutation testing of the eigenvalues to distinguish curvature in the selection surface induced by nonlinear selection from curvature induced by random processes.