LRFreeFormCov¶
- class glimix_core.cov.LRFreeFormCov(n, m)[source]¶
General semi-definite positive matrix of low rank, K = LLᵀ.
The covariance matrix K is given by LLᵀ, where L is a n×m matrix and n≥m. Therefore, K will have rank(K) ≤ m.
Example
>>> from glimix_core.cov import LRFreeFormCov >>> cov = LRFreeFormCov(3, 2) >>> print(cov.L) [[1. 1.] [1. 1.] [1. 1.]] >>> cov.L = [[1, 2], [0, 3], [1, 3]] >>> print(cov.L) [[1. 2.] [0. 3.] [1. 3.]] >>> cov.name = "F" >>> print(cov) LRFreeFormCov(n=3, m=2): F L: [[1. 2.] [0. 3.] [1. 3.]]
Methods
__init__
(n, m)Constructor.
fix
()Disable parameter optimisation.
gradient
()Derivative of the covariance matrix over the lower triangular, flat part of L.
listen
(func)Listen to parameters change.
unfix
()Enable parameter optimisation.
value
()Covariance matrix.
Attributes
L
Matrix L from K = LLᵀ.
Lu
Lower-triangular, flat part of L.
name
Name of this function.
nparams
Number of parameters.
shape
Array shape.