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.

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

Guo Y, Li S, Yang J, Shu T, Wu L (2003). “A Generalized Foley–Sammon Transform Based on Generalized Fisher Discriminant Criterion and Its Application to Face Recognition.” Pattern Recognition Letters, 24(1-3), 147--158.

Wang H, Yan S, Xu D, Tang X, Huang T (2007). “Trace Ratio vs. Ratio Trace for Dimensionality Reduction.” In 2007 IEEE Conference on Computer Vision and Pattern Recognition, 1--8.

Yangqing Jia, Feiping Nie, Changshui Zhang (2009). “Trace Ratio Problem Revisited.” IEEE Transactions on Neural Networks, 20(4), 729--735.

Ngo TT, Bellalij M, Saad Y (2012). “The Trace Ratio Optimization Problem.” SIAM Review, 54(3), 545--569.

Examples

## 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)
#> * Evaluation of the cost function 
#>  * approx. via determinant : 19.8057915989361 
#>  * trio by 2012Ngo         : 22.0466342224846 
#>  * trio by 2009Jia         : 22.0466342224846 
#>  * trio by 2007Wang        : 22.0466342224846 
#>  * trio by 2003Guo         : 22.0466342224846