LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mostly math issue

Hello!

 

I have two arrays [T/F] the elements True or False are calculated from the same data set with two different algorithms.

Array1 if element is True it is ok to do actionX.

Array2 if element is True it is Not ok do actionX.

 

The problem is the arrays are not 100% correct.

For example Array1 is correct 80% of the times it is True. Array2 is correct 60% of the times it is true.

 

I want to combine Array1 and Array2 to get more accurate when to do actionX. (More than I can get from Array1 alone)

 

I tested to take the inverse of Array2 and use an "AND" gate with Array1. with a resulting Array3 to base decision when to do the actionX. But I then saw that Array3 was only correct 70% of the times. Which was less than if I only had based my decision on Array1.

 

I think and hope there are someone that are good at LabView and also at probability and statistics here. That can help me on how to best combine Array1 and Array2 to get above 80% of correctness?

 

0 Kudos
Message 1 of 8
(1,797 Views)

Your explanation sounds ... well, let's say complicated, involved and hard to follow. I understood pretty much "Bahnhof".

Why don't you attach a VI with what you have and with the data either populated in diagram constants or as default value of the front panel controls?

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 8
(1,775 Views)

Hi Pettson,

 


@Pettson wrote:

I have two arrays [T/F] the elements True or False are calculated from the same data set with two different algorithms.

Array1 if element is True it is ok to do actionX.

Array2 if element is True it is Not ok do actionX.

 

The problem is the arrays are not 100% correct.

For example Array1 is correct 80% of the times it is True. Array2 is correct 60% of the times it is true.


How do you define the "correctness" of the boolean values in those arrays?

Why don't you calculate the correct values (using better algorithms) when you know the result is (maybe) not correct?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(1,749 Views)

So do you have a math issue or a programming issue? Apparently, you get a result that you did not expect, meaning that either your expectations are wrong or your implementation is wrong. I assume that the two array are of equal length and large enough to get reasonably good statistics. For testing purposes, we also know the 100% correct data independently.

 

Basically you have potentially conflicting information from two different datasets (and it does not really matter how the information is encoded (e.g. FALSE=good vs. TRUE=good). For each element you have 2 bits worth of information, i.e. four possibilities (FF, TF, FT, TT). Only for two of the four possibilities, the two datasets agree. For the other two cases, you need to define the conflict resolution. For example if Set1 is more likely to be correct (80% vs 60%), it should get a higher weight. Do false negatives and false positives have equal probabilities or is there bias (e.g. should we assume that most failures are false positives or negatives?). Is it safer to do actionX or not to do actionX? What should be the default action if we are not 100% sure?

 

What causes failures?  Does a failure (1) erase a bit, (2) set a bit, (3) invert a bit? Depending on the way failures occur, maybe OR'ing the processed arrays is correct, e.g. if all failures are false negatives..

 

As already requested, please provide a simple VI with the two arrays (e.g. as diagram constants, controls with typical default data, or some code that generates them with the known statistical properties for testing.).

 

 

Message 4 of 8
(1,743 Views)

Hello than you for the reply. 

 

I would say both math and programming issue since my math assumption of using an "and" gate gave worse results. Also programming in case there are some good LV statistics VI's or any good use of logical gates.

 

I might be able to provide a simple VI. Right now this is a part of a greater application with lots of dependecies and "BIG" data as input. So I would need some time to create a VI that mimics the behavior with more controllable input. 

 

"What should be the default action if we are not 100% sure?" We will never be able to be 100% sure. Since it is too big data. For example: The football player uses this amount of force to kick the ball. Will he make a goal? Array1=T (80%) Array2=F (60%). But then there is this randomness of the goalkeeper that cannot be calculated/measured.  We can only know after we say to the football player "kick this amount of hard" if the football player made the goal or not. 

 

Definition of correctness is: Array1 says to actionX 10 times. We do the action 10 times. Only after we have done the actionX we can know was it the right decision. For Array1 it is correct 80% of the times.

 

The two algorithms can be improved, but they handle Big Data which I don't fully understand all the dependencies or if it needs to be even bigger data.

 

I was thinking regarding the programming part that Array1 would symbolize a circle A. Array2 circle B and they are overlapping each other alittle. Call the overlapping part C. Is there a way to only get the C part or the A part with C part subtracted?

 

 

0 Kudos
Message 5 of 8
(1,663 Views)

Hi Pettson,

 


@Pettson wrote:

I was thinking regarding the programming part that Array1 would symbolize a circle A. Array2 circle B and they are overlapping each other alittle. Call the overlapping part C. Is there a way to only get the C part or the A part with C part subtracted?


Back to my question: How do you define the "correctness" of the boolean values in your arrays?

To adapt that to your "circle analogy": how do you define the circle center/radii to be able to calculate the C cross section?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(1,656 Views)

From your description a Union of 2 booleans are a simple AND, but from your description it sounds like you should have some "probablility" as a Double resulting from your calculation instead. If so, it's a simple multiplication of A and B to get your total probablility. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 8
(1,633 Views)
What are you hoping to accomplish by running this simulation? If your description of a decision matrix of whether or not to take a shot on goal is accurate then, we need to consider that even a low probability shot on goal has many secondary effects 1, there is a chance to score only if the decision is made to take the shot and 2, regardless of 1 the goalkeeper will experience fatigue if a shot is taken and rest if no shot is taken. Compound that with the desirability to run the time out while maintaining ball control etc ad nauseam . . That is why the athletes actually play the games!

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(1,622 Views)