Power Regression
• pwrfit(vx, vy, vg)—Returns a vector containing the coefficients for a power curve of the form a xb + c that best approximates the data in vx and vy using guess values vg.
Arguments
• vx, vy are vectors of real data values of the same length, corresponding to the x and y values in the data set. There must be at least three data points, and the vx values must all be greater than or equal to 0.
Negative x values are inappropriate in this setting because raising them to an arbitrary power can produce complex results that satisfy the minimization problem, but do not correspond to the real y values. If you wish to do a power fit to data in the left-half plane, shift it so that all x values are positive, then shift the fitted equation back to get final results.
• vg is a three-element vector of real guess values for the parameters a, b, and c in the power equation.
Additional Information
The
pwrfit function employs the Levenberg-Marquardt method for minimization. For a power fit that differs from the form above, use
genfit.