How to define goodness of fit in curve_fit()?

537 Views Asked by At

Hello guys I have used "curve_fit()" to fit my data to voigt function in the following way:

def voigt(x,a,m,s,g):
    z = (x-m+complex(0,g))/(s*math.sqrt(2))
    d = wofz(z)
    return (a*d.real)/(s*math.sqrt(2*pi))

popt, pcov = curve_fit(voigt, xval, yval, bounds=([0,25,0,0.012], [99,37., 0.01, 2.5]), maxfev =10000)

I need to calculate how god is my fit with the data I obtained, How can I achieve this?

0

There are 0 best solutions below