varpro 0.6: Fast and Simple Nonlinear Fitting
Hey all, I've been working on this for a couple of years https://crates.io/crates/varpro. It's a library for nonlinear fitting in Rust that uses a lesser known algorithm called variable projection to speed up the fitting process of a particular class of problems, i.e. if your fitting function can be written as a linear combination of nonlinear functions. I've written a blog post on the math of varpro a while ago if you are interested in that sort of thing.
I know this is a niche use case and I am happy if people check it out and see if it suits their fitting problems. I've made it very simple to get started with the crate by implementing a builder API that let's you describe your fitting function very intuitively. For maximum performance I also allow handcrafting the models by implementing a trait of this crate, which is a recent addition in today's release.
Rough Benchmarking Results on My Machine (TM)
Problem: Fitting a double exponential decay with constant offset to 1024 data points.
Without varpro (using a purely nonlinear optimization): 3184 us
With varpro (builder): 996 us
With varpro (trait): 846 us