GGPSampler¶
- class glimix_core.random.GGPSampler(lik, mean, cov)[source]¶
Sample from a Generalised Gaussian Process.
Outcome modelled via
\[\mathbf y \sim \int \prod_i \mathrm{ExpFam}(y_i ~|~ g_i(z_i)) \mathcal N(\mathbf z ~|~ \mathbf m; \mathrm K) \mathrm d\mathbf z.\]- Parameters
link (str) – Likelihood name.
mean (function) – Mean function.
cov (function) – Covariance function.
Example
>>> from numpy.random import RandomState >>> >>> from glimix_core.example import offset_mean >>> from glimix_core.example import linear_eye_cov >>> from glimix_core.random import GGPSampler >>> from glimix_core.lik import DeltaProdLik >>> >>> random = RandomState(1) >>> >>> mean = offset_mean() >>> cov = linear_eye_cov() >>> >>> lik = DeltaProdLik() >>> >>> y = GGPSampler(lik, mean, cov).sample(random) >>> print(y[:5]) [-2.42181498 0.50720447 -1.01053967 0.736624 1.64019063]
Methods
__init__
(lik, mean, cov)Initialize self.
sample
([random_state])Sample from the specified distribution.