You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kkl15.qmd
+24-19Lines changed: 24 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,6 @@ Stroup, W. W. (2012, p. 185). _Generalized linear mixed models: Modern concepts,
31
31
#| code-fold: true
32
32
#| output: false
33
33
using AlgebraOfGraphics
34
-
using AlgebraOfGraphics: density
35
34
using BoxCox
36
35
using CairoMakie
37
36
using CategoricalArrays
@@ -41,8 +40,12 @@ using DataFrames
41
40
using MixedModels
42
41
using MixedModelsMakie
43
42
using Random
44
-
using SMLP2026: dataset
45
43
using StatsBase
44
+
45
+
using AlgebraOfGraphics: density
46
+
using SMLP2026: dataset
47
+
48
+
progress = isinteractive()
46
49
```
47
50
48
51
# Read data, compute and plot means
@@ -101,7 +104,7 @@ contrasts = Dict(
101
104
102
105
# Maximum LMM
103
106
104
-
This is the maximum LMM for the design; `size` is a between-subject factor,
107
+
This is the maximum LMM for the design; `size` is a between-subject factor,
105
108
ignoring other information such as trial number, age and gender of subjects.
106
109
107
110
```{julia}
@@ -124,7 +127,7 @@ only(MixedModels.PCA(m_max))
124
127
VarCorr(m_max)
125
128
```
126
129
127
-
The LMM `m_max` is overparameterized but it is not immediately apparent why.
130
+
The LMM `m_max` is overparameterized but it is not immediately apparent why.
128
131
129
132
# Reduction strategy 1
130
133
@@ -152,7 +155,7 @@ only(MixedModels.PCA(m_zcp1))
152
155
VarCorr(m_zcp1)
153
156
```
154
157
155
-
The LMM `m_zcp1` is also overparameterized, but now there is clear evidence for absence of evidence for the VC of one of the interactions and the other two interaction-based VCs are also very small.
158
+
The LMM `m_zcp1` is also overparameterized, but now there is clear evidence for absence of evidence for the VC of one of the interactions and the other two interaction-based VCs are also very small.
AIC prefers LMM `m_prm1` over `m_zcp1_rdc`; BIC LMM `m_zcp1_rdc`.
236
+
AIC prefers LMM `m_prm1` over `m_zcp1_rdc`; BIC LMM `m_zcp1_rdc`.
233
237
As the CPs were one reason for conducting this experiment, AIC is the criterion of choice.
234
238
235
239
# Reduction strategy 2
236
240
237
241
## Complex LMM
238
-
Relative to LMM `m_max`, first we take out interaction VCs and associated CPs, because these VCs are very small. This is the same as LMM `m_prm1` above.
242
+
Relative to LMM `m_max`, first we take out interaction VCs and associated CPs, because these VCs are very small. This is the same as LMM `m_prm1` above.
@@ -82,16 +81,14 @@ The elements of this parameter vector are subject to constraints.
82
81
In particular, two of the three elements have a lower bound of zero.
83
82
84
83
```{julia}
85
-
m01.lowerbd
84
+
lowerbd(m01)
86
85
```
87
86
88
87
That is, the first and third elements of $\theta$, corresponding to diagonal elements of $\lambda$, must be non-negative, whereas the second component is unconstrained (has a lower bound of $-\infty$).
89
88
90
89
# Progress of the iterations
91
90
92
-
The `optsum.fitlog` property of the model is a vector of tuples where each tuple contains the value of the $\theta$ vector and the value of the objective at that $\theta$.
93
-
The `fitlog` always contains the first and the last evaluation.
94
-
When the `thin` named argument is set, this property has a row for every thin'th evaluation.
91
+
The `optsum.fitlog` property of the model is table that contains the value of the $\theta$ vector and the value of the objective at that $\theta$.
0 commit comments