I am trying to work through an example using lmfit from the documentation website:
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from matplotlib.backends.backend_pdf import PdfPages
from lmfit import minimize, Parameters, Parameter, report_fit, Minimizer, conf_interval, conf_interval2d, printfuncs
from lmfit import Model
def main():
def decay(t, N, tau):
return N*np.exp(-t/tau)
decay_model = Model(decay)
print decay_model.independent_vars
for pname, par in decay_model.params.items():
print pname, par
if ___name___ == "___main___":
main()
When I execute the last command, I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Model' object has no attribute 'params'
It seems that params is not an attribute of Model. Can someone explain why this code does not work? I tried this on multiple computers and versions of Python. Running on Python 2.7.9 32 bit, Windows 7.