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

Proposal: Add more verbose interface #233

Open
MrHenning opened this issue Nov 22, 2022 · 3 comments
Open

Proposal: Add more verbose interface #233

MrHenning opened this issue Nov 22, 2022 · 3 comments

Comments

@MrHenning
Copy link

MrHenning commented Nov 22, 2022

I am a big fan of both LsqFit.jl and the python package LMFIT.

I made a small wrapper-interface for LsqFit.jl to implement the Parameter functionality of LMFIT, to make the definition of fit-parameters more verbose (e.g. setting min/max values, and toggle if the parameter should be varied),
and maybe other people are interested to use something like this.

Is there any interest to add this interface to LsqFit? Or maybe create a dedicated julia-package?

I use it a follows:

using LMFit

f = 2.45
φ = 0.8
model(x, f, φ) = sin.(x .* f .+ φ)

x = 0:0.1:6pi
y = model(x, f, φ) .+ 0.04 .* randn(length(x))

params = [
    Param(name=, value=0.9, min=0, max=255, vary=true),
    Param(name=:f, value=2.5, min=0, max=255, vary=true),
]

out = curve_fit(model, x , y, params)
@info fitreport(out)
┌ Info: [[Variables]]
│       f:  2.449846120404491  ± 0.0007845311171137703 ( 0.03%) (init = 2.5)
└       φ:  0.7936258619873663 ± 0.008547481398733708  ( 1.08%) (init = 0.9)

I'm happy with any decision 🙂

@garrekstemo
Copy link

I also miss the reports and models with parameters in LMFIT

@pkofod
Copy link
Member

pkofod commented Jun 13, 2023

I see. So you would like to be able to define individual parameters, their domain, and whether they should be optimized or not, rather than just a vector?

@MrHenning
Copy link
Author

Yes indeed, I find it useful for prototyping or when I am testing several (slightly different) model.

On the other hand, I came across GModelFit which has similar functionality (see example) which uses LsqFit.jl as a base.
Maybe this is the cleaner option...
(I haven't used GModelFit yet though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants