-plotPCA <- function(prob)
-{
- par(mfrow=c(2,2), mar=c(4,4,2,2), mgp=c(2,1,0))
- partition <- apply(prob, 1, which.max)
- n <- nrow(prob)
- K <- ncol(prob)
- palette <- rainbow(K, s=.5)
- cols <- palette[partition]
- tmp <- PCA(rbind(prob, diag(K)), ind.sup=(n+1):(n+K), scale.unit=F, graph=F)
- scores <- tmp$ind$coord[,1:3] #samples coords, by rows
- ctrs <- tmp$ind.sup$coord #projections of indicator vectors (by cols)
- for (i in 1:2)
- {
- for (j in (i+1):3)
- {
- absc <- scores[,i]
- ords <- scores[,j]
- xrange <- range(absc)
- yrange <- range(ords)
- plot(absc, ords, col=c(cols,rep(colors()[215],K),rep(1,K)),
- pch=c(rep("o",n),rep(as.character(1:K),2)),
- xlim=xrange, ylim=yrange,
- xlab=paste0("Dim ", i, " (", round(tmp$eig[i,2],2), "%)"),
- ylab=paste0("Dim ", j, " (", round(tmp$eig[j,2],2), "%)"))
- ctrsavg <- t(apply(as.matrix(palette), 1,
- function(cl) c(mean(absc[cols==cl]), mean(ords[cols==cl]))))
- text(ctrsavg[,1], ctrsavg[,2], as.character(1:K), col=colors()[215])
- text(ctrs[,i], ctrs[,j], as.character(1:K), col=1)
- title(paste0("PCA ", i, "-", j, " / K=",K))
- }
- }
- # TODO:
- plot(0, xaxt="n", yaxt="n", xlab="", ylab="", col="white", bty="n")
-}
+However, one problem of such methods is that they can converge to local maxima, so several starting points must be explored.
+Recently, spectral methods were developed to bypass EM algorithms and they were proved able to recover the directions of the regression parameter
+in models with known link function and random covariates (see [9]).
+Our package extends such moment methods using least squares to get estimators of the whole parameters (with theoretical garantees, see [XX]).
+Currently it can handle only binary output $-$ which is a common case.