LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I put constraints on the coefficients of a General LS Linear Fit?

I am using the General LS Linear Fit.vi to fit data to the equation

y(x,z,q)=a*x + b*z + c*q

with x, z and q input arrays and a,b and c the fit-coefficients. Now, I would like to put constraints on the possible values for a, b and c, for instance I would like all the coefficients to be positive. How do I do this?
0 Kudos
Message 1 of 2
(2,539 Views)
Hello,

These VIs were not written to include the capability to place constraints on the output coefficients. Because of the mathematical characteristics of the linear fit VI, it would take some modifications of the actual VI in order to effectively force the coefficients to be positive. The algorithms that compute these coefficients would have to be modified to allow for constraints on the results. I would make changes to the General LS Linear Fit VI that assumes the use of the existing algorithms and then makes changes to the coefficients based on constraints and the known behavior of the algorithms used to compute them.

(More information about these algorithms can be found in the Help for the linear fit VI.)

Liz Fausak
Applications Engineer
National Ins
truments
0 Kudos
Message 2 of 2
(2,539 Views)