frobenius: (Modified) Frobenius matrix norm

View source: R/frobenius.R

frobeniusR Documentation

(Modified) Frobenius matrix norm

Description

Calculates a modified version of the Frobenius matrix norm for a square symmetric matrix with p(p + 1) / 2 estimable parameters.

Usage

frobenius(datamat, targetmat)

Arguments

datamat

Symmetric square matrix for which to calculate the Frobenius norm.

targetmat

Target matrix of same size as datamat, to compare datamat against.

Details

This is a utility function used by alpha.crossvalid, but can also be called directly if required. This version of the Frobenius matrix norm gives equal weight to all parameters (variances and covariances) when used with covariance matrices.

Value

Returns the modified Frobenius matrix norm (scalar).

Author(s)

Theo Pepler

References

Pepler, P.T. (2014). The identification and application of common principal components. PhD dissertation in the Department of Statistics and Actuarial Science, Stellenbosch University.

See Also

alpha.crossvalid

Examples

# Compare the covariance matrix of the versicolor group to
# an identity matrix
data(iris)
versicolor <- iris[51:100, 1:4]
frobenius(datamat = cov(versicolor), targetmat = diag(4))

tpepler/cpc documentation built on July 7, 2022, 2:13 a.m.