LinearCov¶
- class glimix_core.cov.LinearCov(X)[source]¶
Linear covariance function, K = s⋅XXᵀ.
The mathematical representation is s⋅XXᵀ, for a n×r matrix X provided by the user and a scaling parameter s.
Example
>>> from glimix_core.cov import LinearCov >>> from numpy import dot >>> from numpy.random import RandomState >>> >>> X = RandomState(0).randn(2, 3) >>> cov = LinearCov(X) >>> cov.scale = 1.3 >>> cov.name = "K" >>> print(cov) LinearCov(): K scale: 1.3
Methods
__init__
(X)Constructor.
fix
()Prevent s update during optimization.
gradient
()Derivative of the covariance matrix over log(s).
unfix
()Enable s update during optimization.
value
()Covariance matrix.
Attributes
X
Matrix X from K = s⋅XXᵀ.
name
Name of this function.
scale
Scale parameter.