# 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 __init__(self, link=None):
        if link is None:
            link = LogLink()
        self._link = link
        self._noccurrences = None

    @property
    def name(_):
        r"""Get the name of this likelihood."""
        return "Poisson"

    @property
    def noccurrences(self):
        r"""Get or set an array of number of occurrences."""
        return self._noccurrences

    @noccurrences.setter
    def noccurrences(self, v):
        self._noccurrences = _aca(v)

    def mean(self, x):
        r"""Mean of the number of occurrences."""
        return self._link.inv(x)

    @_sample_doc
    def sample(self, x, random_state=None):

        lam = self.mean(x)
        return st.poisson(mu=lam).rvs(random_state=random_state)


# 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 __init__(self, link=None):
        if link is None:
            link = LogLink()
        self._link = link
        self._noccurrences = None

    @property
    def name(_):
        r"""Get the name of this likelihood."""
        return "Poisson"

    @property
    def noccurrences(self):
        r"""Get or set an array of number of occurrences."""
        return self._noccurrences

    @noccurrences.setter
    def noccurrences(self, v):
        self._noccurrences = _aca(v)

    def mean(self, x):
        r"""Mean of the number of occurrences."""
        return self._link.inv(x)

    @_sample_doc
    def sample(self, x, random_state=None):

        lam = self.mean(x)
        return st.poisson(mu=lam).rvs(random_state=random_state)


    @property