Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a2cbbae
write up on gradients
palday Dec 29, 2025
b55d622
slight optimization of gradient computation
palday Dec 29, 2025
4aa750e
kb07
palday Dec 29, 2025
2765eef
Spelling mistakes?
dmbates Dec 30, 2025
6440274
Still not passing tests. In write-up made method comparisons fairer.
dmbates Dec 30, 2025
16cbd8e
test fix
palday Dec 30, 2025
f184c88
methods for HessianConfig and hessian!
palday Dec 30, 2025
8e8ee85
format
palday Dec 30, 2025
072bd5d
NEWS
palday Dec 30, 2025
03009d1
oops
palday Dec 30, 2025
0bfd467
docs fix: AoG update
palday Dec 30, 2025
463a7d6
Add information on gradient evaluation
dmbates Jan 3, 2026
ab0a7cb
Short-cut method of gradient evaluation
dmbates Jan 6, 2026
269826e
merge
palday Jan 6, 2026
2e8ac37
Partial gradient for vector-valued r.e.'s
dmbates Jan 9, 2026
37be044
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into db/p…
palday Jan 13, 2026
cfba091
Expand docs, start src/gradient.jl
dmbates Jan 14, 2026
637917a
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into db/p…
palday Jan 15, 2026
ad2cb99
Initial, clunky version of blocked grad eval.
dmbates Jan 23, 2026
afc23c6
Update document on gradient evaluation.
dmbates Jan 24, 2026
8f3981e
Fixed, I hope, the initialization of the gradient blocked matrix
dmbates Jan 25, 2026
89ba9cd
Formatting changes
dmbates Jan 25, 2026
aa54be8
Update gradient code and documents
dmbates Feb 2, 2026
b05b788
Adjust tests on gradient
dmbates Feb 3, 2026
a2f9e31
Expand exploration of gradient methods
dmbates Feb 3, 2026
ca8d1a9
Baseline code before correcting gradient! evaluation
dmbates Feb 23, 2026
0304ff8
Merge branches 'db/pa/gradient' and 'main' of github.com:JuliaStats/M…
palday Mar 9, 2026
e62ff21
Prior to lmul -> rmul change
dmbates Mar 17, 2026
93c4df1
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into db/p…
palday Jul 6, 2026
39814f1
Efficient analytic gradient of the LMM objective + LD optimizers
palday Jul 6, 2026
7ec10ff
Scale the objective per observation for gradient-based optimizers
palday Jul 6, 2026
9203f0a
BLAS-3 cross-term for dense-fill scalar-crossed gradients
palday Jul 6, 2026
54dc29b
Test the BLAS-3 cross-term kernel and gated path
palday Jul 7, 2026
10fbbaf
helper method
palday Jul 8, 2026
5faa052
format
palday Jul 8, 2026
2dca4ea
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into pa/g…
palday Jul 9, 2026
add6453
BlueStyle
palday Jul 9, 2026
f4ac460
Merge branch 'db/pa/gradient' of https://github.com/JuliaStats/MixedM…
dmbates Jul 9, 2026
e0d04be
Reuse core linear algebra in the ForwardDiff extension
palday Jul 11, 2026
e3b24c9
Add a gradient-source option for gradient-based optimizers
palday Jul 11, 2026
1a16ae3
Benchmark script for analytic vs ForwardDiff gradient-based fits
palday Jul 11, 2026
d694ffe
Merge branch 'db/pa/gradient' into pa/gradient-fable
palday Jul 11, 2026
ceb0d0b
regression test
palday Jul 12, 2026
05c2f90
Structure-mirroring gradient workspace
palday Jul 12, 2026
5e7dc54
Address gradient-workspace review findings
palday Jul 12, 2026
bc4108c
Blue
palday Jul 12, 2026
ae84fc0
definitely a feature
palday Jul 21, 2026
17e92f9
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into pa/g…
palday Jul 21, 2026
beec514
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into db/p…
palday Jul 21, 2026
402654c
Merge branch 'db/pa/gradient' of github.com:JuliaStats/MixedModels.jl…
palday Jul 21, 2026
6b634ee
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into db/p…
palday Jul 24, 2026
856ff20
unwrap
palday Jul 24, 2026
981c20a
test fix
palday Jul 24, 2026
fcafd7b
Merge branch 'db/pa/gradient' into pa/gradient-fable
palday Jul 24, 2026
f270acb
blue
palday Jul 24, 2026
f6ad702
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into pa/g…
palday Aug 10, 2026
a9cdca0
Statically sized face and block kernels for the gradient
palday Aug 10, 2026
90d6a53
add CLAUDE.md
palday Aug 10, 2026
281b12d
gradient benchmark file
palday Aug 10, 2026
a660065
Comprehensive comparison of the optimizers available for a `LinearMix…
palday Aug 11, 2026
cb56ff6
notes
palday Aug 11, 2026
03ff7c0
more timing info
palday Aug 11, 2026
7a9e393
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into pa/g…
palday Aug 12, 2026
4d891ed
Merge branch 'main' of github.com:JuliaStats/MixedModels.jl into pa/g…
palday Aug 18, 2026
bd5216c
tolerance tweak
palday Aug 18, 2026
bfbbba9
Loosen compat bounds on MixedModelsSerialization
dmbates Aug 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Understanding tasks

Feel free to ask questions.

Do not assume that requested tasks are possible: feel free to inform me that a requested task is not possible in the given form or that there are only tedious workarounds.

# Julia development

Explicit `return` statements are required and the use of `import` is forbidden.

When running tests in Julia, you need to load the test environment. For interactive/REPL use, do this with `using TestEnv; TestEnv.activate()`. When using `Pkg.test()`, do not activate the test environment first — it manages that itself.

Always invoke Julia with `--startup-file=no` unless explicitly instructed otherwise.

You may invoke a specific Julia version with `+VERSION`, e.g. `+1.10` or `+1.12`. This argument must come immediately after `julia` and before any other flags.
If you are not testing something particular to a specific Julia version, use the minimum compatible version (as specified in Project.toml).

When checking coverage, you can use LocalCoverage.jl, which writes coverage to `coverage/lcov.info`.
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
MixedModels vX.Y.Z Release Notes
==============================
- Additional methods for pre-allocated result arrays and `*Config` instances have been added to the ForwardDiff extension. [#871].
- New exported function `objective_gradient!` evaluating the analytic gradient of the objective of a `LinearMixedModel` (ML and REML, including fixed `σ`) directly from the blocked Cholesky factor. It is much faster and allocates far less than automatic differentiation via the ForwardDiff extension, especially for models with many covariance parameters.
- The NLopt backend now supports the gradient-based optimizers `:LD_LBFGS`, `:LD_MMA`, and `:LD_SLSQP` for `LinearMixedModel`, using `objective_gradient!`. The default optimizer remains derivative-free `:LN_NEWUOA`; select a gradient-based one with e.g. `fit(MixedModel, form, data; optimizer=:LD_LBFGS)`. Internally the gradient-based optimizers work on a per-observation scaling of the objective, which keeps line searches well behaved for large data sets; `fitlog`, the progress display, and the reported `fmin` remain on the deviance scale, and `ftol_abs` acts as a per-observation tolerance for these optimizers.
- The gradient source for gradient-based optimizers can be selected with the new `gradient` keyword argument to `fit`/`fit!` (stored in `OptSummary`): the default `:analytic` uses `objective_gradient!`, while `:forwarddiff` uses forward-mode automatic differentiation and requires that ForwardDiff.jl be loaded. The `:forwarddiff` source reuses a cached, dual-valued copy of the model's numerical fields across evaluations.
- The per-face and per-block arithmetic in `objective_gradient!` is now unrolled into statically sized kernels for term dimensions up to 4, instead of issuing a `mul!` per face or per nonzero block. Those products are at most 4×4, far too small to amortize a BLAS call, so the dispatch and setup dominated the handful of flops. Gradient evaluation is roughly 1.6× faster on `d3` with vector-valued terms, 1.8× with scalar terms, 1.1× on the maximal `kb07` model, and 3× on small nested models; models dominated by the large triangular solves in `L⁻¹`, such as `insteval`, are unchanged. Accumulating each face in registers and writing back once reorders the additions, so gradient components change in the last few bits.
- The ForwardDiff extension has been reworked to reuse the core linear-algebra routines (which have gained generic fallback methods for element types without BLAS/LAPACK support) instead of maintaining parallel `fd_*` implementations. The objective it differentiates now profiles `σ` (or holds it at `optsum.sigma` when fixed), matching `objective`, so `ForwardDiff.gradient` and `ForwardDiff.hessian` now refer to the profiled objective; the Hessian of a model fitted with a fixed `σ` is now computed at that fixed value. `fd_deviance` also now includes the constant weights term for weighted models, matching `objective`.
MixedModels v5.8.3 Release Notes
==============================
- JSON backend for `saveoptsum` and `restoreoptsum!` has been changed from JSON3.jl to JSON.jl. [JSON3.jl has been deprecated in favor of JSON.jl](https://github.com/quinnj/JSON3.jl/blob/08b5f48d25ab596c5441969ee83d56f9b9c5b704/README.md). As a result, the dependency on `StructTypes.jl` has also been dropped. [#897]
Expand Down Expand Up @@ -784,6 +792,7 @@ Package dependencies
[#864]: https://github.com/JuliaStats/MixedModels.jl/issues/864
[#865]: https://github.com/JuliaStats/MixedModels.jl/issues/865
[#867]: https://github.com/JuliaStats/MixedModels.jl/issues/867
[#871]: https://github.com/JuliaStats/MixedModels.jl/issues/871
[#873]: https://github.com/JuliaStats/MixedModels.jl/issues/873
[#875]: https://github.com/JuliaStats/MixedModels.jl/issues/875
[#876]: https://github.com/JuliaStats/MixedModels.jl/issues/876
Expand Down
Loading
Loading