11-14-2008 07:17 AM
There is a function in excel called 'linest' that will perform a multiple linear regression with a single y column of data and multiple x columns. Is there an equivilant in Lavview?
Thanks
Solved! Go to Solution.
11-14-2008 07:47 AM
Yes there is,
but it is not provided with the base version of LabVIEW (but it is provided with the student edition).
General LS linefit, and it comes with tow examples: Predicting cost, Linear combinations.
Have a look at the Curve Fitting palette for other curve fitting algorithms.
Ton
11-17-2008 03:34 PM
Thanks very much. I am currently working in labview 6.0 and I have found that vi. But it seems limited to processing 4 columns of x data against a single y column. I need as many a seven.
SJH
11-17-2008 11:02 PM
Maybe the general polynomial fit is what you want?
Ton
11-18-2008 03:20 PM
Thanks
The first vi ispeforming a mulitple linear regression - so you are right, it just does not appear to work as well as 'linest'
SJH
03-17-2009 08:48 AM
*****UPDATE********
I have been working on this on and off (fortunately it is not that urgent!) and I can use the multiple linear regression but it appears that there is a limit to what the function can perform. I suspect that it is because it is 16 bit. (numbers above a certain value cause problems).
Is anyone aware of a 32 bit version that performs multiple linear regression?
SJH
08-14-2009 06:52 AM
After more detailed looking, the restriction appears to be the number of 'variables' that the fucntion can process. Above 5 o(i think) the function will not work.
The restriction appears to be at 'code' level - that I cannot access. Has anyone any experience of amending labview at this level?
SJH
08-20-2009 05:16 PM
The general LS linear fit VI should be able to solve your problem. I implemented an example pulled from the Excel documentation (scroll down to example 3) in LabVIEW. Excel returns the same results as LabVIEW for this problem. Attached is the example.
-Jim
08-20-2009 06:48 PM - edited 08-20-2009 06:49 PM
sjh wrote:Above 5 o(i think) the function will not work.
The restriction appears to be at 'code' level - that I cannot access. Has anyone any experience of amending labview at this level?
Can you attach some typical data?
I suspect that your problem is ill conditioned. What is the condition number of the matrix (try this VI). Have you tried some of the other choices for the "algorithm" input?
I have used this function for much larger numbers of components, so there is no inherent limitation. (It has nothing to do with bits, calulations are done in DBL, which is 64 bits.)
In newer LabVIEW versions the general LS fit tool has been updated and improved. Still, it gives the same result in Jim's example above.
Here's another alternative to add the column. Same difference. 🙂
08-22-2009 06:48 AM
Thanks gents - this now working. I wasn't ensuring that there was the correct number of rows and columns for the function to work.
A little off line playing and your pointers has resolved this.
SJH