Quantile subroutine, Fortran 90

  • Context: Fortran 
  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Fortran Subroutine
Click For Summary
SUMMARY

The forum discussion centers on the need for a quantile subroutine in Fortran 90. The user, natski, seeks a method to calculate quantiles from a 1-D array, specifically requesting a function call like "call quantile(array,0.5D0,value)" to obtain the median. Another user suggests utilizing existing sorting routines in Fortran 90, recommending to sort the array, determine its size, and access the appropriate data point for the desired quantile. This approach effectively addresses the user's requirement using built-in capabilities of the language.

PREREQUISITES
  • Understanding of Fortran 90 programming language
  • Familiarity with array manipulation in Fortran 90
  • Knowledge of sorting algorithms
  • Basic statistical concepts, particularly quantiles
NEXT STEPS
  • Research Fortran 90 sorting routines and their implementations
  • Learn how to manipulate arrays in Fortran 90
  • Study statistical functions in Fortran 90 for further analysis
  • Explore existing libraries or scripts for quantile calculations in Fortran
USEFUL FOR

Programmers and data analysts working with Fortran 90 who need to perform statistical analysis on datasets, particularly those interested in calculating quantiles and medians efficiently.

natski
Messages
262
Reaction score
2
Hi all,

I have been Googling for a Fortran 90 quantile routine but to no avail...

I need a subroutine to which one passes an 1-D array plus the quantile range required...

e.g.

"call quantile(array,0.5D0,value)"

would give me the median of array. Does anyone know of a handy (and free) F90 script to accomplish this?

Thanks,

natski
 
Last edited:
Technology news on Phys.org
Just use one of the many sorting routines that are available. Then get the SIZE(array), divide that number of by 2, round and get the data point at that location.
 
Yup was just about to post that I'd done exactly that :-)
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
13K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
9K
Replies
1
Views
4K
  • · Replies 18 ·
Replies
18
Views
7K
  • · Replies 12 ·
Replies
12
Views
4K