I am trying to write a code for fitting two data set with two different equation with some shared parameters simultaneously with symfit module. it is too complicated to show it here so I show another code with the same command and simpler. Here I tried to fit a series of data with a linear function but with a gaussian distribution in slope. Here is the code:
`
import symfit as sf
from symfit import parameters, variables, Fit, Model, Ge, CallableModel
from symfit.core.minimizers import BFGS, BasinHopping, NelderMead, DifferentialEvolution
xd= [1.1, 3, 5, 7, 9, 11, 14, 19, 25, 32, 44]
yd= [5.5, 8, 11, 14, 18, 22, 28, 35,45, 69, 110]
pi=3.14
x, y = variables('x, y')
a = sf.Parameter('a',value=3)
b = sf.Parameter('b',value=0.7)
sigma= sf.Parameter('sigma',value=0.7)
res=0
norm=0
for i in range(1,5):
atemp= (a + ((i-1)*3*sigma/2))
gauss= sf.exp(-(atemp-a)**2/(2*(sigma**2)))/sf.sqrt(2*pi*(sigma**2))
res= res+ gauss* (atemp * x + b)
norm= norm + gauss
if i == 4:
firstres= res
firstnorm= norm
res=0
norm=0
funfit = Model({y: (firstres/firstnorm)})
fit = Fit(funfit, x= xd, y=yd, minimizer=[NelderMead, BFGS])
fit_result = fit.execute()
print(" Best-Fit Parameters: ", fit_result)
`
and this is what I got this error "NameError: name 'DiracDelta' is not defined"