LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Method to minimize error when selecting values from multiple data sets

I have 32 sets of data with each set containing 4 data points.  I am trying to come up with an eligant way to find a result that selects one data point from each set and meets the following constraints:  1)  the overall difference between selected values in minimized; 2) the sum of all the values selected must be within a specified range.

 

Right now I'm not seeing a better way than simply running a whole bunch of nested loops (32) and index through all and compute the relative differences and sum the values.  It is not pretty to look at by any means and I expect it will be very slow to compute.

 

Any suggestions?

Thanks.

Tim

 

 

 

0 Kudos
Message 1 of 7
(2,466 Views)

hi tim ,

 

As per my understanding you can obtain the result by using just two loops and giving the output condition in a single loop. i can be more clear if you could build a program and send it. Meanwhile i will develop a VI and send you.

 

regards

bharath

0 Kudos
Message 2 of 7
(2,447 Views)

hi tim,

 

please go through this VI and let me know if that is your requirement. i have assumed two data to be taken out.

Do revert for clarifications.

 

regards

bharath

0 Kudos
Message 3 of 7
(2,446 Views)

Please see the simple example attached.  It includes only 4 sets of data, each containing 3 data points.  This is basically what I am looking to do but on a much larger scale.

I did try to run a 32 for loop VI yesterday and that method will definately take WAY too long to run, so I definately need to come up with an alternate solution.

 

Thank you for your help.

Tim

0 Kudos
Message 4 of 7
(2,441 Views)

So the end result is 32 data points (one from each of the 32 sets containing 4 points).  The sum of the values must be within a specified range and the max and min values (difference) need to be minimized.

0 Kudos
Message 5 of 7
(2,436 Views)

Hi Tim,

 

It sounds as though you might be able to modify a least squares algorithm to select out a set of data points that would minimize the residual. The resulting fit could then be used to select out your datapoints meeting criteria (1), however this method would not necessarily insure that you satisfy criteria (2). You could then progressively remove large datapoints from the set and re-run the fitting routine until (2) is potentially met, however this might not necessarily lead to a "optimal" solution rather just a "reasonable" solution, or the dataset might not have a solution depending on the sum restriction.

 

May I ask what you are trying to achieve with this algorithm? I only ask that because there might be a pre-written algorithm to achieve such ends that would save you some time and insure a proper solution will be met.

 

Best,

Blayne Kettlewell 

0 Kudos
Message 6 of 7
(2,429 Views)

I am measuring the output from a 32 channel device. The '4 data points' from each channel are associated with 4 separate drive levels that each channel can be set to, for the given set of operating conditions.  I have two constraints:  The combined output must be within a specific range, but ideally at a set target.  I must minimize variation between all 32 channels.  I have a little wiggle room on the target, so I'm focusing on minimizing the variation as it is believed to be the cause of an issue we are investigating.

 

I will take a look at the Least Squares algorithm and see if I can figure out a way to make it work for our needs.

Thanks.

Tim

 

0 Kudos
Message 7 of 7
(2,427 Views)