metric_frobenius_norm: Metric for Frobenius Norm

Description Usage Arguments Details Value Recovery Use See Also Examples

View source: R/metrics.R

Description

Computes the Frobenius norm of matrix entries

Usage

1
metric_frobenius_norm(estimate, oracle, na.rm = FALSE)

Arguments

estimate

Estimated values from the model.

oracle

Known values used to generate the model.

na.rm

A logical indicating if missing values (including NaN) should be removed. Default: FALSE

Details

The Frobenius norm is an extension of the Euclidean norm to \mathcal{K}^{n\times n}.

The metric is computed under:

\|A\|_{\rm F} = ≤ft(∑_{i=1}^m ∑_{j=1}^n |a_{ij}|^2\right)^{\frac{1}{2}}

Value

A single numeric value.

Recovery Use

The Frobenius norm is best used to understand differences between the estimated \hatθ matrix and the oracle θ matrix.

See Also

base::norm()

Examples

1
2
3
4
5
6
# Construct data
estimate = matrix(c(1,1,2,4,3,6), nrow = 2, ncol = 3)
truth = matrix(c(1,2,3,4,5,6), nrow = 2, ncol = 3)

# Compute the frobenius norm
metric_frobenius_norm(estimate, truth)

tmsalab/edmcore documentation built on Sept. 4, 2021, 2:46 a.m.