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

View source: R/orthogonalizeTraceNorm.R

orthogonalizeTraceNormR Documentation

Orthogonalize matrices to minimize trace norm of their product

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

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

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

drisso/zinbwave documentation built on March 18, 2024, 5:13 p.m.