Skip to content

Instantly share code, notes, and snippets.

@yoavram
Created March 31, 2015 09:24
Show Gist options
  • Select an option

  • Save yoavram/3890c2d169b591172ab2 to your computer and use it in GitHub Desktop.

Select an option

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
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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