  Based on a generalized cosine measure between two symmetric matrices, we
propose a general framework for one-sample and two-sample tests of covariance
and correlation matrices. We also develop a set of associated permutation
algorithms for some common one-sample tests, such as the tests of sphericity,
identity and compound symmetry, and the $K$-sample tests of multivariate
equality of covariance or correlation matrices. The proposed method is very
flexible in the sense that it does not assume any underlying distributions and
data generation models. Moreover, it allows data to have different marginal
distributions in both the one-sample identity and $K$-sample tests. Through
real datasets and extensive simulations, we demonstrate that the proposed
method performs well in terms of empirical type I error and power in a variety
of hypothesis testing situations in which data of different sizes and
dimensions are generated using different distributions and generation models.
