Returns a DataFrame of summary/diagnostic statistics for the parameters.

        Args:
            varnames (list): List of variable names to include; if None
                (default), all eligible variables are included.
            ranefs (bool): Whether or not to include random effects in the
                summary. Default is False.
            transformed (bool): Whether or not to include internally
                transformed variables in the summary. Default is False.
            hpd (float, between 0 and 1): Show Highest Posterior Density (HPD)
                intervals with specified width/proportion for all parameters.
                If None, HPD intervals are suppressed.
            quantiles (float, list): Show
                specified quantiles of the marginal posterior distributions for
                all parameters. If list, must be a list of floats between 0 and 1. If
                None (default), no quantiles are shown.
            diagnostics (list): List of functions to use to compute convergence
                diagnostics for all parameters. Each element can be either a
                callable or a string giving the name of a function in the
                diagnostics module. Valid strings are 'gelman_rubin' and
                'effective_n'. Functions must accept a MCMCResults object as
                the sole input, and return a DataFrame with one labeled row per
                parameter. If None, no convergence diagnostics are computed.

def summary(self, varnames=None, ranefs=False, transformed=False, hpd=.95,
                quantiles=None, diagnostics=['effective_n', 'gelman_rubin']):
        '''Returns a DataFrame of summary/diagnostic statistics for the parameters.

        Args:
            varnames (list): List of variable names to include; if None
                (default), all eligible variables are included.
            ranefs (bool): Whether or not to include random effects in the
                summary. Default is False.
            transformed (bool): Whether or not to include internally
                transformed variables in the summary. Default is False.
            hpd (float, between 0 and 1): Show Highest Posterior Density (HPD)
                intervals with specified width/proportion for all parameters.
                If None, HPD intervals are suppressed.
            quantiles (float, list): Show
                specified quantiles of the marginal posterior distributions for
                all parameters. If list, must be a list of floats between 0 and 1. If
                None (default), no quantiles are shown.
            diagnostics (list): List of functions to use to compute convergence
                diagnostics for all parameters. Each element can be either a
                callable or a string giving the name of a function in the
                diagnostics module. Valid strings are 'gelman_rubin' and
                'effective_n'. Functions must accept a MCMCResults object as
                the sole input, and return a DataFrame with one labeled row per
                parameter. If None, no convergence diagnostics are computed.
        '''

        samples = self.to_df(varnames, ranefs, transformed)

        # build the basic DataFrame
        df = pd.DataFrame({'mean': samples.mean(0), 'sd': samples.std(0)})

        # add user-specified quantiles
        if quantiles is not None:
            if not isinstance(quantiles, (list, tuple)):
                quantiles = [quantiles]
            qnames = ['q' + str(q) for q in quantiles]
            df = df.merge(samples.quantile(quantiles).set_index([qnames]).T,
                          left_index=True, right_index=True)

        # add HPD intervals
        if hpd is not None:
            df = df.merge(samples.apply(self._hpd_interval, axis=0,
                          width=hpd).T, left_index=True, right_index=True)

        # add convergence diagnostics
        if diagnostics is not None:
            _names = self._filter_names(ranefs=ranefs, transformed=transformed)
            _self = self[_names]
            if self.n_chains > 1:
                for diag in diagnostics:
                    if isinstance(diag, string_types):
                        diag = getattr(bmd, diag)
                    df = df.merge(diag(_self), left_index=True,
                                  right_index=True)
            else:
                warnings.warn('Multiple MCMC chains are required in order '
                              'to compute convergence diagnostics.')

        # For bernoulli models, tell user which event is being modeled
        if self.model.family.name == 'bernoulli':
            event = next(i for i, x in enumerate(self.model.y.data.flatten())
                         if x > .99)
            warnings.warn('Modeling the probability that {}==\'{}\''.format(
                self.model.y.name,
                str(self.model.clean_data[self.model.y.name][event])))

        return df