def error(Y, X):
    """
    Calculates mean squared error (MSE) of the reconstructed data (X) relative
    to the original data (Y). In theory, this number should decrease as the
    order of the markov process increases and/or the number of components
    involved in the original projection (if used) increases.

    Parameters
    ----------
    Y : array, shape (N, M)
        The original data.
    X : array, shape (N, M)
        The reconstructed data (output from "test").

    Returns
    -------
    MSE : array, shape (N, M)
        Same dimensions as X and Y, where each element is the MSE as if the
        corresponding element in the reconstructed data Y operated as the estimator 
        for the corresponding element in the original data X.
    """
    return (Y - X) ** 2