This function returns the spectral norm of a real matrix if type is 2. Otherwise, it returns the matirx norm of the "norm" function using LAPACK.

mynorm(x, type)

Arguments

x

numeric matrix

type

character string, specifying the type of matrix norm to be computed. Details see norm function in R base.

References

Cai, T., Cai, T. T., & Zhang, A. (2015). Structured Matrix Completion with Applications to Genomic Data Integration. Journal of the American Statistical Association.

Author

Yifu Liu, Anru Zhang, Tianxi Cai and T. Tony Cai,

See also

norm

Examples

A = matrix(rnorm(10, mean = 0, sd = 0.1), 10, 10) mynorm(A, "2")
#> [1] 1.1485
mynorm(A, "O")
#> [1] 0.8464208