- Support for different optimization criteria during the bootstrap. #694
- Support for combining bootstrap results with
vcat
. #694 - Support for saving and restoring bootstrap replicates with
savereplicates
andrestorereplicates
. #694
- New function
profile
for computing likelihood profiles forLinearMixedModel
. The resultantMixedModelProfile
can be then be used for computing confidence intervals withconfint
. Note that this API is still somewhat experimental and as such the internal storage details ofMixedModelProfile
may change in a future release without being considered breaking. #639 - A
confint(::LinearMixedModel)
method has been defined that returns Wald confidence intervals based on the z-statistic, i.e. treating the denominator degrees of freedom as infinite. #639
raneftables
returns aNamedTuple
where the names are the grouping factor names and the values are someTables.jl
-compatible type. This type has been changed to aTable
fromTypedTables.jl
. #682
- Precompilation is now handled with
PrecompileTools
instead ofSnoopPrecompile
. #681 - An unnecessary explicit
Vararg
in an internal method has been removed. This removal eliminates a compiler warning about the deprecatedVararg
pattern. #680
- The pirated method
Base.:/(a::AbstractTerm, b::AbstractTerm)
is no longer defined. This does not impact the use of/
as a nesting term in@formula
within MixedModels, only the programmatic runtime construction of formula, e.g.term(:a) / term(:b)
. If you requireBase.:/
, thenRegressionFormulae.jl
provides this method. (Avoiding method redefinition when usingRegressionFormulae.jl
is the motivating reason for this change.) #677
raneftables
returns aNamedTuple
where the names are the grouping factor names and the values are someTables.jl
-compatible type. Currently this type is aDictTable
fromTypedTables.jl
. #634
- Rank deficiency in prediction is now supported, both when the original model was fit to rank-deficient data and when the new data are rank deficient. The behavior is consistent but may be surprising when both old and new data are rank deficient. See the
predict
docstring for an example. #676 - Multithreading in
parametricbootstrap
withuse_threads
is now deprecated and a noop. With improvements in BLAS threading, multithreading at the Julia level did not help performance and sometimes hurt it. #674
- Support
StatsModels
0.7, drop support forStatsModels
0.6. #664 - Revise code in benchmarks to work with recent Julia and PkgBenchmark.jl #667
- Julia minimum compat version raised to 1.8 because of BSplineKit #665
- Use
SnoopPrecompile
for better precompilation performance. This can dramatically increase TTFX, especially on Julia 1.9. #663
- Don't fit a GLM internally during construction of GLMM when the fixed effects are empty (better compatibility with
dropcollinear
kwarg in newer GLM.jl) #657
- Allow predicting from a single observation, as long as
Grouping()
is used for the grouping variables. The simplified implementation ofGrouping()
also removes several now unnecessaryStatsModels
methods that should not have been called directly by the user. #653
- More informative error message for formulae lacking random effects #651
- Replace separate calls to
copyto!
andscaleinflate!
inupdateL!
withcopyscaleinflate!
#648
- Avoid repeating initial objective evaluation in
fit!
method forLinearMixedModel
- Ensure that the number of function evaluations from NLopt corresponds to
length(m.optsum.fitlog) when
isone(thin)`. #637
- Relax type restriction for filename in
saveoptsum
andrestoreoptsum!
. Users can now pass any type with an appropriateopen
method, e.g.<:AbstractPath
. #628
- Attempt recovery when the initial parameter values lead to an invalid covariance matrix by rescaling #615
- Return
finitial
when the optimizer drifts into a portion of the parameter space that yields a (numerically) invalid covariance matrix #615
- Support transformed responses in
predict
#614 - Simplify printing of BLAS configuration in tests. #597
- Add precompile statements to speed up first
LinearMixedModel
and BernoulliGeneralizedLinearModel
fit #608
- Efficiency improvements in
predict
, both in memory and computation #604 - Changed the explanation of
predict
's keyword argumentnew_re_levels
in a way that is clearer about the behavior when there are multiple grouping variables. #603 - Fix the default behavior of
new_re_levels=:missing
to match the docstring. Previously, the default was:population
, in disagreement with the docstring. #603
- Loosen type restriction on
shortestcovint(::MixedModelBootstrap)
toshortestcovint(::MixedModelFitCollection)
. #598
- Experimental support for initializing
GeneralizedLinearMixedModel
fits from a linear mixed model instead of a marginal (non-mixed) generalized linear model. #588
- Allow constructing a
GeneralizedLinearMixedModel
with constant response, but don't update theL
matrix nor initialize its deviance. This allows for the model to still be used for simulation where the response will be changed before fitting. #578 - Catch
PosDefException
during the first optimization step and throw a more informativeArgumentError
if the response is constant. #578
- Fix type parameterization in MixedModelsBootstrap to support models with a mixture of correlation structures (i.e.
zerocorr
in some but not all RE terms) #577
- Add a constructor for the abstract type
MixedModel
that delegates toLinearMixedModel
orGeneralizedLinearMixedModel
. #572 - Compat for Arrow.jl 2.0 #573
- Add support for storing bootstrap results with lower precision #566
- Improved support for zerocorr models in the bootstrap #570
- Add support for zerocorr models to the bootstrap #561
- Add a
Base.length(::MixedModelsFitCollection)
method #561
- Add support for specifying a fixed value of
σ
, the residual standard deviation, inLinearMixedModel
.fit
takes a keyword-argumentσ
.fit!
does not exposeσ
, butσ
can be changed after model construction by settingoptsum.sigma
. #551 - Add support for logging the non-linear optimizer's steps via a
thin
keyword-argument forfit
andfit!
. The default behavior is 'maximal' thinning, such that only the initial and final values are stored.OptSummary
has a new fieldfitlog
that contains the aforementioned log as a vector of tuples of parameter and objective values.#552 - Faster version of
leverage
forLinearMixedModel
allowing for experimentation using the sum of the leverage values as an empirical degrees of freedom for the model. #553, see also #535 - Optimized version of
condVar
with an additional method for extracting only the conditional variances associated with a single grouping factor. #545
- Drop dependency on
BlockArrays
and use aVector
of matrices to represent the lower triangle in packed, row-major order. The non-exported functionblock
can be used for finding the correspondingVector
index of a block. #456 simulate!
now marks the modified model as being unfitted.- Deprecated and unused
named
argument removed fromranef
#469 - Introduce an abstract type for collections of fits
MixedModelFitCollection
, and makeMixedModelBootstrap
a subtype of it. Accordingly, rename thebstr
field tofits
. #465 - The response (dependent variable) is now stored internally as part of the
the renamed
FeMat
field, now calledXymat
#464 - Replace internal
statscholesky
andstatsqr
functions for determining the rank ofX
bystatsrank
. #479 - Artifacts are now loaded lazily: the test data loaded via
dataset
is downloaded on first use #486 ReMat
andPCA
now support covariance factors (λ
) that areLowerTriangular
orDiagonal
. This representation is both more memory efficient and enables additional computational optimizations for particular covariance structures.#489GeneralizedLinearMixedModel
now includes the response distribution as one of its type parameters. This will allow dispatching on the model family and may allow additional specialization in the future.#490saveoptsum
andrestoreoptsum!
provide for saving and restoring theoptsum
field of aLinearMixedModel
as a JSON file, allowing for recreating a model fit that may take a long time for parameter optimization. #506- Verbose output now uses
ProgressMeter
, which gives useful information about the timing of each iteration and does not flood stdio. Theverbose
argument has been renamedprogress
and the default changed totrue
. #539 - Support for Julia < 1.6 has been dropped. #539
- New
simulate
,simulate!
andpredict
methods for simulating and predicting responses to new data. #427
- It is now possible to construct
RandomEffectsTerm
s at run-time fromTerm
s (methods forBase.|(::AbstractTerm, ::AbstractTerm)
added) #470 RandomEffectsTerm
s can have left- and right-hand side terms that are "non-concrete", andapply_schema(::RandomEffectsTerm, ...)
works more like other StatsModels.jlAbstractTerm
s #470- Methods for
Base./(::AbstractTerm, ::AbstractTerm)
are added, allowing nesting syntax to be used withTerm
s at run-time as well #470
- Add support for NLopt
maxtime
option toOptSummary
#524
- Add support for
condVar
for models with a BlockedSparse structure #523
- Add
condVar
andcondVartables
for computing the conditional variance on the random effects #492 - Bugfix: store the correct lower bound for GLMM bootstrap, when the original model was fit with
fast=false
#518
- Add
likelihoodratiotest
method for comparing non-mixed (generalized) linear models to (generalized) linear mixed models #508.
- Explicitly deprecate vestigial
named
kwarg inranef
in favor ofraneftables
#507.
- Fix MIME show methods for models with random-effects not corresponding to a fixed effect #501.
- The Progressbar for
parametricbootstrap
andreplicate
is not displayed when in a non-interactive (i.e. logging) context. The progressbar can also be manually disabled withhide_progress=true
.#495 - Threading in
parametricbootstrap
now uses aSpinLock
instead of aReentrantLock
. This improves performance, but care should be taken when nesting spin locks. #493 - Single-threaded use of
paramatricbootstrap
now works when nested within a larger multi-threaded context (e.g.Threads.@threads for
). (Multi-threadedparametricbootstrap
worked and continues to work within a nested threading context.) #493
- The value of a named
offset
argument toGeneralizedLinearMixedModel
, which previously was ignored #453, is now handled properly. #482
shortestcovint
method forMixedModelsBootstrap
#484
- HTML and LaTeX
show
methods forMixedModel
,BlockDescription
,LikelihoodRatioTest
,OptSummary
andVarCorr
. Note that the interface for these is not yet completely stable. In particular, rounding behavior may change. #480
- Markdown
show
methods forMixedModel
,BlockDescription
,LikelihoodRatioTest
,OptSummary
andVarCorr
. Note that the interface for these is not yet completely stable. In particular, rounding behavior may change. White-space padding within Markdown may also change, although this should not impact rendering of the Markdown into HTML or LaTeX. The Markdown presentation of aMixedModel
is much more compact than the REPL summary. If the REPL-style presentation is desired, then this can be assembled from the Markdown output fromVarCorr
andcoeftable
#474.
- [experimental] Additional convenience constructors for
LinearMixedModel
#449
- Compatibility updates
rankUpdate!
method forUniformBlockDiagonal
byDense
#447
- Compatibility updates
rankUpdate!
method forDiagonal
byDense
#446- use eager (install-time) downloading of
TestData
artifact to avoid compatibility issues withLazyArtifacts
in Julia 1.6 #444
- Compatibility updates
- Better
loglikelihood(::GeneralizedLinearMixedModel)
which will work for models with dispersion parameters #419. Note that fitting such models is still problematic.
simulate!
and thusparametricbootstrap
methods forGeneralizedLinearMixedModel
#418.- Documented inconsistent behavior in
sdest
andvarest
GeneralizedLinearMixedModel
#418.
- Compatibility updates
- Minor updates for formatting in various
show
method forVarCorr
.
- Nested grouping factors can be written using the
/
notation, as in@formula(strength ~ 1 + (1|batch/cask))
as a model for thepastes
dataset. - The
zerocorr
function converts a vector-valued random effects term from correlated random effects to uncorrelated. (See theconstructors
section of the docs.) - The
fulldummy
function can be applied to a factor to obtain a redundant encoding of a categorical factor as a complete set of indicators plus an intercept. This is only practical on the left-hand side of a random-effects term. (See theconstructors
section of the docs.) Grouping()
can be used as a contrast for a categorical array in thecontrasts
dictionary. Doing so bypasses creation of contrast matrix, which, when the number of levels is large, may cause memory overflow. As the name implies, this is used for grouping factors. #339
- Checks for rank deficiency in the model matrix for the fixed-effects parameters have been improved.
- The distinction between
coef
, which always returns a full set of coefficients in the original order, andfixef
, which returns possibly permuted and non-redundant coefficients, has been made consistent across models.
- The
parametricbootstrap
function and the struct it produces have been extensively reworked for speed and convenience. See thebootstrap
section of the docs.
- The PCA property for
MixedModel
types provides principal components from the correlation of the random-effects distribution (as opposed to the covariance) - Factor loadings are included in the
print
method for thePCA
struct.
- An
AbstractReMat
type has now been introduced to support #380 work on constrained random-effects structures and random-effects structures appropriate for applications in GLM-based deconvolution as used in fMRI and EEG (see e.g. unfold.jl.) - Similarly, a constructor for
FeMat{::SparseMatrixCSC,S}
has been introduced #309. Currently, this constructor assumes a full-rank matrix, but the work on rank deficiency may be extended to this constructor as well. - Analogous to
AbstractReMat
, anAbstractReTerm <: AbstractTerm
type has been introduced #395. Terms created withzerocorr
are of typeZeroCorr <: AbstractReTerm
.
- Several data sets from the literature were previously saved in
.rda
format in thetest
directory and read using theRData
package. These are now available in anArtifact
in theArrow
format #382. - Call
MixedModels.datasets()
to get a listing of the names of available datasets - To load, e.g. the
dyestuff
data, useMixedModels.dataset(:dyestuff)
- Data sets are loaded using
Arrow.Table
which returns a column table. Wrap the call inDataFrame
if you prefer aDataFrame
. - Data sets are cached and multiple calls to
MixedModels.dataset()
for the same data set have very low overhead after the first call.
describeblocks
has been dropped in favor of theBlockDescription
type- The
named
argument toranef
has been dropped in favor ofraneftables