metreex-analysis.js
/**
 * * Component of Principal Component Analysis *
 * Computes the projection matrix Y of the primary and secondary eigen-indices onto the new plane.
 * Mathematically, Z = X x Y, where X is the matrix of all metric data, Y is the projection matrix built from the Eigenvectors
 * @param eigenIndexInfo Array with information about what indices the two most influential eigenvectors are located at
 * @param eigenVecs All eigenvectors, to extract the needed ones from
 * @param data All metric values, declares as X previously
 * @returns {Array} Projection matrix Z, as described above
 */
Component of Principal Component Analysis
Computes the projection matrix Y of the primary and secondary eigen-indices onto the new plane.
Mathematically, Z = X x Y, where X is the matrix of all metric data, Y is the projection matrix built from the Eigenvectors
@param eigenIndexInfo Array with information about what indices the two most influential eigenvectors are located at
@param eigenVecs All eigenvectors, to extract the needed ones from
@param data All metric values, declares as X previously
@returns {Array} Projection matrix Z, as described above
Component of Principal Component Analysis Computes the projection matrix Y of the primary and secondary eigen - indices onto the new plane . Mathematically Z = X x Y where X is the matrix of all metric data Y is the projection matrix built from the Eigenvectors @param eigenIndexInfo Array with information about what indices the two most influential eigenvectors are located at @param eigenVecs All eigenvectors to extract the needed ones from @param data All metric values declares as X previously @returns { Array } Projection matrix Z as described above
function computeEigenProjection(eigenIndexInfo, eigenVecs, data){
    var primaryEigenIndex = eigenIndexInfo[0].vecIndex,
        secondaryEigenIndex = eigenIndexInfo[1].vecIndex,
        projectionMatrix = [];
    eigenVecs.forEach(function (elem) {
        projectionMatrix.push([elem[primaryEigenIndex], elem[secondaryEigenIndex]]);
    });
    return math.multiply(math.matrix(data),math.matrix(projectionMatrix));
}
function computeEigenProjection ( eigenIndexInfo , eigenVecs , data ) { var primaryEigenIndex = eigenIndexInfo [ 0 ] . vecIndex , secondaryEigenIndex = eigenIndexInfo [ 1 ] . vecIndex , projectionMatrix = [ ] ; eigenVecs . forEach ( function ( elem ) { projectionMatrix . push ( [ elem [ primaryEigenIndex ] , elem [ secondaryEigenIndex ] ] ) ; } ) ; return math . multiply ( math . matrix ( data ) , math . matrix ( projectionMatrix ) ) ; }
* Component of Principal Component Analysis
 Computes the projection matrix Y of the primary and secondary eigen-indices onto the new plane.
* Component of Principal Component Analysis Computes the projection matrix Y of the primary and secondary eigen - indices onto the new plane .