LabWindows/CVI Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Wolfgang

calculate percentiles

I'll continue my quest for better statistics support in CVI... While LabView provides a VI to calculate percentiles of an array, there is no built-in function in CVI

 

In case you are wondering what the purpose of percentiles is: it is as important as the standard deviation for robust statistics, i.e. instead of calculating the mean and the standard deviation one would choose to calculate the median (possible with CVI) and the 25 and 75 percentiles; the difference (sometimes called the interquartile distance, IQD) is a measure for the width of the distribution.

 

Robust statistics is valuable of one has to deal with outliers.

 

Hence I ask for a function to calculate percentiles; may be, if NI is generous, they may even supply a function to calculate IQD

3 Comments
RobertoBozzolo
Proven Zealot

Hi Wolfgang, I am not so fond on statistics but it seems to me that Histogram () function could be of great to create a function for this purpose: histogram returns the frequency-vs-values distribution where values are splitted in a desired number of intervals and sorted, so it could be a great help in calculating percentiles and IQD values.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Wolfgang
Trusted Enthusiast

Hi Roberto,

 

Thanks for the hint!

 

I am not especially fond of statistics either, but need to use it...

 

If my understanding of percentiles is correct, your suggestion will not be especially useful (sorry to say that). Let me try to explain by giving an example. Say there are 1000 events, belonging to x values between 1 and 100. Assume that 900 events belong to x value 90, the other 100 are equally distributed.

 

A percentile refers to the total sum of events, hence the 10% percentile would be located around x=90. Using a histogram with 100 bins I still would need to investigate all the bins to obtain the total sum, and then scan through the bins until the percentile is met. Certainly this can be done quite fast, but a dedicated function would be nicer.

 

Actually in my application I already have histogram data (time-resolved counts) and hence am doing something similar...:-)

 

Wolfgang

JonathanN
NI Employee (retired)
Status changed to: Under Consideration
 
Jonathan N.
National Instruments