orthogonalizeTraceNorm: Orthogonalize matrices to minimize trace norm of their...

Description Usage Arguments Value Examples

View source: R/orthogonalizeTraceNorm.R

Description

Given two matrices U and V that can be multiplied, this function finds two new matrices U2 and V2 such that their product is conserved (U*V = U2*V2) and such that a||U||^2 + b||V||^2 is minimized.

Usage

1
orthogonalizeTraceNorm(U, V, a = 1, b = 1)

Arguments

U

left matrix

V

right matrix

a

weight of the norm of U (default=1)

b

weight of the norm of V (default=1)

Value

A list with the two matrices that solve the problem in the slots U and V.

Examples

1
2
3
4
5
6
U <- matrix(rnorm(15),5,3)
V <- matrix(rnorm(12),3,4)
o <- orthogonalizeTraceNorm(U,V)
norm( U%*%V - o$U%*%o$V) # should be zero
sum(U^2)+sum(V^2)
sum(o$U^2)+sum(o$V^2) # should be smaller

zinbwave documentation built on Nov. 8, 2020, 8:11 p.m.