class ColumnVector {

  public double correlation(final ColumnVector vector) {
    if (this.size != vector.size) {
      throw new IllegalArgumentException(
          "cannot determine the correlation between vectors with different sizes");
    }

    final ColumnVector meanAdjustedX = this.meanAdjust();
    final ColumnVector meanAdjustedY = vector.meanAdjust();

    final double squaredDeviationX = meanAdjustedX.multiplyElementWise(meanAdjustedX).sum();
    final double squaredDeviationY = meanAdjustedY.multiplyElementWise(meanAdjustedY).sum();
    final double deviationProduct = meanAdjustedX.multiplyElementWise(meanAdjustedY).sum();
    return deviationProduct / Math.sqrt(squaredDeviationX * squaredDeviationY);
  }

  public  ColumnVector(final int size);
  public  ColumnVector(final double... vector);
  private  ColumnVector(final Matrix matrix);

}