Define the jump distribution covariance matrix from the object's
        stored trace.

        :Parameters:
        - `trace` : slice or int
          A slice for the stochastic object's trace in the last chain, or a
          an integer indicating the how many of the last samples will be used.

def cov_from_trace(self, trace=slice(None)):
        """Define the jump distribution covariance matrix from the object's
        stored trace.

        :Parameters:
        - `trace` : slice or int
          A slice for the stochastic object's trace in the last chain, or a
          an integer indicating the how many of the last samples will be used.

        """
        n = []
        for s in self.stochastics:
            n.append(s.trace.length())
        n = set(n)
        if len(n) > 1:
            raise ValueError('Traces do not have the same length.')
        elif n == 0:
            raise AttributeError(
                'Stochastic has no trace to compute covariance.')
        else:
            n = n.pop()

        if not isinstance(trace, slice):
            trace = slice(trace, n)

        a = self.trace2array(trace)

        return np.cov(a, rowvar=0)