'Update the global odds ratio based on the current value of
params.'

def update(self, params):

    cpp = self.cpp
    cached_means = self.model.cached_means
    if (len(cpp[0]) == 0):
        return
    tables = {}
    for ii in cpp[0]:
        tables[ii] = np.zeros((2, 2), dtype=np.float64)
    for i in range(self.model.num_group):
        (endog_expval, _) = cached_means[i]
        emat_11 = self.get_eyy(endog_expval, i)
        emat_10 = (endog_expval[:, None] - emat_11)
        emat_01 = ((- emat_11) + endog_expval)
        emat_00 = (1.0 - ((emat_11 + emat_10) + emat_01))
        cpp1 = cpp[i]
        for ky in iterkeys(cpp1):
            ix = cpp1[ky]
            tables[ky][(1, 1)] += emat_11[(ix[:, 0], ix[:, 1])].sum()
            tables[ky][(1, 0)] += emat_10[(ix[:, 0], ix[:, 1])].sum()
            tables[ky][(0, 1)] += emat_01[(ix[:, 0], ix[:, 1])].sum()
            tables[ky][(0, 0)] += emat_00[(ix[:, 0], ix[:, 1])].sum()
    cor_expval = self.pooled_odds_ratio(list(itervalues(tables)))
    self.dep_params *= (self.crude_or / cor_expval)
    if (not np.isfinite(self.dep_params)):
        self.dep_params = 1.0
        warnings.warn('dep_params    became    inf,    resetting    to    1', ConvergenceWarning)
