Statistics for Invariant Theory, Equivalence Problems, and the Calculus of Variations