Skip to content

Commit

Permalink
Use Cholesky factor not product in condVar
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbates committed Dec 12, 2016
1 parent 1c17268 commit 68d64f5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mixedmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ This function returns an array of `k` three dimensional arrays,
where the `i`th array is of size `vᵢ × vᵢ × ℓᵢ`. These are the
diagonal blocks from the conditional variance-covariance matrix,
s² Λ(Λ'Z'ZΛ + I)Λ'
s² Λ(Λ'Z'ZΛ + I)⁻¹Λ'
"""
function condVar(m::MixedModel)
lm = lmm(m)
Expand All @@ -238,10 +238,10 @@ function condVar(m::MixedModel)
throw(ArgumentError(
"code for more than one term not yet written"))
end
A = lm.A[1,1]
res = Array{eltype(A),3}[]
if isa(A, Diagonal)
push!(res, reshape(inv.(A.diag) .* abs2(Λ[1][1]), (1,1,size(A,1))))
R = lm.R[1,1]
res = Array{eltype(R),3}[]
if isa(R, Diagonal)
push!(res, reshape(inv.(R.diag) .* abs2(Λ[1][1]), (1,1,size(R,1))))
else
throw(ArgumentError(
"code for vector-value random-effects not yet written"))
Expand Down

0 comments on commit 68d64f5

Please sign in to comment.