discr3(3f) - [M_datapac:STATISTICS] bin the elements of a vector (output vector contains 1s, 2s, 3s, and so on)
Synopsis
Description
Options
Examples
Author
Maintainer
License
SUBROUTINE DISCR3(X,N,Numcla,Y)
discr3(3f) discretizes the data on the REAL vector x into numcla classes.all values in the vector x within a given class will be mapped into the class number (1, 2, ... , numcla). thus all the elements in the lowermost class will be mapped into the value 1.0; all the elements of x in the next higher class will be mapped into 2.0; etc.
the sample minimum and sample maximum are automatically computed internally and the class width (xdel) is computed as the (sample max
the last class interval is from the sample max - xdel to the sample max. the use of discr3(3f) (and the discre and discr2 subroutines) gives the data analyst the capability of constructing a discrete variate from a continuous one.
o sample min)/numcla. the first class interval is from the sample min to the sample min + xdel; the second class interval is from the sample min + xdel to the sample min + 2*xdel; ...; the resulting discrete variate might then (for example) be analyzed in itself for gross structure, or for adherence to some theoretical discrete probability model, or the discrete variate might be used as a subset definition vector for some other variate.
this discr3 subroutine is particularly suited to this last purpose inasmuch as it outputs 1s, 2s, etc. rather than midpoints.
X description of parameter Y description of parameter
Sample program:
program demo_discr3 use M_datapac, only : discr3 implicit none ! call discr3(x,y) end program demo_discr3Results:
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
Nemo Release 3.1 | discr3 (3) | February 23, 2025 |