# Path: glimix_core/link/_link.py
# 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)
# 
# class ProbitLink(object):
#     """
#     Probit link function, g(x) = 𝚽⁻¹(x).
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(_normal_icdf(asarray(x, float)), float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(_normal_cdf(asarray(x, float)), float)


from numpy.testing import assert_allclose
from glimix_core.link import LogitLink, LogLink, ProbitLink



def test_probit_link():
    link = ProbitLink()
    assert_allclose(link.value(link.inv(3.2)), 3.2)


def test_logit_link():
    link = LogitLink()
    assert_allclose(link.value(link.inv(3.2)), 3.2)


def test_loglink_link():

# Path: glimix_core/link/_link.py
# 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)
# 
# class ProbitLink(object):
#     """
#     Probit link function, g(x) = 𝚽⁻¹(x).
#     """
# 
#     @_value_doc
#     def value(self, x):
#         return asarray(_normal_icdf(asarray(x, float)), float)
# 
#     @_inv_doc
#     @staticmethod
#     def inv(x):
#         return asarray(_normal_cdf(asarray(x, float)), float)


# Path: glimix_core/link/test/test_link.py
from numpy.testing import assert_allclose
from glimix_core.link import LogitLink, LogLink, ProbitLink




def test_probit_link():
    link = ProbitLink()
    assert_allclose(link.value(link.inv(3.2)), 3.2)


def test_logit_link():
    link = LogitLink()
    assert_allclose(link.value(link.inv(3.2)), 3.2)


def test_loglink_link():

    link = LogLink()