Skip to content

Commit

Permalink
add test for non-zero step size correction in glmm boundary fits
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Oct 1, 2019
1 parent 98f2127 commit a954481
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MixedModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export @formula,
Gamma,
GeneralizedLinearMixedModel,
HelmertCoding,
IdentityLink,
InverseGaussian,
InverseLink,
LinearMixedModel,
Expand All @@ -49,6 +50,7 @@ export @formula,
RaggedArray,
RandomEffectsTerm,
ReMat,
SqrtLink,
UniformBlockDiagonal,
VarCorr,
aic,
Expand Down
Binary file added test/lexdec.rds
Binary file not shown.
15 changes: 15 additions & 0 deletions test/pirls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,18 @@ end
#@test isapprox(sum(x -> sum(abs2, x), gm4.u), 196.8695297987013, atol=0.1)
#@test isapprox(sum(gm4.resp.devresid), 220.92685781326136, atol=0.1)
end

@testset "lexdec" begin
lexdec = load(joinpath(dirname(pathof(MixedModels)), "..", "test", "lexdec.rds"))
gmldγ = fit(MixedModel, @formula(RT_raw ~ 1 + Class * NativeLanguage + (1|Subject) + (1|Word)),
lexdec, Gamma(), IdentityLink(), fast=false)
@test all(gmldγ.optsum.initial_step .> 0)
@test first(gmldγ.θ) == 0

# don't know how much sense this model makes, but it's a boundary fit on two
# boundaries and it uses InverseGaussian()
gmldig = fit(MixedModel, @formula(RT_raw ~ 1 + Class * NativeLanguage + (1|Subject) + (1|Word)),
lexdec, InverseGaussian(), IdentityLink(), fast=false)
@test all(gmldγ.optsum.initial_step .> 0)
@test all(gmldig.θ .== 0)
end

0 comments on commit a954481

Please sign in to comment.