Created
March 31, 2015 09:24
-
-
Save yoavram/3890c2d169b591172ab2 to your computer and use it in GitHub Desktop.
A reproducible bug in lmfit with ipython - see https://github.com/lmfit/lmfit-py/issues/221
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from numpy import * | |
| from numpy.random import normal | |
| from scipy import stats | |
| from lmfit import Model | |
| N = 100 | |
| t = linspace(0,1,N) | |
| a,b = 0,0 | |
| f = lambda t,a,b: b + exp(-a*t) | |
| data = f(t,a,b) + normal(0,0.1,N) | |
| model = Model(f) | |
| params = model.make_params(a=1,b=2) | |
| model_fit = model.fit(data, t=t, params=params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment