GPSampler¶
- class glimix_core.random.GPSampler(mean, cov)[source]¶
Sample from a Gaussian Process.
Outcome modelled via
\[\mathbf y \sim \mathcal N(\mathbf z ~|~ \mathbf m, \mathrm K) \mathrm d\mathbf z.\]- Parameters
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 GPSampler >>> >>> random = RandomState(1) >>> >>> mean = offset_mean() >>> cov = linear_eye_cov() >>> >>> y = GPSampler(mean, cov).sample(random) >>> print(y[:5]) [-2.42181498 0.50720447 -1.01053967 0.736624 1.64019063]
Methods
__init__
(mean, cov)Initialize self.
sample
([random_state])Sample from the specified distribution.