r"""Equilibrium expectation of given observable.

    Parameters
    ----------
    P : (M, M) ndarray
        Transition matrix
    obs : (M,) ndarray
        Observable, represented as vector on state space

    Returns
    -------
    x : float
        Expectation value

def expectation(P, obs):
    r"""Equilibrium expectation of given observable.

    Parameters
    ----------
    P : (M, M) ndarray
        Transition matrix
    obs : (M,) ndarray
        Observable, represented as vector on state space

    Returns
    -------
    x : float
        Expectation value

    """
    pi = statdist(P)
    return np.dot(pi, obs)