Bumps provides data fitting and Bayesian uncertainty modeling for inverse problems. It has a variety of optimization algorithms available for locating the most like value for function parameters given data, and for exploring the uncertainty around the minimum.
Installation is with the usual python installation command:
pip install bumps
Once the system is installed, you can verify that it is working with:
bumps doc/examples/peaks/model.py --chisq
Documentation is available at readthedocs
If a compiler is available, then significant speedup is possible for DREAM using:
(cd bumps/dream && cc compiled.c -I ../../Random123/include/ -O2 -fopenmp -shared -lm -o _compiled.so -fPIC)
For now this requires an install from source rather than pip.
- fixed issues with numpy > = 2.0 (see #140, numpy.NaN deprecated and removed)
- fixed issues with refactor of scipy.stats (see #139)
- added testing for python 3.12
- fixed issue with matplotlib >= 3.8.0 (see #129)
- added missing documents to dream manual (Convergence tests, Parallel coordinates plot)
- added numba.njit-accelerated fallback bounds.apply methods to dream (still uses compiled C DLL if available)
- provide MAX_CORR attribute on the CorrelationView; clear the figure if the number of variables exceeds MAX_CORR
- added support for python 3.11, scipy 1.10, numpy 1.24, wx 4.1.1
- fixed covariance calculation for n-D datasets
- fixed batch mode I/O redirection cleanup
- fixed issue with DREAM bounds checker when running in parallel
- default to single precision derivatives with lm (fixes issue in SasView where OpenCL models failed with Levenberg-Marquardt)
- improved support for repeat fitting within scripts and notebooks (start_mapper should now work after stop_mapper)
- use MPFit in place of scipy.leastsq for bounds-constrained Levenberg-Marquardt
Breaking change: * simultaneous fit now scales individual nllfs by squared weight rather than weight
- "apply parameters" action added to GUI menu (does the same as --pars flag in CLI)
- operators refactored (no more eval)
- BoundedNormal keywords renamed (sigma, mu) -> (std, mean)
- support for numba usage in models
- fixed Parameters view jumping to top after toggling fit (linux, Mac)
- fixed Summary view sliders disappearing in linux
- fixed uncertainty plots regenerating at each parameter update
- improved documentation of uncertainty analysis
Breaking change: * python 2.7 support discontinued
- add stopping conditions to DREAM, using --alpha=p-value to reject convergence
- require --overwrite or --resume when reusing a store directory
- enable outlier trimming in DREAM with --outliers=iqr
- add fitted slope and loglikelihood distribution to the loglikelihood plot
- display seed value used for fit so it can be rerun with --seed
- save MCMC files using gzip
- remove R stat from saved state
- restore --pars option, which was broken in 0.7.17
- terminate the MPI session when the fit is complete instead of waiting for the allocation to expire
- allow a series of fits in the same MPI session
- support newest matplotlib
- restore python 2.7 support
- restore DREAM fitter efficiency (it should now require fewer burn-in steps)
- errplot.reload_errors allows full path to model file
- clip values within bounds at start of fit so constraints aren't infinite
- allow --entropy=gmm|mvn|wnn|llf to specify entropy estimation algorithm
- allow duplicate parameter names in model on reload
- expand tilde in path names
- GUI: restore parallel processing
- GUI: suppress uncertainty updates during fit to avoid memory leak
- disable broken fitters: particle swarm, random lines, snobfit
- minor doc changes
- improved handling of parameters for to_dict() json pickling
- parallel fitting suppressed in GUI for now---need to reuse thread pool
- support limits=(min, max) for pm and pmp parameter ranges
- cleaner handling of single/multiple fit specification
- fix --entropy command line option
- better support for pathlib with virtual file system
- support for --checkpoint=n, which updates the .mc files every n hours
- fix bug for stuck fits on --resume: probabilities contain NaN
- better error message for missing store directory
- Python 3.8 support (time.clock no longer exists)
- fix pickle problem for parameterized functions
- support multi-valued functions in Curve, shown with a coupled ODE example
- update support for newer numpy and matplotlib
- --parallel defaults to using one process per CPU.
- --pop=-k sets population size to k rather than k times num parameters
- --resume=- resumes from --store=/path/to/store
- use expanded canvas for parameter histograms to make plots more readable
- use regular spaced tics for parameter histograms rather than 1- and 2-sigma
- improve consistency between values of cov, stderr and chisq
- fix handling of degenerate ranges on parameter output
- add entropy calculator using gaussian mixture models (default is still Kramer)
- vfs module allows loading of model and data from zip file (not yet enabled)
- warn when model has no fitted parameters
- update mpfit to support python 3
- support various versions of scipy and numpy
- add support for parameter serialization
- restructure parameter table in gui
- full support for python 3 in wx GUI
- allow added or missing parameters in reloaded .par file
- add dream state to return from fit() call
- fix source distribution (bin directory was missing)
- merge in amdahl branch for improved performance
- update plot so that the displayed "chisq" is consistent with nllf
- slight modification to the DREAM DE crossover ratio so that no crossover weight ever goes to zero.
- par.dev(std) now uses the initial value of the parameter as the center of the distribution for a gaussian prior on par, as stated in the documentation. In older releases it was incorrectly defaulting to mean=0 if the mean was not specified.
- save parameters and uncertainties as JSON as well as text
- convert discrete variables to integer prior to computing DREAM statistics
- allow relative imports from model files
- support latest numpy/matplotlib stack
- initial support for wxPhoenix/python 4 GUI (fit ranges can't yet be set)
- add --view option to command line which gets propagated to the model plotter
- add support for probability p(x) for vector x using VectorPDF(f,x0)
- rename DirectPDF to DirectProblem, and allow it to run in GUI
- data reader supports multi-part files, with parts separated by blank lines
- add gaussian mixture and laplace examples
- bug fix: plots were failing if model name contains a '.'
- miscellaneous code cleanup
- gui: undo code cleaning operation which broke the user interface
- population initializers allow indefinite bounds
- use single precision criterion for levenberg-marquardt and bfgs
- implement simple, faster, less accurate Hessian & Jacobian
- compute uncertainty estimate from Jacobian if problem is sum of squares
- gui: fit selection window acts like a dialog
- accept model.par output from a different model
- show residuals with curve fit output
- only show correlations for selected variables
- show tics on correlations if small number
- improve handling of uncertainty estimate from curvature
- tweak dream algorithm -- maybe improve the acceptance ratio?
- allow model to set visible variables in output
- improve handling of arbitrary probability density functions
- simplify loading of pymc models
- update to numdifftools 0.9.14
- bug fix: improved handling of ill-conditioned fits
- bug fix: avoid copying mcmc chain during run
- bug fix: more robust handling of --time limit
- bug fix: support newer versions of matplotlib and numpy
- miscellaneous tweaks and fixes
- add entropy calculator (still unreliable for high dimensional problems)
- adjust scaling of likelihood (the green line) to match histogram area
- use --samples to specify the number of samples from the distribution
- mark this and future releases with a DOI at zenodo.org
- tweak uncertainty calculations so they don't fail on bad models
- documentation updates
- use relative rather than absolute noise in dream, which lets us fit target values in the order of 1e-6 or less.
- fix covariance population initializer
- use --time to stop after a given number of hours
- Levenberg-Marquardt: fix "must be 1-d or 2-d" bug
- improve curvefit interface
- pull numdifftools dependency into the repository
- improve the load_model interface
- Pure python release