Quantile subroutine, Fortran 90

In summary, the conversation was about searching for a Fortran 90 quantile routine and someone suggesting to use a sorting routine to find the median of an array.
  • #1
natski
267
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
  • #2
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.
 
  • #3
Yup was just about to post that I'd done exactly that :-)
 

What is a quantile subroutine in Fortran 90?

A quantile subroutine in Fortran 90 is a function used to calculate the quantile value of a dataset. A quantile is a statistical measure that divides a dataset into equal-sized groups, with each group containing an equal number of data points. The quantile subroutine in Fortran 90 allows for efficient and accurate calculations of quantiles in scientific and statistical applications.

How does a quantile subroutine work in Fortran 90?

A quantile subroutine in Fortran 90 uses the algorithm developed by Hyndman and Fan to calculate quantiles. This algorithm calculates the quantile value by interpolating between the two nearest data points, which results in a more accurate estimation compared to other methods.

What are the inputs and outputs of a quantile subroutine in Fortran 90?

The inputs of a quantile subroutine in Fortran 90 include the dataset for which the quantile needs to be calculated, the desired quantile value, and the weights for each data point (optional). The output is the calculated quantile value for the given dataset.

How accurate is the quantile subroutine in Fortran 90?

The quantile subroutine in Fortran 90 is highly accurate due to the use of the Hyndman and Fan algorithm. This algorithm has been extensively tested and shown to provide accurate quantile estimates for different types of datasets.

Can a quantile subroutine be used for large datasets in Fortran 90?

Yes, a quantile subroutine in Fortran 90 can handle large datasets efficiently. The Hyndman and Fan algorithm has been optimized for speed and memory usage, making it suitable for large datasets. Additionally, the subroutine allows for parallel processing, which further improves its performance for large datasets.

Similar threads

  • Programming and Computer Science
Replies
4
Views
2K
  • Programming and Computer Science
Replies
5
Views
3K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
12
Views
3K
  • Programming and Computer Science
Replies
5
Views
12K
  • Programming and Computer Science
Replies
18
Views
6K
  • Programming and Computer Science
Replies
2
Views
8K
  • Programming and Computer Science
Replies
1
Views
4K
Back
Top