FastScannerΒΆ
- class glimix_core.lmm.FastScanner(y, X, QS, v)[source]ΒΆ
Approximated fast inference over several covariates.
Specifically, it maximizes the marginal likelihood
p(π²)β±Ό = π(π² | ππ·β±Ό + πΌβ±ΌπΆβ±Ό, π β±Ό(πΊ + π£πΈ)),
over π·β±Ό, πΆβ±Ό, and sβ±Ό. Matrix Mβ±Ό is the candidate set defined by the user. Variance π£ is not optimised for performance reasons. The method assumes the user has provided a reasonable value for it.
- Parameters
y β Real-valued outcome.
X β Matrix of covariates.
QS β Economic eigendecomposition
((Q0, Q1), S0)
ofK
.v β Variance due to iid effect.
Notes
The implementation requires further explanation as it is somehow obscure. Let πππα΅ = πΊ, where πππα΅ is the eigendecomposition of πΊ. Let π³ = (π + π£πΈ) and π³β = (πβ + π£πΈβ), where πβ is the part of π with positive values. Therefore, solving
(πΊ + π£πΈ)π± = π²
for π± is equivalent to solving
πβπ³βπβα΅π± + π£πβπβα΅π± = πβπ³βπβα΅π± + π£(πΈ - πβπβα΅)π± = π².
for π±. Let
π± = πβπ³ββ»ΒΉπβα΅ if π£=0, and π± = πβπ³ββ»ΒΉπβα΅ + π£β»ΒΉ(πΈ - πβπβα΅) if π£>0.
We therefore have
π± = π±π²
as the solution of (πΊ + π£πΈ)π± = π².
Let πβ±Ό = [π·β±Όα΅ πΆβ±Όα΅]α΅ and π΄β±Ό = [π πΌβ±Ό]. The optimal parameters according to the marginal likelihood are given by
(π΄β±Όα΅π±π΄β±Ό)πβ±Ό = π΄β±Όα΅π±π²
and
π = πβ»ΒΉπ²α΅π±(π² - π΄β±Όπβ±Ό).
Methods
__init__
(y,Β X,Β QS,Β v)Initialize self.
fast_scan
(M[,Β verbose])LMLs, fixed-effect sizes, and scales for single-marker scan.
null_lml
()scan
(M)LML, fixed-effect sizes, and scale of the candidate set.
Attributes
null_beta
Optimal π· according to the marginal likelihood.
null_beta_covariance
Covariance of the optimal π· according to the marginal likelihood.
null_beta_se
Standard errors of the optimal π·.
null_scale
Optimal s according to the marginal likelihood.