Hello there, the question is in the title. I am attempting to make a procedure that will fit a user defined function, namely, a modified Error Function, to a piece of data, and then take the fitted coefficients, plug them into the equation of the Erf and get a nice smooth fit graph.
wave coeffs
Coeffs[0]=(v_max)/2 //these coeffs are the initial guesses
Coeffs[1]=v_max
Coeffs[2]=numpnts(fittederf)/2
Coeffs[3]=numpnts(fittederf)/4
variable m=0
Funcfit/q ErrorFunction,Coeffs,FittedErf //fitting command with proper locations of waves
Make/o/n=(numpnts(fittederf)*10) SmoothERF= Coeffs[0]+Coeffs[1]*(Erf((Coeffs[2]-(x/10))/(Abs(Coeffs[3])*sqrt(2))) //making a new wave with 10x points, but overall same domain
My issue is that i believe the coefficients that i am using above to define SmoothERF are just my initial guesses, not the properly fit ones. I was under the impression that a wave called W_coef would be created with the correct fit coefficients. This is what other posts say, and i have experienced it with the curvefit function, AND when i use this fit function from the Analysis>curvefitting tab, W_coef will be created with best-fit coefficients. I'm sure I am missing something obvious here, but does anyone have a suggestion on this?
Also, unless i do the second part where i put the function there, it doesn't output anything...
June 26, 2018 at 04:32 pm - Permalink
June 26, 2018 at 04:55 pm - Permalink
June 27, 2018 at 11:22 am - Permalink