Comments (5)
As an update, Minimize
has now been reintroduced, wrapping scipy.optimize.minimize
. This can now be used to take over fitting in the near feature, although the option for MINPACK should still be there given it's popularity. Potentially use MINPACK when no bounds are given, and Minimize
when there are.
from symfit.
from symfit.
I'm setting up my model in the following way (python 2.7):
a1 = Parameter(name='a1', value=200, min=0, max=1000)
a2 = Parameter(name='a2', value=300, min=0, max=2000)
a3 = Parameter(name='a3', value=400, min=0, max=2000)
b = Parameter(name='b', value=200, min=0, max=500)
t1 = Parameter(name='t1', value=0.0001, min=0)
t2 = Parameter(name='t2', value=0.07, min=0)
t3 = Parameter(name='t3', value=1., min=0)
t = Variable(name='t')
model = a1*exp(-t/t1) + a2*exp(-t/t2) + a3*exp(-t/t3) + b
This gives some warnings:
C:\Python27\lib\site-packages\symfit\core\fit.py:45: RuntimeWarning: invalid value encountered in sqrt
stdevs = np.sqrt(np.diagonal(pcov))
I didnt get the warning in symfit 0.2.5, i do in 0.3.5. The warning goes away when adding upper bounds to the tx parameters. Is it no longer allowed to specify only left bound?
from symfit.
Could you try to run your fitting with the NumericalLeastSquares
and ConstrainedNumericalLeastSquares
objects directly? My prediction: you have this problem only with the latter, which is used by Fit
by default for bounded problems since 0.3.5.
If true, could you explicitely set your upper bound to None
for ConstrainedNumericalLeastSquares
?
t1 = Parameter(name='t1', value=0.0001, min=0, max=None)
I guess there might be a difference in syntax between the two wrapped scipy methods.
from symfit.
Your prediction is correcct, when I use NumericalLeastSquares
directly I don't get warnings or error message in the fit result report. I do get a warning when I sueConstraintNumericalLeastSquares
;
C:\Python27\lib\site-packages\scipy\optimize\slsqp.py:338: RuntimeWarning: invalid value encountered in greater
bnderr = where(bnds[:, 0] > bnds[:, 1])[0]
Fitting error: Fitting status message: Inequality constraints incompatible
. This is a different error than I originally reported. I might have changed something, cant find what it is. Setting max=None
doenst fix anything.
When I configure the parameters in the following way:
a1 = Parameter(name='a1', value=200, min=0, max=1000)
a2 = Parameter(name='a2', value=300, min=0, max=2000)
a3 = Parameter(name='a3', value=400, min=0, max=2000)
b = Parameter(name='b', value=200, min=0, max=500)
t1 = Parameter(name='t1', value=0.0001, min=0, max=1000)
t2 = Parameter(name='t2', value=0.07, min=0, max=1000)
t3 = Parameter(name='t3', value=1., min=0, max=100)
I dont get the warning, but I do get Fitting status message: Inequality constraints incompatible
. Either I'm stupid and I've chose the guess outside of the bounds (but I dont see where) or its not related to only specifing left bound. No bounds = No problems. The fitting acutally works quite well even with mediocre guesses, and works but slow with poor guesses.
from symfit.
Related Issues (20)
- `tests/test_minimizers.py::test_multiprocessing` fails on i386 HOT 1
- sympy expression with arbitrary variables/parameters HOT 8
- Fitting custom model resulted using sympy HOT 15
- Unknown issue with super(type, obj) in fit.py HOT 3
- "Abnormal Termination in LNSRCH" Error HOT 2
- Create a Model from a constant expression returns an error HOT 2
- Model evaluation problems encountered after several derivations HOT 6
- Initial values used don't match those declared HOT 3
- Symfit errors - not fitting to data HOT 1
- Parameter and Variable shapes
- Models should be recursive
- Symbolic objectives
- Numba integration HOT 3
- No compatible with numpy 1.24.1 HOT 8
- Sensitivity of Fit's slope/max values to model parameters HOT 1
- Perform global sensitivity analysis of ODE system HOT 1
- Initial conditions for different values of independent variable HOT 2
- symfit special functions, exponential integral HOT 13
- Fitting multidimensional datasets - symfit HOT 1
- AttributeError: 'Model' object has no attribute '_cached_numerical_components'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symfit.