code: public static double[] solveLinearEquationLeastSquare(double[][] matrix, double[] vector) {
  		// We use the linear algebra package apache commons math
  		DecompositionSolver solver = new SingularValueDecomposition(new Array2DRowRealMatrix(matrix, false)).getSolver();
  		return solver.solve(new ArrayRealVector(vector)).toArray();
  	}
docs: Find a solution of the linear equation A x = b in the least square sense where
  <ul>
  <li>A is an n x m - matrix given as double[n][m]</li>
  <li>b is an m - vector given as double[m],</li>
  <li>x is an n - vector given as double[n],</li>
  </ul>
  
  @param matrix The matrix A (left hand side of the linear equation).
  @param vector The vector b (right hand of the linear equation).
  @return A solution x to A x = b.