# ALSCPC: minimize the objective function Phi(D) by using of the... In ALSCPC: Accelerated line search algorithm for simultaneous orthogonal transformation of several positive definite symmetric matrices to nearly diagonal form.

## Description

The `ALS.CPC` function implement ALS algorithm based on the update formula

\bold{D_{k+1}} = R_{\bold{D_k}} (-β^{m_k} \ α \ grad(Φ (\bold{D}_k)))

until convergence (i.e. |Φ(\bold{D}_k)-Φ (\bold{D}_{k+1})| ≤ ε) and return the orthogonal matrix \bold{D}_r, r is the smallest nonnegative integer k such that |Φ(\bold{D}_k)-Φ (\bold{D}_{k+1})| ≤ ε.

## Usage

 `1` ```ALS.CPC(alpha,beta,sigma,epsilon,G,nval,D,S) ```

## Arguments

 `alpha` positive real number. `beta` real number belong to (0,1). `sigma` real number belong to (0,1). `epsilon` small positive constant controlling error term. `G` number of groups in common principal components analysis. `nval` a numeric vector containing the positive integers of sample sizes minus one in each group. `D` an initial square orthogonal matrix of order `p`, where `p` is group dimensionality. `S` a list of length `G` of positive definite symmetric matrices of order `p`.

## Value

An orthogonal matrix such that minimize Φ(\bold{D}).

## Author(s)

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```nval<-numeric(3) nval[[1]]<-49 nval[[2]]<-49 nval[[3]]<-49 S<-vector("list",length=3) setosa<-iris[1:50,1:4]; names(setosa)<-NULL versicolor<-iris[51:100,1:4]; names(versicolor)<-NULL virginica<-iris[101:150,1:4]; names(virginica)<-NULL S[[1]]<-as.matrix(var(versicolor)) S[[2]]<-as.matrix(var(virginica)) S[[3]]<-as.matrix(var(setosa)) D<-diag(4) ALS.CPC(10,0.5,0.4,1e-5,G=3,nval,D,S) ```