Global Fit Package not calculating residuals properly

I am using the Global Fit Package to globally fit several traces to a User-Defined Function. It seems that the residuals waves are not being calculated properly.

In the attached figure, I show a trace wave0 along with the fit wave, gFit_wave0, and the residuals wave, gRes_wave0, generated by the Global Fit Package. Clearly, gRes_wave0 is not the difference between wave0 and gfit_wave0. Furthermore, when I change the fit parameters, gFit_wave0 is updated, but gRes_wave0 remains the same. 

On the other hand, the residuals are being accurately calculated in the wave

root:Packages:NewGlobalFit:NewGF_ResidY

which is displayed in the Global Analysis Progress window (figure attached). 

I have tried deleting the gRes_ waves and unchecking and rechecking the "Calculate Residuals" checkbox to recalculate the residuals waves, to no avail. I have tried starting a new Experiment and reloading the Global Fit Package, to no avail. 

I am running Igor Pro version 9.0.5.1 Build 56551 on Windows 11 Pro version 23H2. 

 

Thank you in advance for any insight. 

gRes wave not accurately showing residuals NewGF_ResidY wave accurately showing residuals

Do you maybe use x waves (i.e., an XY form of data with separate waves for each dimension)? Indeed there seems to be a bug with calculating residuals from such data, which I found that may (or may not) fix this issue. Since I am not comfortable with posting these changes here, could you please contact the support directly? You may get a new version sent then.

To provide an update, the issue did have to do with the use of x waves, and I reached out to support and they provided me with an updated version of the global fit procedure that resolved the issue.