LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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?

Solved!
Go to solution

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

0 Kudos
Message 1 of 26
(6,725 Views)

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

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 26
(6,721 Views)

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

0 Kudos
Message 3 of 26
(6,676 Views)

Maybe the general polynomial fit is what you want?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 4 of 26
(6,656 Views)

 

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

0 Kudos
Message 5 of 26
(6,634 Views)

*****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

0 Kudos
Message 6 of 26
(6,305 Views)

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

0 Kudos
Message 7 of 26
(5,978 Views)

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

 

0 Kudos
Message 8 of 26
(5,932 Views)

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. 🙂

 

Message Edited by altenbach on 08-20-2009 04:49 PM
Message 9 of 26
(5,925 Views)

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

0 Kudos
Message 10 of 26
(5,904 Views)