FuncFit flag /E does not set the epsilon wave, is there other way?

I have the code pasted below in the body of this post and will also attach a file.

With the code copied to my clipboard:

• In a new pxp file, do ctrl+M for the procedure window, ctrl+A to select whatever is in that window, and ctrl+V to paste the code.

• ctrl+J to bring up the command window, then type "myFitCall()", without quotes, and hit enter.

The errors in the fit coefficients are not put in coef_sig, they are put into the default W_sigma.

I then try using the Curve Fitting Dialog via Analysis>Curve Fitting. When I fill out the form and click "To Cmd Line", the following is pasted to the command line: 

FuncFit myFit guessCoef ywv /X=xwv /W=ywvErr /I=1 /D=myFitWv /E=coef_sig 

Again, coef_sig does not hold the errors in the coefficients

Is the way to direct the coefficient epsilon values different than using the /E flag?

#pragma TextEncoding = "UTF-8"
#pragma rtGlobals=3     // Use modern global access method and strict wave access.


Function myFit( coef, x ) : FitFunc

    //CurveFitDialog/
    //CurveFitDialog/ Coefficients 2
    //CurveFitDialog/ coef[0] = a
    //CurveFitDialog/ coef[1] = b
   
    Wave coef ;
    Variable x ;
    return coef[0] + coef[1] * x^1.1
   
End

Function myFitCall(  )
   
    Make/O/N=5 xwv = {1,2,3,4,5}, ywv = {1.1, 4.1, 5.9, 7.8, 10.3} ;
    Make/O/N=5 ywvErr = {0.1, 0.01, 0.2, 0.11, 0.15};
    Wave ex = xwv, wy = ywv, err = ywvErr ;
   
    Make/O/N=2 guessCoef = { 0, 2 };
    Make/O/N=2 coef_sig;
   
    wave guess = guessCoef;
    wave coef_err = coef_sig;
   
    Make/O/N=5 myFitWv
   
    FuncFit/X=1/H="00" myFit guess wy /X=ex /W=err /I=1 /D=myFitWv /E=coef_sig
   
End

 

MinimalCodeFor_EFlagDoesNotSetEpsilonWave_ForumQuestion.pxp

I think there is a misunderstanding here: epsilon value != error output. Thus, the /E flag provides a distinct input, not an output. To explain what epsilon values are for, I'll cite the manual:

Each epsilon value is used to calculate partial derivatives with respect to the fit coefficients. The partial derivatives are used to determine the search direction for the coefficients that give the smallest chi-square.

Thus, adding '/E=coef_sig' is not helpful, since 'coef_sig' is not properly defined. I think you also don't want to mess with the epsilon values here.

If you are asking how to redirect the standard W_sigma into another wave, this is not possible (as far as I know) with FuncFit itself. You would need to refer to W_sigma, and manually write the result into your 'coef_sig' wave after the fact. So yeah, FuncFit and CurveFit are limited in this regard. I also had to work around redirecting the standard 'fit_xxx' output to a different wave after the fit. This is not so difficult, but I agree that it would be nice to designate the destination with a flag.

Yes, a way to redirect W_sigma output to your own wave would be nice. But CurveFit and FuncFit are so unwieldy with lots of complicated flags at the beginning and at the end that I resist adding more. You should see the code that parses those commands... Looking at might take years off your life!