code: function lu(A) {
      var size = A.length;
      //var L=jStat.diagonal(jStat.ones(1,size)[0]);
      var L = jStat.identity(size);
      var R = jStat.zeros(A.length, A[0].length);
      var parts;
      jStat.arange(size).forEach(function(t) {
        R[0][t] = A[0][t];
      });
      jStat.arange(1, size).forEach(function(l) {
        jStat.arange(l).forEach(function(i) {
          parts = jStat.arange(i).map(function(jj) {
            return L[l][jj] * R[jj][i];
          });
          L[l][i] = (A[l][i] - jStat.sum(parts)) / R[i][i];
        });
        jStat.arange(l, size).forEach(function(j) {
          parts = jStat.arange(l).map(function(jj) {
            return L[l][jj] * R[jj][j];
          });
          R[l][j] = A[i][j] - jStat.sum(parts);
        });
      });
      return [L, R];
    }
docs: A -> [L,U] A=LU L is lower triangular matrix U is upper triangular matrix