Issue with convergence when using PRAXIS

Open
#723 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
data

Research direction

Run the supplied Julia reproducer with MixedModels and compare fit!(model) using :LN_PRAXIS against the working BOBYQA optimizer. Start at the optimizer selection and fitting path for LinearMixedModel, then verify that the PRAXIS run terminates and returns the expected coefficients without manual interruption.

Written by the indexing model from the issue text.

Description

Models that are run with PRAXIS as the optimizer will not terminate. In the simple example below, the model will spin indefinitely but if manually stopped, it will return the expected coefficients. BOBYQA works correctly in this case.

Version Info:

Julia Version 1.9.1
Commit 147bdf428cd (2023-06-07 08:27 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, westmere)
  Threads: 1 on 10 virtual cores
Environment:
  JULIA_PROJECT = /Users/liam/Development/attribution-engine/ma-model/SignConstrainedMixedModels

Example code:

using MixedModels, DataFrames, Random

# Arrange
id1 = Int[1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4]
var1 = Float64[
    -0.968,
    -1.568,
    -4.101,
    2.616,
    2.658,
    1.352,
    3.836,
    -0.234,
    -1.257,
    -0.482,
    3.810,
    -2.812,
    1.382,
    -4.764,
    3.977,
    1.302,
    2.186,
    -4.237,
    4.803,
    -1.026,
]
var2 = Float64[
    2.633,
    2.565,
    2.685,
    2.661,
    0.048,
    1.285,
    2.127,
    1.687,
    1.542,
    0.932,
    1.650,
    2.239,
    0.239,
    0.247,
    0.989,
    1.800,
    0.667,
    1.412,
    2.497,
    2.004,
]
var3 = Float64[
    -4.805,
    -4.048,
    -2.160,
    -0.233,
    -2.655,
    -2.062,
    -0.395,
    -2.706,
    -3.509,
    -2.800,
    -2.927,
    -1.843,
    -2.401,
    -3.332,
    -1.413,
    -4.351,
    -4.917,
    -0.977,
    -0.303,
    -1.072,
]
vol = [
    0.25 * var1[1:5] + 0.3 * var2[1:5] + -0.6 * var3[1:5]
    0.15 * var1[6:10] + 0.3 * var2[6:10] + -0.6 * var3[6:10]
    0.05 * var1[11:15] + 0.3 * var2[11:15] + -0.6 * var3[11:15]
    -0.05 * var1[16:20] + 0.3 * var2[16:20] + -0.6 * var3[16:20]
]

noise = rand(MersenneTwister(5234325), size(vol, 1))
vol = vol .+ noise
data = DataFrames.DataFrame(id1 = id1, var1 = var1, var2 = var2, var3 = var3, vol = vol)

f = @formula(vol ~ 1 + var1 + var3 + var2 + (0 + var1 | id1))

model = LinearMixedModel(f, data)
model.optsum.optimizer = :LN_PRAXIS
model_fit = fit!(model)
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaStats/MixedModels.jl

All issues in JuliaStats/MixedModels.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.