likely.js
function calculateTotalError(errorMatrix)
{
	var totError = 0.0;
	for(var i = 1; i <= errorMatrix.rows(); i++)
	{
		for(var j = 1; j <= errorMatrix.cols(); j++)
		{
			totError += Math.pow(errorMatrix.e(i, j), 2);
		}
	}
	
	return totError;
}
function calculateTotalError(errorMatrix)
{
	var totError = 0.0;
	for(var i = 1; i <= errorMatrix.rows(); i++)
	{
		for(var j = 1; j <= errorMatrix.cols(); j++)
		{
			totError += Math.pow(errorMatrix.e(i, j), 2);
		}
	}
	
	return totError;
}
function calculateTotalError ( errorMatrix ) { var totError = 0.0 ; for ( var i = 1 ; i <= errorMatrix . rows ( ) ; i ++ ) { for ( var j = 1 ; j <= errorMatrix . cols ( ) ; j ++ ) { totError += Math . pow ( errorMatrix . e ( i , j ) , 2 ) ; } } return totError ; }
Computes the total error based on a matrix of error values.
@param errorMatrix A matrix of the error values.
@returns float Total error, defined as the sum of the squared errors.
Computes the total error based on a matrix of error values .