# Path: glimix_core/link/_link.py
# class IdentityLink(object):
#     """
#     Identity link function, g(x) = x.
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(x, float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(x, float)
# 
# class LogitLink(object):
#     """
#     Logit link function, g(x) = log(x/(1 - x)).
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(log(x / (1 - x)), float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(1 / (1 + exp(-x)), float)
# 
# class LogLink(object):
#     """
#     Log link function, g(x) = log(x).
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(log(x), float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(exp(x), float)


from numpy import ascontiguousarray
from ..link import IdentityLink, LogitLink, LogLink
        import scipy.stats as st
        import scipy.stats as st
        import scipy.stats as st
    def sample_size(self):
        r"""Get the number of samples."""
        assert self.outcome is not None
        return len(self.outcome)


class BinomialProdLik(object):
    r"""
    Product of Binomial likelihoods.

    The product can be written as

    .. math::

        \prod_i \binom{n_i}{n_i y_i} p_i^{n_i y_i}
        (1-p_i)^{n_i - n_i y_i}

    where :math:`p_i` is the probability of success.

    Parameters
    ----------
    ntrials : array_like
        Array of number of trials.
    link : link_func
        Link function establishing :math:`g(p_i) = x_i`. Defaults to ``None``, which
        leads to the :class:`glimix_core.link.LogitLink` link function.
    """

    def __init__(self, ntrials, link=None):
        if link is None:

# Path: glimix_core/link/_link.py
# class IdentityLink(object):
#     """
#     Identity link function, g(x) = x.
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(x, float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(x, float)
# 
# class LogitLink(object):
#     """
#     Logit link function, g(x) = log(x/(1 - x)).
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(log(x / (1 - x)), float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(1 / (1 + exp(-x)), float)
# 
# class LogLink(object):
#     """
#     Log link function, g(x) = log(x).
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(log(x), float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(exp(x), float)


# Path: glimix_core/lik/_prod.py
from numpy import ascontiguousarray
from ..link import IdentityLink, LogitLink, LogLink
        import scipy.stats as st
        import scipy.stats as st
        import scipy.stats as st

    def sample_size(self):
        r"""Get the number of samples."""
        assert self.outcome is not None
        return len(self.outcome)


class BinomialProdLik(object):
    r"""
    Product of Binomial likelihoods.

    The product can be written as

    .. math::

        \prod_i \binom{n_i}{n_i y_i} p_i^{n_i y_i}
        (1-p_i)^{n_i - n_i y_i}

    where :math:`p_i` is the probability of success.

    Parameters
    ----------
    ntrials : array_like
        Array of number of trials.
    link : link_func
        Link function establishing :math:`g(p_i) = x_i`. Defaults to ``None``, which
        leads to the :class:`glimix_core.link.LogitLink` link function.
    """

    def __init__(self, ntrials, link=None):
        if link is None:

            link = LogitLink