Fortran Quantile subroutine, Fortran 90

AI Thread Summary
A user is seeking a Fortran 90 subroutine for calculating quantiles from a 1-D array, specifically looking for a method to obtain the median with a function call like "call quantile(array,0.5D0,value)". Another participant suggests using existing sorting routines to achieve this, recommending to sort the array, determine its size, and access the appropriate data point for the quantile. The original poster confirms they have implemented this solution successfully.
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 :-)
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

Similar threads

Replies
5
Views
3K
Replies
4
Views
2K
Replies
2
Views
2K
Replies
5
Views
13K
Replies
2
Views
2K
Replies
2
Views
8K
Replies
18
Views
6K
Replies
12
Views
3K
Back
Top