LinearMean

class glimix_core.mean.LinearMean(X)[source]

Linear mean function, X𝜶.

It defines X𝜶, for which X is a n×m matrix provided by the user and 𝜶 is a vector of size m.

Example

>>> from glimix_core.mean import LinearMean
>>>
>>> mean = LinearMean([[1.5, 0.2], [0.5, 0.4]])
>>> mean.effsizes = [1.0, -1.0]
>>> print(mean.value())
[1.3 0.1]
>>> print(mean.gradient()["effsizes"])
[[1.5 0.2]
 [0.5 0.4]]
>>> mean.name = "𝐦"
>>> print(mean)
LinearMean(m=2): 𝐦
  effsizes: [ 1. -1.]
__init__(X)[source]

Constructor.

Parameters

X (array_like) – Covariates X, from X𝜶.

Methods

__init__(X)

Constructor.

gradient()

Gradient of the linear mean function over the effect sizes.

value()

Linear mean function.

Attributes

X

An n×m matrix of covariates.

effsizes

Effect-sizes parameter, 𝜶, of size m.

name

Name of this function.