trio: Trace Ratio Optimation

Description Usage Arguments Value References Examples

View source: R/trio.R

Description

This function provides several algorithms to solve the following problem

\textrm{max} \frac{tr(V^\top A V)}{tr(V^\top B V)} \textrm{ such that } V^\top C V = I

where V is a projection matrix, i.e., V^\top V = I. Trace ratio optimization is pertained to various linear dimension reduction methods. It should be noted that when C = I, the above problem is often reformulated as a generalized eigenvalue problem since it's an easier proxy with faster computation.

Usage

1
2
3
4
5
6
7
8
9
trio(
  A,
  B,
  C,
  dim = 2,
  method = c("2003Guo", "2007Wang", "2009Jia", "2012Ngo"),
  maxiter = 1000,
  eps = 1e-10
)

Arguments

A

a (p\times p) symmetric matrix in the numerator term.

B

a (p\times p) symmetric matrix in the denomiator term.

C

a (p\times p) symmetric constraint matrix. If not provided, it is set as identical matrix automatically.

dim

an integer for target dimension. It can be considered as the number of loadings.

method

the name of algorithm to be used. Default is 2003Guo.

maxiter

maximum number of iterations to be performed.

eps

stopping criterion for iterative algorithms.

Value

a named list containing

V

a (p\times dim) projection matrix.

tr.val

an attained maximum scalar value.

References

\insertRef

guo_generalized_2003maotai

\insertRef

wang_trace_2007maotai

\insertRef

yangqingjia_trace_2009maotai

\insertRef

ngo_trace_2012maotai

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## simple test
#  problem setting
p = 5
mydim = 2
A = matrix(rnorm(p^2),nrow=p); A=A%*%t(A)
B = matrix(runif(p^2),nrow=p); B=B%*%t(B)
C = diag(p)

#  approximate solution via determinant ratio problem formulation
eigAB  = eigen(solve(B,A)) 
V      = eigAB$vectors[,1:mydim]
eigval = sum(diag(t(V)%*%A%*%V))/sum(diag(t(V)%*%B%*%V))

#  solve using 4 algorithms
m12 = trio(A,B,dim=mydim, method="2012Ngo")
m09 = trio(A,B,dim=mydim, method="2009Jia")
m07 = trio(A,B,dim=mydim, method="2007Wang")
m03 = trio(A,B,dim=mydim, method="2003Guo")

#  print the results
line1 = '* Evaluation of the cost function'
line2 = paste("* approx. via determinant : ",eigval,sep="")
line3 = paste("* trio by 2012Ngo         : ",m12$tr.val, sep="")
line4 = paste("* trio by 2009Jia         : ",m09$tr.val, sep="")
line5 = paste("* trio by 2007Wang        : ",m07$tr.val, sep="")
line6 = paste("* trio by 2003Guo         : ",m03$tr.val, sep="")
cat(line1,"\n",line2,"\n",line3,"\n",line4,"\n",line5,"\n",line6)

maotai documentation built on Oct. 25, 2021, 9:06 a.m.