optimizeFactorization: Function to minimize decomposition error

View source: R/optimize.R

optimizeFactorizationR Documentation

Function to minimize decomposition error

Description

Function iteratively updates u, delta, and V and decreases the decomposition error.

Usage

optimizeFactorization(
  mat_list,
  u,
  d,
  v,
  optimizeV = TRUE,
  initial_exact = FALSE,
  max_iter = 10000,
  tol = 1e-10,
  verbose = FALSE
)

Arguments

mat_list

A list containing numeric matrices

u

A list containing U matrices

d

A list containing delta matrices

v

V matrix

optimizeV

Whether initial V should be update or not. Default TRUE

initial_exact

Whether the initial value of U, Delta, and V gives exact factorization. Default FALSE

max_iter

Maximum number of iterations. In each iteration u, d, and v are updated. Default 1e4

tol

Tolerance value. During the iterations, if the difference between previous best and current best factorization error becomes less than tol, no more iteration is performed. Default tol = 1e-10

verbose

print error at each update. Default FALSE

Value

a list containing optimal U, delta, and V that minimizes the factorization error

Examples

set.seed(1231)
mymat <- createRandomMatrices(n = 3, ncols = 3, nrows = 3)
sbf <- SBF(matrix_list = mymat, orthogonal = FALSE,
           transform_matrix = FALSE)
newU <- updateU(mymat, sbf$delta, sbf$v)
newDelta <- updateDelta(mymat, newU, sbf$v)
newV <- updateV(mymat, newU, newDelta)
opt <- optimizeFactorization(mymat, newU, newDelta, newV, max_iter = 1e4)

amalthomas111/SBF documentation built on Sept. 2, 2022, 11:27 a.m.