Non-Linear Least Squares Minimization, with flexible Parameter settings, based on scipy.optimize, and with many additional classes and methods for curve fitting.
I think removing any state or reference to specific params from Model would actually be only a small change. Here's an sketch of how the API would shake out, expanding on remarks in #106.
result = model.fit(data, params) # or keyword args, as now
# As now, the result stores certain useful copies of the params.
# These can be examined by the user or passed back into model.fit() later.
result.params
result.init_params
# Add this:
result.eval(x=x) # any x, perhaps denser for prettier curve
model.eval() # NOT VALID -- supplanted by `result.eval()`
model.eval(some_params) # valid -- useful for exploring the model
The only downside of this is, as mentioned in #106, is less succinct auto-guessing. I kind of like this though -- it makes it clear what the model is using and makes it easy for the user to examine the auto-guessed parameters as needed.
guess = model.guess_starting_values(data) # rename this method guess() for brevity?
model.fit(data, params=guess)
I agree we should take our time with this and collect input. I'm just jotting this down while it's on my mind.
I think removing any state or reference to specific params from
Model
would actually be only a small change. Here's an sketch of how the API would shake out, expanding on remarks in #106.The only downside of this is, as mentioned in #106, is less succinct auto-guessing. I kind of like this though -- it makes it clear what the model is using and makes it easy for the user to examine the auto-guessed parameters as needed.
I agree we should take our time with this and collect input. I'm just jotting this down while it's on my mind.