segmentation/bmoss/change_detec.py
def update(self, X, Y):
        """Update the sufficient statistics given observed data.

        The sufficient statistics are the only parameters required to describe
        the shape of the distribution. Initially, the sufficient statistics
        contain no information apart from that implied by the prior
        distribution. As data arrive, the statistics are updated incrementally
        in order to reflect this new knowledge. Performing updates allows the
        sufficient statistics to summarise all information contained in the
        data observed so far.

        """

        # (Equation 5a, b)
        #
        #     | XX    XY |
        #     | YX    YY |
        #
        if np.ndim(X) > 1:
            k, m = np.shape(X)
            x = np.dot(X.T, Y)

            # Update the statistics given a block of data (in the following
            # order: XX, XY, YX, YY)
            self.__prod[:m, :m] += np.dot(X.T, X)
            self.__prod[:m, m:] += x
            self.__prod[m:, :m] += x.T
            self.__prod[m:, m:] += np.dot(Y.T, Y)
            self.__weight += k

        else:
            m = np.size(X)
            x = np.outer(X, Y)

            # Update the statistics given a single datum.
            self.__prod[:m, :m] += np.outer(X, X)
            self.__prod[:m, m:] += x
            self.__prod[m:, :m] += x.T
            self.__prod[m:, m:] += np.outer(Y, Y)
            self.__weight += 1
Update the sufficient statistics given observed data.

        The sufficient statistics are the only parameters required to describe
        the shape of the distribution. Initially, the sufficient statistics
        contain no information apart from that implied by the prior
        distribution. As data arrive, the statistics are updated incrementally
        in order to reflect this new knowledge. Performing updates allows the
        sufficient statistics to summarise all information contained in the
        data observed so far.

        
Update the sufficient statistics given observed data.
The sufficient statistics are the only parameters required to describe
the shape of the distribution. Initially, the sufficient statistics
contain no information apart from that implied by the prior
distribution. As data arrive, the statistics are updated incrementally
in order to reflect this new knowledge. Performing updates allows the
sufficient statistics to summarise all information contained in the
data observed so far.
Update the sufficient statistics given observed data . The sufficient statistics are the only parameters required to describe the shape of the distribution . Initially the sufficient statistics contain no information apart from that implied by the prior distribution . As data arrive the statistics are updated incrementally in order to reflect this new knowledge . Performing updates allows the sufficient statistics to summarise all information contained in the data observed so far .
def update(self, X, Y):
             | XX    XY |
             | YX    YY |
        if np.ndim(X) > 1:
            k, m = np.shape(X)
            x = np.dot(X.T, Y)
             Update the statistics given a block of data (in the following
             order: XX, XY, YX, YY)
            self.__prod[:m, :m] += np.dot(X.T, X)
            self.__prod[:m, m:] += x
            self.__prod[m:, :m] += x.T
            self.__prod[m:, m:] += np.dot(Y.T, Y)
            self.__weight += k
        else:
            m = np.size(X)
            x = np.outer(X, Y)
             Update the statistics given a single datum.
            self.__prod[:m, :m] += np.outer(X, X)
            self.__prod[:m, m:] += x
            self.__prod[m:, :m] += x.T
            self.__prod[m:, m:] += np.outer(Y, Y)
            self.__weight += 1
def update ( self , X , Y ) : if np . ndim ( X ) > 1 : k , m = np . shape ( X ) x = np . dot ( X . T , Y ) self . __prod [ : m , : m ] += np . dot ( X . T , X ) self . __prod [ : m , m : ] += x self . __prod [ m : , : m ] += x . T self . __prod [ m : , m : ] += np . dot ( Y . T , Y ) self . __weight += k else : m = np . size ( X ) x = np . outer ( X , Y ) self . __prod [ : m , : m ] += np . outer ( X , X ) self . __prod [ : m , m : ] += x self . __prod [ m : , : m ] += x . T self . __prod [ m : , m : ] += np . outer ( Y , Y ) self . __weight += 1
Update the sufficient statistics given observed data.
Update the sufficient statistics given observed data .
"""Update the sufficient statistics given observed data.

        The sufficient statistics are the only parameters required to describe
        the shape of the distribution. Initially, the sufficient statistics
        contain no information apart from that implied by the prior
        distribution. As data arrive, the statistics are updated incrementally
        in order to reflect this new knowledge. Performing updates allows the
        sufficient statistics to summarise all information contained in the
        data observed so far.

        """ # (Equation 5a, b) # #     | XX    XY | #     | YX    YY | # # Update the statistics given a block of data (in the following # order: XX, XY, YX, YY) # Update the statistics given a single datum.
self
X
Y