private double cost(DMatrixRMaj param )
    {
        function.compute(param, residuals);

        double error = NormOps_DDRM.normF(residuals);

        return error*error / (double)residuals.numRows;
    }
private double cost ( DMatrixRMaj param ) { function . compute ( param , residuals ) ; double error = NormOps_DDRM . normF ( residuals ) ; return error * error / ( double ) residuals . numRows ; }
Computes the "cost" for the parameters given.

cost = (1/N) Sum (f(x) - y)^2