Gamma models convergence checks and run time
Nobody has claimed this yet.
- #201 by @palday — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
Research direction
Start by reproducing the four GLMM calls from the issue with the supplied lexdec dataset and MixedModels 0.10.0, then inspect the MixedModels GLMM fitting and convergence behavior. Done would require a maintainer-approved scope covering the requested convergence checks, random-effect interactions, runtime, or inverse-Gaussian support, with tests demonstrating the chosen behavior.
Written by the indexing model from the issue text.
Description
I am trying to fit a Gamma model to a reaction time data (there is a recent paper that argues for not transforming RTs and using GLMM with Gamma or Inverse Gaussian --> http://journal.frontiersin.org/article/10.3389/fpsyg.2015.01171/full )
I have a few question about running GLMMs in Julia, but before asking them I will go over a reproducible example using a known dataset (my dataset is large and takes too long to run). I am new to GLMMs and Julia, so I might have done something wrong. Let me know if that's the case.
Using Baayen's data from langugaeR package in R, I ran 4 models, 3 out of which do not make sense for this data. There are number of variables, but I will focus on the native language (English and other) and word class (Animal and Plant). Also, I've converted RTs to raw RTs, as in the dataset they are log-ed.
using DataArrays, DataFrames , MixedModels, GLM, RDatasets, RData
#Baayen's data from langugaeR package in R saved as .csv from R
lexdec=readtable("lexdec.csv", makefactors=true)
lexdec_1 = fit!(glmm(@formula(rt_raw ~ 1 + Class*NativeLanguage + (1+Class*NativeLanguage|Subject) + (1|Word)), lexdec, Gamma(), IdentityLink()))
ERROR: MethodError: no method matching getindex(::DataFrames.DataFrame, ::Expr)
lexdec_2 = fit!(glmm(@formula(rt_raw ~ 1 + Class*NativeLanguage + (1+Class+NativeLanguage|Subject) + (1|Word)), lexdec, Gamma(), IdentityLink()))
lexdec_3 = fit!(glmm(@formula(rt_raw ~ 1 + Class*NativeLanguage + (1+NativeLanguage|Subject) + (1|Word)), lexdec, Gamma(), IdentityLink()))
lexdec_4 = fit!(glmm(@formula(rt_raw ~ 1 + Class*NativeLanguage + (1+Class|Subject) + (1|Word)), lexdec, Gamma(), IdentityLink()))
Lexdec_1 did not run. I suppose the interaction term is not supported in the random effects. Lexdec_2, 3, 4 ran without a problem. However, Lexdec_2 and 3 do not make sense for this data as random slopes for native language are inappropriate here (each person has only one language background, so there's no data to estimate how that person would behave if they had the other language background). Only Lexdec_4 is a valid model here. Nevertheless, all models except lexdec_1 ran just fine. I also ran the models using lmm in Julia with identical results on convergence.
For comparison I ran Gamma models in R using lme4 and glmmTMB. glmer from lme4 sucsesfully ran all 4 models (including the interaction model). glmmTMB gave convergence warnings on Lexdec_1, 2, and 4, while no warning on Lexdec_3.
I observed different results when running lmm models in R using lme4 and glmmTMB. lmer from lme4 gave warnings on Lexdec_1 and 3, while glmmTMB gave warnings on Lexdec_1, 2, and 3 (was glmmTMB able to catch the inappropriate models?)
My questions:
- Are there any convergence checks? I can run any model with any parameters without getting any convergence warnings.
- Are interactions of random effects supported?
- What can I do to decrees runtime? My dataset has ~20k observations and there are 2 within factors with 3 levels each and one between factor with 2 levels.
- Are there any plans to implement support for Inverse Gaussian? I ran Inverse Gaussian models using lme4 and glmmTMB with identical results, so I guess there is not much of difference from RT data.
I am running arch linux 4.12.3-1-ARCH with openblas-lapack installed from AUR.
julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b* (2017-06-19 13:05 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
WORD_SIZE: 64
BLAS: libopenblas (HASWELL)
LAPACK: liblapack
LIBM: libm
LLVM: libLLVM-4.0.0 (ORCJIT, haswell)
julia> Pkg.status()
- MixedModels 0.10.0
- GLM 0.7.0
- Dominant language
- Julia
- Stars
- 455
- Forks
- 51
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaStats/MixedModels.jl
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
JuliaStats/MixedModels.jl#905 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaStats/MixedModels.jl#877 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaStats/MixedModels.jl#868 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaStats/MixedModels.jl#830 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
JuliaStats/MixedModels.jl#820 · 8 comments ·
All issues in JuliaStats/MixedModels.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaParallel/Hwloc.jl#93 ·
-
Affine transformations of `JohnsonSU` could return a `JohnsonSU`Possibly taken @devmotion claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaStats/Distributions.jl#2117 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
TomerAberbach/profiler-md#970 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
grame-cncm/faust#1409 ·
Maintainers usually reply within 1 day