likely.js
function calculateColumnAverage(inputMatrix)
{
	var rows = inputMatrix.rows();
	
	var averages = new Array();
	for(var i = 1; i <= inputMatrix.cols(); i++)
	{
		var sum = 0;
		for(var j = 1; j <= inputMatrix.rows(); j++)
		{
			sum += inputMatrix.e(j, i);
		}
		averages[i-1] = sum/rows;
	}
	
	return $V(averages);
}
function calculateColumnAverage(inputMatrix)
{
	var rows = inputMatrix.rows();
	
	var averages = new Array();
	for(var i = 1; i <= inputMatrix.cols(); i++)
	{
		var sum = 0;
		for(var j = 1; j <= inputMatrix.rows(); j++)
		{
			sum += inputMatrix.e(j, i);
		}
		averages[i-1] = sum/rows;
	}
	
	return $V(averages);
}
function calculateColumnAverage ( inputMatrix ) { var rows = inputMatrix . rows ( ) ; var averages = new Array ( ) ; for ( var i = 1 ; i <= inputMatrix . cols ( ) ; i ++ ) { var sum = 0 ; for ( var j = 1 ; j <= inputMatrix . rows ( ) ; j ++ ) { sum += inputMatrix . e ( j , i ) ; } averages [ i - 1 ] = sum / rows ; } return $V ( averages ) ; }
Computes the average value for each column of a matrix of values.
@param input A matrix of the input values
@returns Vector Average value for each column. Vector[i] is the average for column i.
Computes the average value for each column of a matrix of values .