diff --git a/Project.toml b/Project.toml index 00c9114..4b52524 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MixedModelsSim" uuid = "d5ae56c5-23ca-4a1f-b505-9fc4796fc1fe" authors = ["Phillip Alday", "Douglas Bates", "Lisa DeBruine", "Reinhold Kliegl"] -version = "0.2.8" +version = "0.2.9" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/utilities.jl b/src/utilities.jl index 5ef65f7..c291dba 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -281,6 +281,7 @@ random effects. [`update!`](@ref) requires. """ function create_re(sigmas...; corrmat=nothing) + all(>=(0), sigmas) || throw(ArgumentError("all σs must be non negative")) ss = Diagonal([sigmas...]) isnothing(corrmat) ? LowerTriangular(ss) : ss * cholesky(Symmetric(corrmat, :L)).L