Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a progress meter for LMM fits #539

Merged
merged 23 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6ff3027
Add a progress meter for LMM fits
dmbates Jul 7, 2021
dbf1c09
Remove unnecessary iteration counter
dmbates Jul 7, 2021
8e38b17
require at least julia 1.6
palday Jul 8, 2021
e8d0030
Add progress meter for GLMMs. Change format.
dmbates Jul 8, 2021
cbd6908
Rename verbose to progress, change default to true
dmbates Jul 9, 2021
5696c91
Expand on NEWS entry for #539
dmbates Jul 10, 2021
8c3ddff
Back-out changes to compat for ProgressMeter
dmbates Jul 10, 2021
b002ad2
Update src/generalizedlinearmixedmodel.jl
dmbates Jul 12, 2021
4c1adcf
Update src/generalizedlinearmixedmodel.jl
dmbates Jul 12, 2021
20807e7
Add progress arg to refit! with default of false.
dmbates Jul 12, 2021
5a31117
progress=false in fits; model_response -> response
dmbates Jul 12, 2021
c602e67
Missed one `progress=false` change
dmbates Jul 12, 2021
e15dd1c
ProgressMeter compat bump (needed for showspeed)
palday Jul 12, 2021
bf56ca2
kwargs... for refit!
palday Jul 12, 2021
7cabb81
simplify second method
palday Jul 12, 2021
a9d984a
fix tests for latent floating point issue
palday Jul 12, 2021
55a6d38
remove debug code
palday Jul 12, 2021
39c3d0c
pass progress=false in refit! in tests
dmbates Jul 12, 2021
0ee090f
More cases of adding progress=false in refit! call
dmbates Jul 13, 2021
384af96
add progress=false in more fit and refit! calls
dmbates Jul 13, 2021
8902b55
yet another progress=false
dmbates Jul 13, 2021
1222a51
disable single-model progress in bootstrap
palday Jul 13, 2021
491a4d1
whack-a-mole + ; before kwargs
palday Jul 13, 2021
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ JSON3 = "1"
LazyArtifacts = "1"
NLopt = "0.5, 0.6"
PooledArrays = "0.5, 1"
ProgressMeter = "1.5"
ProgressMeter = "1.5, 1.6, 1.7"
palday marked this conversation as resolved.
Show resolved Hide resolved
StaticArrays = "0.11, 0.12, 1"
StatsBase = "0.31, 0.32, 0.33"
StatsFuns = "0.8, 0.9"
Expand Down
3 changes: 3 additions & 0 deletions src/linearmixedmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -397,15 +397,18 @@ function fit!(m::LinearMixedModel{T}; verbose::Bool = false, REML::Bool = false)
end
opt = Opt(optsum)
optsum.REML = REML
prog = ProgressUnknown(; showspeed=true)
function obj(x, g)
isempty(g) || throw(ArgumentError("g should be empty for this objective"))
val = objective(updateL!(setθ!(m, x)))
ProgressMeter.next!(prog; showvalues = [(:objective, val),])
verbose && println(round(val, digits = 5), " ", x)
palday marked this conversation as resolved.
Show resolved Hide resolved
val
end
NLopt.min_objective!(opt, obj)
optsum.finitial = obj(optsum.initial, T[])
fmin, xmin, ret = NLopt.optimize!(opt, copyto!(optsum.final, optsum.initial))
ProgressMeter.finish!(prog)
## check if small non-negative parameter values can be set to zero
xmin_ = copy(xmin)
lb = optsum.lowerbd
Expand Down