using Revise
using SnpArrays
using LinearAlgebra
using Random
using LoopVectorization
using MendelIHT
using Test
n = 4097
p = 10000
x = simulate_random_snparray(undef, n, p, min_ma=0) # no missing data
x[1, 1025] = 0x01 # missing
A = SnpLinAlg{Float64}(x, model=ADDITIVE_MODEL, impute=true, center=false, scale=false)
Atrue = convert(Matrix{Float64}, x, model=ADDITIVE_MODEL, impute=true, center=false, scale=false)
b = ones(p)
c = A * b
ctrue = Atrue * b
@test all(c .≈ ctrue) # this errors!
This line (and many similar lines) is the culprit: when impute=true,μ[j] is looping from j in 1:cols. This will be fixed when my matrix-matrix mul routine is done (which will be in the next few days).
MWE
We can check visually that
c != ctrue
This line (and many similar lines) is the culprit: when
impute=true
,μ[j]
is looping fromj in 1:cols
. This will be fixed when my matrix-matrix mul routine is done (which will be in the next few days).For now, do not use
impute=true
forSnpLinAlg
.