def poisson_sample(<EOL>offset,<EOL>G,<EOL>heritability=<NUM_LIT:0.5>,<EOL>causal_variants=None,<EOL>causal_variance=<NUM_LIT:0>,<EOL>random_state=None,<EOL>):
mean, cov = _mean_cov(<EOL>offset, G, heritability, causal_variants, causal_variance, random_state<EOL>)<EOL>link = LogLink()<EOL>lik = PoissonProdLik(link)<EOL>sampler = GGPSampler(lik, mean, cov)<EOL>return sampler.sample(random_state)<EOL>
Poisson likelihood sampling.

    Parameters
    ----------
    random_state : random_state
        Set the initial random state.

    Example
    -------

    .. doctest::

        >>> from glimix_core.random import poisson_sample
        >>> from numpy.random import RandomState
        >>> offset = -0.5
        >>> G = [[0.5, -1], [2, 1]]
        >>> poisson_sample(offset, G, random_state=RandomState(0))
        array([0, 6])