perform linear scaling of two waves to each other

I was wondering if there was a way to something like this in Igor:

I have two 1D scaled waves with the same x scaling but with a linear relationship between their Y values. I would like to find the line coefficients such that the difference between the two waves will be minimized:

something like:

given
wave WA
wave WB

Find m and b such that

(WB^2-(m*WA+b)^2) is minimized


Is there a way to access directly the Levenberg-Marquardt algorithm which is used for iterative fitting?

Thanks,
Richard
Why not just do a line fit to the difference of the two waves?

Duplicate/O WB, Diff
Diff = WB-WA
CurveFit/NTHR=0 line  diff /D


--Jim Prouty
Software Engineer, WaveMetrics, Inc.