public double[] meanColumns() {
        int nRows = getRowDimension();
        int nCols = getColumnDimension();
        double[] result = sumColumns();

        for (int c = 0; c < nCols; c++) {
            result[c] = result[c] / nRows;
        }

        return result;
    }