Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

frobenius.prod

Frobenius innter product of matrices


Description

This function returns the Fronbenius inner product of two matrices, x and y, with the same row and column dimensions.

Usage

frobenius.prod(x, y)

Arguments

x

a numeric matrix or vector object

y

a numeric matrix or vector object

Details

The Frobenius inner product is the element-by-element sum of the Hadamard or Shur product of two numeric matrices. Let {\bf{x}} and {\bf{y}} be two m \times n matrices. Then Frobenious inner product is computed as ∑\limits_{i = 1}^m {∑\limits_{j = 1}^n {x_{i,j} \;y_{i,j} } } .

Value

A numeric value.

Note

The function converts vectors to matrices if necessary. The function stops running if x or y is not numeric and an error message is displayed. The function also stops running if x and y do not have the same row and column dimensions and an error mesage is displayed.

Author(s)

Frederick Novomestky fnovomes@poly.edu

References

Styan, G. P. H. (1973). Hadamard Products and Multivariate Statistical Analysis, Linear Algebra and Its Applications, Elsevier, 6, 217-240.

See Also

Examples

x <- matrix( c( 1, 2, 3, 4 ), nrow=2, byrow=TRUE )
y <- matrix( c( 2, 4, 6, 8 ), nrow=2, byrow=TRUE )
z <- frobenius.prod( x, y )
print( z )

matrixcalc

Collection of functions for matrix calculations

v1.0-3
GPL (>= 2)
Authors
Frederick Novomestky <fnovomes@poly.edu>
Initial release
2012-09-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.