ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_sampleQuan::getQuan Interface Reference

Generate and return the approximate sample quantile for the given method at the specified probabilities. More...

Detailed Description

Generate and return the approximate sample quantile for the given method at the specified probabilities.

Parameters
[in]method: The input scalar constant that can be,
  1. The scalar constant neimean or a scalar object of type neimean_type implying the use of the average of the sample values of the two nearest neighbors of the input prob smaller and larger than it as the output quan.
  2. The scalar constant neinear or a scalar object of type neinear_type implying the use of the average of the sample value of the nearest neighbor of the input prob as the output quan.
    Note that the nearest neighbor in this case is measured by actual Euclidean distances of neighbors to the input prob.
  3. The scalar constant neiprev or a scalar object of type neiprev_type implying the use of the sample value of the largest abscissa in the input prob smaller than the input prob as the output quan.
  4. The scalar constant neinext or a scalar object of type neinext_type implying the use of the sample value of the smallest abscissa in the input prob larger than the input prob as the output quan.
  5. The scalar constant piwilin or a scalar object of type piwilin_type implying the use of the linear interpolation of the sample values of the two prob points that bracket prob as the output quan.
    The linear interpolation implemented in this constructor is based on the Lagrange classical formula for linear interpolation.
    Suppose an input query point \(x\) falls between two nodes \(x_i\) and \(x_{i+1}\) with the corresponding function values \(y_i\) and \(y_{i+1}\) and we wish to estimate the corresponding interpolated value \(y(x)\), which can be computed as,

    \begin{equation*} y(x) = \frac {x - x_{i+1}} {x_i - x_{i+1}} y_i + \frac {x - x_{i}} {x_{i+1} - x_{i}} y_{i+1} ~. \end{equation*}

Either piwilin or neinear for larger sample sizes can be reasonable choices.
[in]prob: The input scalar or contiguous vector of
  1. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing the (set of) probability(s) for which the corresponding quantiles must be computed.
[in]sample: The input contiguous vector of shape (1:nsam) or matrix of shape (1:ndim, 1:nsam) of the same type, kind, and size as prob, containing the sample based upon which the quantiles must be computed.
[in]dim: The input scalar of type integer of default kind IK, whose value represents the dimension of the input sample containing different nsam observations:
  1. If dim = 1, the input sample is assumed to have the shape (1:nsam, 1:ndim).
  2. If dim = 2, the input sample is assumed to have the shape (1:ndim, 1:nsam).
(optional. It must be present if and only if the input arguments the condition rank(sample) > 1 holds.)
[in]weight: The input contiguous vector of length nsam of,
  1. type integer of default kind IK, or
  2. type real of the same kind as the kind of prob,
containing the corresponding weights of individual nsam observations in the target sample.
(optional. default = getFilled(1, nsam).)
[in]weisum: The input scalar of the same type and kind as weight containing the quantity sum(weight).
(optional. It can be present if and only if the input argument weight is also present.)
Returns

quan : The output object of the same type and kind as prob, containing the sample quantiles corresponding to the input prob.

  1. If sample is a vector and prob is a scalar, then quan is a scalar.
  2. If sample is a vector and prob is a vector, then quan is a vector of size size(prob).
  3. If sample is a matrix and prob is a scalar, then quan is a vector of size size(sample, 3 - dim).
  4. If sample is a matrix and prob is a vector, then quan is a matrix of shape [size(prob), size(sample, 3 - dim)].


Possible calling interfaces

! 1D sample
quan = getQuan(method, prob, sample(1:nsam))
quan = getQuan(method, prob, sample(1:nsam), weight(1:nsam), weisum = weisum)
quan(1:nprob) = getQuan(method, prob(1:nprob), sample(1:nsam))
quan(1:nprob) = getQuan(method, prob(1:nprob), sample(1:nsam), weight(1:nsam), weisum = weisum)
! 2D sample
quan(1:size(sample, 3 - dim)) = getQuan(method, prob, sample(:,:), dim)
quan(1:size(sample, 3 - dim)) = getQuan(method, prob, sample(:,:), dim, weight(1:nsam), weisum = weisum)
quan(1:nprob, 1:size(sample, 3 - dim)) = getQuan(method, prob(1:nprob), sample(:,:), dim)
quan(1:nprob, 1:size(sample, 3 - dim)) = getQuan(method, prob(1:nprob), sample(:,:), dim, weight(1:nsam), weisum = weisum)
Generate and return the approximate sample quantile for the given method at the specified probabiliti...
This module contains procedures and data types for computing sample quantile.
Warning
The condition size(weight) == size(sample, dim) must hold for the corresponding input arguments.
The condition all([0 <= prob .and. prob <= 1]) must hold for the corresponding input arguments.
The condition 0 < dim .and. dim < 3 must hold for the corresponding input arguments.
The condition all(0 <= weight) must hold for the corresponding input arguments.
These conditions are verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.
Developer Remark:
A subroutine equivalent of this functional interface was deemed unnecessary.
Internally, the functional interface requires two internal runtime allocatable arrays to sort the input sample and store the sample ECDF.
For intensive repeated calculations, these allocation actions and copies can be avoided by explicitly implementing this generic interface as the following for a 1D sample.
type_of(sample) :: ecdf(size(sample))
call setECDF(ecdf, weight, weisum)
call setSorted(sample)
call setExtrap(method, ecdf, sample, prob, quan)
Sort the input scalar string or contiguous vector in ascending order, or return the sorted indices of...
Generate and return the approximate polynomial interpolation/extrapolation value of the input specifi...
Compute and return the Empirical Cumulative Distribution Function (ECDF) of a univariate (optionally ...
This module contains procedures and generic interfaces for various sorting tasks.
This module contains procedures and data types for interpolation of finite samples of data.
This module contains classes and procedures for computing the Empirical Cumulative Distribution Funct...
See also
pm_polation
pm_sampleECDF
pm_sampleQuan
pm_arraySort


Example usage

1program example
2
3 use pm_kind, only: SK, IK, LK
6 use pm_distNorm, only: getNormRand
9 use pm_distPois, only: getPoisRand
10 use pm_distUnif, only: getUnifRand
11 use pm_arrayFill, only: getFilled
12 use pm_io, only: getErrTableWrite
13 use pm_io, only: display_type
14
15 implicit none
16
17 integer(IK) :: iprob, ndim, nsam, itry, ntry = 5
18 integer(IK), allocatable :: iweight(:)
19 type(display_type) :: disp
20
21 disp = display_type(file = "main.out.F90")
22
23 call disp%skip()
24 call disp%show("!%%%%%%%%%%%%%%%%%%%")
25 call disp%show("!1D sample quantile.")
26 call disp%show("!%%%%%%%%%%%%%%%%%%%")
27 call disp%skip()
28
29 block
30 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
31 real(TKG), allocatable :: sample(:), prob(:), quan(:)
32 call disp%skip()
33 call disp%show("sample = [10, 7, 4, 3, 2, 1, 0]")
34 sample = [10, 7, 4, 3, 2, 1, 0]
35 call disp%show("prob = [0., .25, .5, .75, .9, 1.]")
36 prob = [0., .25, .5, .75, .9, 1.]
37 call disp%show("quan = getQuan(neimean, prob, sample)")
38 quan = getQuan(neimean, prob, sample)
39 call disp%show("quan")
40 call disp%show( quan )
41 call disp%show("quan = getQuan(neinear, prob, sample)")
42 quan = getQuan(neinear, prob, sample)
43 call disp%show("quan")
44 call disp%show( quan )
45 call disp%show("quan = getQuan(neinext, prob, sample)")
46 quan = getQuan(neinext, prob, sample)
47 call disp%show("quan")
48 call disp%show( quan )
49 call disp%show("quan = getQuan(neiprev, prob, sample)")
50 quan = getQuan(neiprev, prob, sample)
51 call disp%show("quan")
52 call disp%show( quan )
53 call disp%show("quan = getQuan(piwilin, prob, sample)")
54 quan = getQuan(piwilin, prob, sample)
55 call disp%show("quan")
56 call disp%show( quan )
57 call disp%show("do iprob = 1, size(prob)")
58 call disp%show(" quan(iprob) = getQuan(piwilin, prob(iprob), sample)")
59 call disp%show("end do")
60 do iprob = 1, size(prob)
61 quan(iprob) = getQuan(piwilin, prob(iprob), sample)
62 end do
63 call disp%show("quan")
64 call disp%show( quan )
65 call disp%skip()
66 end block
67
68 call disp%skip()
69 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
70 call disp%show("!1D frequency/reliability-weighted sample quantile.")
71 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
72 call disp%skip()
73
74 block
75 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
76 real(TKG), allocatable :: sample(:), prob(:), quan(:)
77 call disp%skip()
78 call disp%show("sample = [10, 7, 4, 3, 2, 1, 0]")
79 sample = [10, 7, 4, 3, 2, 1, 0]
80 call disp%show("iweight = getUnifRand(1, 9, size(sample, 1, IK))")
81 iweight = getUnifRand(1, 9, size(sample, 1, IK))
82 call disp%show("iweight")
83 call disp%show( iweight )
84 call disp%show("prob = [0., .25, .5, .75, .9, 1.]")
85 prob = [0., .25, .5, .75, .9, 1.]
86 call disp%show("quan = getQuan(neimean, prob, sample)")
87 quan = getQuan(neimean, prob, sample)
88 call disp%show("quan")
89 call disp%show( quan )
90 call disp%show("quan = getQuan(neinear, prob, sample, iweight)")
91 quan = getQuan(neinear, prob, sample, iweight)
92 call disp%show("quan")
93 call disp%show( quan )
94 call disp%show("quan = getQuan(neinext, prob, sample, iweight)")
95 quan = getQuan(neinext, prob, sample, iweight)
96 call disp%show("quan")
97 call disp%show( quan )
98 call disp%show("quan = getQuan(neiprev, prob, sample, iweight)")
99 quan = getQuan(neiprev, prob, sample, iweight)
100 call disp%show("quan")
101 call disp%show( quan )
102 call disp%show("quan = getQuan(piwilin, prob, sample, iweight, sum(iweight))")
103 quan = getQuan(piwilin, prob, sample, iweight, sum(iweight))
104 call disp%show("quan")
105 call disp%show( quan )
106 call disp%show("do iprob = 1, size(prob)")
107 call disp%show(" quan(iprob) = getQuan(piwilin, prob(iprob), sample, iweight)")
108 call disp%show("end do")
109 do iprob = 1, size(prob)
110 quan(iprob) = getQuan(piwilin, prob(iprob), sample, iweight)
111 end do
112 call disp%show("quan")
113 call disp%show( quan )
114 call disp%skip()
115 end block
116
117 block
118 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
119 real(TKG), allocatable :: sample(:), prob(:), quan(:)
120 real(TKG), allocatable :: rweight(:)
121 call disp%skip()
122 call disp%show("sample = [10, 7, 4, 3, 2, 1, 0]")
123 sample = [10, 7, 4, 3, 2, 1, 0]
124 call disp%show("rweight = exp(getNormLogPDF(getFilled(0._TKG, size(sample, 1, IK))))")
125 rweight = exp(getNormLogPDF(getFilled(0._TKG, size(sample, 1, IK))))
126 call disp%show("rweight")
127 call disp%show( rweight )
128 call disp%show("prob = [0., .25, .5, .75, .9, 1.]")
129 prob = [0., .25, .5, .75, .9, 1.]
130 call disp%show("quan = getQuan(neimean, prob, sample)")
131 quan = getQuan(neimean, prob, sample)
132 call disp%show("quan")
133 call disp%show( quan )
134 call disp%show("quan = getQuan(neinear, prob, sample, rweight)")
135 quan = getQuan(neinear, prob, sample, rweight)
136 call disp%show("quan")
137 call disp%show( quan )
138 call disp%show("quan = getQuan(neinext, prob, sample, rweight)")
139 quan = getQuan(neinext, prob, sample, rweight)
140 call disp%show("quan")
141 call disp%show( quan )
142 call disp%show("quan = getQuan(neiprev, prob, sample, rweight)")
143 quan = getQuan(neiprev, prob, sample, rweight)
144 call disp%show("quan")
145 call disp%show( quan )
146 call disp%show("quan = getQuan(piwilin, prob, sample, rweight, sum(rweight))")
147 quan = getQuan(piwilin, prob, sample, rweight, sum(rweight))
148 call disp%show("quan")
149 call disp%show( quan )
150 call disp%show("do iprob = 1, size(prob)")
151 call disp%show(" quan(iprob) = getQuan(piwilin, prob(iprob), sample, rweight)")
152 call disp%show("end do")
153 do iprob = 1, size(prob)
154 quan(iprob) = getQuan(piwilin, prob(iprob), sample, rweight)
155 end do
156 call disp%show("quan")
157 call disp%show( quan )
158 call disp%skip()
159 end block
160
161 call disp%skip()
162 call disp%show("!%%%%%%%%%%%%%%%%%%%")
163 call disp%show("!2D sample quantile.")
164 call disp%show("!%%%%%%%%%%%%%%%%%%%")
165 call disp%skip()
166
167 block
168 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
169 real(TKG), allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
170 integer(IK) :: nsam, nprob, dim
171 call disp%skip()
172 call disp%show("dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
173 dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
174 call disp%show("[ndim, nsam, nprob]")
175 call disp%show( [ndim, nsam, nprob] )
176 call disp%show("sample = getPoisRand(getFilled(10., ndim, nsam))")
177 sample = getPoisRand(getFilled(10., ndim, nsam))
178 call disp%show("sample")
179 call disp%show( sample )
180 call disp%show("prob = getLinSpace(0., 1., nprob)")
181 prob = getLinSpace(0., 1., nprob)
182 call disp%show("prob")
183 call disp%show( prob )
184 call disp%show("quan2 = getQuan(neimean, prob, sample, dim)")
185 quan2 = getQuan(neimean, prob, sample, dim)
186 call disp%show("quan2")
187 call disp%show( quan2 )
188 call disp%show("quan2 = getQuan(neinear, prob, sample, dim)")
189 quan2 = getQuan(neinear, prob, sample, dim)
190 call disp%show("quan2")
191 call disp%show( quan2 )
192 call disp%show("quan2 = getQuan(neinext, prob, sample, dim)")
193 quan2 = getQuan(neinext, prob, sample, dim)
194 call disp%show("quan2")
195 call disp%show( quan2 )
196 call disp%show("quan2 = getQuan(neiprev, prob, sample, dim)")
197 quan2 = getQuan(neiprev, prob, sample, dim)
198 call disp%show("quan2")
199 call disp%show( quan2 )
200 call disp%show("quan2 = getQuan(piwilin, prob, sample, dim)")
201 quan2 = getQuan(piwilin, prob, sample, dim)
202 call disp%show("quan2")
203 call disp%show( quan2 )
204 call disp%show("quan1 = getQuan(neimean, prob(nprob/2), sample, dim)")
205 quan1 = getQuan(neimean, prob(nprob/2), sample, dim)
206 call disp%show("quan1")
207 call disp%show( quan1 )
208 call disp%show("quan1 = getQuan(neinear, prob(nprob/2), sample, dim)")
209 quan1 = getQuan(neinear, prob(nprob/2), sample, dim)
210 call disp%show("quan1")
211 call disp%show( quan1 )
212 call disp%show("quan1 = getQuan(neinext, prob(nprob/2), sample, dim)")
213 quan1 = getQuan(neinext, prob(nprob/2), sample, dim)
214 call disp%show("quan1")
215 call disp%show( quan1 )
216 call disp%show("quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)")
217 quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)
218 call disp%show("quan1")
219 call disp%show( quan1 )
220 call disp%show("quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)")
221 quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)
222 call disp%show("quan1")
223 call disp%show( quan1 )
224 call disp%skip()
225 end block
226
227 block
228 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
229 real(TKG), allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
230 integer(IK) :: nsam, nprob, dim
231 call disp%skip()
232 call disp%show("dim = 1; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
233 dim = 1; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
234 call disp%show("[ndim, nsam, nprob]")
235 call disp%show( [ndim, nsam, nprob] )
236 call disp%show("sample = getPoisRand(getFilled(10., nsam, ndim))")
237 sample = getPoisRand(getFilled(10., nsam, ndim))
238 call disp%show("sample")
239 call disp%show( sample )
240 call disp%show("prob = getLinSpace(0., 1., nprob)")
241 prob = getLinSpace(0., 1., nprob)
242 call disp%show("prob")
243 call disp%show( prob )
244 call disp%show("quan2 = getQuan(neimean, prob, sample, dim)")
245 quan2 = getQuan(neimean, prob, sample, dim)
246 call disp%show("quan2")
247 call disp%show( quan2 )
248 call disp%show("quan2 = getQuan(neinear, prob, sample, dim)")
249 quan2 = getQuan(neinear, prob, sample, dim)
250 call disp%show("quan2")
251 call disp%show( quan2 )
252 call disp%show("quan2 = getQuan(neinext, prob, sample, dim)")
253 quan2 = getQuan(neinext, prob, sample, dim)
254 call disp%show("quan2")
255 call disp%show( quan2 )
256 call disp%show("quan2 = getQuan(neiprev, prob, sample, dim)")
257 quan2 = getQuan(neiprev, prob, sample, dim)
258 call disp%show("quan2")
259 call disp%show( quan2 )
260 call disp%show("quan2 = getQuan(piwilin, prob, sample, dim)")
261 quan2 = getQuan(piwilin, prob, sample, dim)
262 call disp%show("quan2")
263 call disp%show( quan2 )
264 call disp%show("quan1 = getQuan(neimean, prob(nprob/2), sample, dim)")
265 quan1 = getQuan(neimean, prob(nprob/2), sample, dim)
266 call disp%show("quan1")
267 call disp%show( quan1 )
268 call disp%show("quan1 = getQuan(neinear, prob(nprob/2), sample, dim)")
269 quan1 = getQuan(neinear, prob(nprob/2), sample, dim)
270 call disp%show("quan1")
271 call disp%show( quan1 )
272 call disp%show("quan1 = getQuan(neinext, prob(nprob/2), sample, dim)")
273 quan1 = getQuan(neinext, prob(nprob/2), sample, dim)
274 call disp%show("quan1")
275 call disp%show( quan1 )
276 call disp%show("quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)")
277 quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)
278 call disp%show("quan1")
279 call disp%show( quan1 )
280 call disp%show("quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)")
281 quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)
282 call disp%show("quan1")
283 call disp%show( quan1 )
284 call disp%skip()
285 end block
286
287 call disp%skip()
288 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
289 call disp%show("!2D frequency/reliability-weighted sample quantile.")
290 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
291 call disp%skip()
292
293 block
294 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
295 real(TKG), allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
296 integer(IK) :: nsam, nprob, dim
297 call disp%skip()
298 call disp%show("dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
299 dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
300 call disp%show("[ndim, nsam, nprob]")
301 call disp%show( [ndim, nsam, nprob] )
302 call disp%show("sample = getPoisRand(getFilled(10., ndim, nsam))")
303 sample = getPoisRand(getFilled(10., ndim, nsam))
304 call disp%show("sample")
305 call disp%show( sample )
306 call disp%show("iweight = getUnifRand(1, 9, nsam)")
307 iweight = getUnifRand(1, 9, nsam)
308 call disp%show("iweight")
309 call disp%show( iweight )
310 call disp%show("prob = getLinSpace(0., 1., nprob)")
311 prob = getLinSpace(0., 1., nprob)
312 call disp%show("prob")
313 call disp%show( prob )
314 call disp%show("quan2 = getQuan(neimean, prob, sample, dim, iweight)")
315 quan2 = getQuan(neimean, prob, sample, dim, iweight)
316 call disp%show("quan2")
317 call disp%show( quan2 )
318 call disp%show("quan2 = getQuan(neinear, prob, sample, dim, iweight)")
319 quan2 = getQuan(neinear, prob, sample, dim, iweight)
320 call disp%show("quan2")
321 call disp%show( quan2 )
322 call disp%show("quan2 = getQuan(neinext, prob, sample, dim, iweight)")
323 quan2 = getQuan(neinext, prob, sample, dim, iweight)
324 call disp%show("quan2")
325 call disp%show( quan2 )
326 call disp%show("quan2 = getQuan(neiprev, prob, sample, dim, iweight)")
327 quan2 = getQuan(neiprev, prob, sample, dim, iweight)
328 call disp%show("quan2")
329 call disp%show( quan2 )
330 call disp%show("quan2 = getQuan(piwilin, prob, sample, dim, iweight)")
331 quan2 = getQuan(piwilin, prob, sample, dim, iweight)
332 call disp%show("quan2")
333 call disp%show( quan2 )
334 call disp%show("quan1 = getQuan(neimean, prob(nprob/2), sample, dim, iweight)")
335 quan1 = getQuan(neimean, prob(nprob/2), sample, dim, iweight)
336 call disp%show("quan1")
337 call disp%show( quan1 )
338 call disp%show("quan1 = getQuan(neinear, prob(nprob/2), sample, dim, iweight)")
339 quan1 = getQuan(neinear, prob(nprob/2), sample, dim, iweight)
340 call disp%show("quan1")
341 call disp%show( quan1 )
342 call disp%show("quan1 = getQuan(neinext, prob(nprob/2), sample, dim, iweight)")
343 quan1 = getQuan(neinext, prob(nprob/2), sample, dim, iweight)
344 call disp%show("quan1")
345 call disp%show( quan1 )
346 call disp%show("quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, iweight)")
347 quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, iweight)
348 call disp%show("quan1")
349 call disp%show( quan1 )
350 call disp%show("quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, iweight)")
351 quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, iweight)
352 call disp%show("quan1")
353 call disp%show( quan1 )
354 call disp%skip()
355 end block
356
357 call disp%skip()
358 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
359 call disp%show("!2D frequency/reliability-weighted sample quantile.")
360 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
361 call disp%skip()
362
363 block
364 use pm_kind, only: TKG => RKS ! all processor kinds are supported.
365 real(TKG), allocatable :: sample(:,:), prob(:), quan1(:), quan2(:,:)
366 real(TKG), allocatable :: rweight(:)
367 integer(IK) :: nsam, nprob, dim
368 call disp%skip()
369 call disp%show("dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)")
370 dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
371 call disp%show("[ndim, nsam, nprob]")
372 call disp%show( [ndim, nsam, nprob] )
373 call disp%show("sample = getPoisRand(getFilled(10., ndim, nsam))")
374 sample = getPoisRand(getFilled(10., ndim, nsam))
375 call disp%show("sample")
376 call disp%show( sample )
377 call disp%show("rweight = getUnifRand(1, 9, nsam)")
378 rweight = getUnifRand(1, 9, nsam)
379 call disp%show("rweight")
380 call disp%show( rweight )
381 call disp%show("prob = getLinSpace(0., 1., nprob)")
382 prob = getLinSpace(0., 1., nprob)
383 call disp%show("prob")
384 call disp%show( prob )
385 call disp%show("quan2 = getQuan(neimean, prob, sample, dim, rweight)")
386 quan2 = getQuan(neimean, prob, sample, dim, rweight)
387 call disp%show("quan2")
388 call disp%show( quan2 )
389 call disp%show("quan2 = getQuan(neinear, prob, sample, dim, rweight)")
390 quan2 = getQuan(neinear, prob, sample, dim, rweight)
391 call disp%show("quan2")
392 call disp%show( quan2 )
393 call disp%show("quan2 = getQuan(neinext, prob, sample, dim, rweight)")
394 quan2 = getQuan(neinext, prob, sample, dim, rweight)
395 call disp%show("quan2")
396 call disp%show( quan2 )
397 call disp%show("quan2 = getQuan(neiprev, prob, sample, dim, rweight)")
398 quan2 = getQuan(neiprev, prob, sample, dim, rweight)
399 call disp%show("quan2")
400 call disp%show( quan2 )
401 call disp%show("quan2 = getQuan(piwilin, prob, sample, dim, rweight)")
402 quan2 = getQuan(piwilin, prob, sample, dim, rweight)
403 call disp%show("quan2")
404 call disp%show( quan2 )
405 call disp%show("quan1 = getQuan(neimean, prob(nprob/2), sample, dim, rweight)")
406 quan1 = getQuan(neimean, prob(nprob/2), sample, dim, rweight)
407 call disp%show("quan1")
408 call disp%show( quan1 )
409 call disp%show("quan1 = getQuan(neinear, prob(nprob/2), sample, dim, rweight)")
410 quan1 = getQuan(neinear, prob(nprob/2), sample, dim, rweight)
411 call disp%show("quan1")
412 call disp%show( quan1 )
413 call disp%show("quan1 = getQuan(neinext, prob(nprob/2), sample, dim, rweight)")
414 quan1 = getQuan(neinext, prob(nprob/2), sample, dim, rweight)
415 call disp%show("quan1")
416 call disp%show( quan1 )
417 call disp%show("quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, rweight)")
418 quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, rweight)
419 call disp%show("quan1")
420 call disp%show( quan1 )
421 call disp%show("quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, rweight)")
422 quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, rweight)
423 call disp%show("quan1")
424 call disp%show( quan1 )
425 call disp%skip()
426 end block
427
428end program example
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
Generate count evenly spaced points over the interval [x1, x2] if x1 < x2, or [x2,...
Generate the natural logarithm of probability density function (PDF) of the univariate Normal distrib...
Generate and return a scalar or array of arbitrary rank of random values from the univariate Normal d...
Generate and return the natural logarithm of the Probability Mass Function (PMF) of the Poisson distr...
Generate and return a scalar (or array of arbitrary rank of) random value(s) from the Poisson distrib...
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
Generate and return the iostat code resulting from writing the input table of rank 1 or 2 to the spec...
Definition: pm_io.F90:5940
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains procedures and generic interfaces for convenient allocation and filling of array...
This module contains procedures and generic interfaces for generating arrays with linear or logarithm...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
Definition: pm_kind.F90:567
type(piwilin_type), parameter piwilin
type(neiprev_type), parameter neiprev
type(neinext_type), parameter neinext
type(neinear_type), parameter neinear
type(neimean_type), parameter neimean
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%
3!1D sample quantile.
4!%%%%%%%%%%%%%%%%%%%
5
6
7sample = [10, 7, 4, 3, 2, 1, 0]
8prob = [0., .25, .5, .75, .9, 1.]
9quan = getQuan(neimean, prob, sample)
10quan
11+0.00000000, +0.500000000, +2.50000000, +5.50000000, +8.50000000, +10.0000000
12quan = getQuan(neinear, prob, sample)
13quan
14+0.00000000, +1.00000000, +2.00000000, +4.00000000, +7.00000000, +10.0000000
15quan = getQuan(neinext, prob, sample)
16quan
17+0.00000000, +1.00000000, +3.00000000, +7.00000000, +10.0000000, +10.0000000
18quan = getQuan(neiprev, prob, sample)
19quan
20+0.00000000, +0.00000000, +2.00000000, +4.00000000, +7.00000000, +10.0000000
21quan = getQuan(piwilin, prob, sample)
22quan
23-1.00000000, +0.749999881, +2.50000000, +4.75000000, +7.89999962, +10.0000000
24do iprob = 1, size(prob)
25 quan(iprob) = getQuan(piwilin, prob(iprob), sample)
26end do
27quan
28-1.00000000, +0.749999881, +2.50000000, +4.75000000, +7.89999962, +10.0000000
29
30
31!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32!1D frequency/reliability-weighted sample quantile.
33!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34
35
36sample = [10, 7, 4, 3, 2, 1, 0]
37iweight = getUnifRand(1, 9, size(sample, 1, IK))
38iweight
39+8, +7, +8, +4, +7, +7, +7
40prob = [0., .25, .5, .75, .9, 1.]
41quan = getQuan(neimean, prob, sample)
42quan
43+0.00000000, +0.500000000, +2.50000000, +5.50000000, +8.50000000, +10.0000000
44quan = getQuan(neinear, prob, sample, iweight)
45quan
46+0.00000000, +1.00000000, +2.00000000, +4.00000000, +7.00000000, +10.0000000
47quan = getQuan(neinext, prob, sample, iweight)
48quan
49+0.00000000, +1.00000000, +3.00000000, +7.00000000, +10.0000000, +10.0000000
50quan = getQuan(neiprev, prob, sample, iweight)
51quan
52+0.00000000, +0.00000000, +2.00000000, +4.00000000, +7.00000000, +10.0000000
53quan = getQuan(piwilin, prob, sample, iweight, sum(iweight))
54quan
55-1.14285719, +0.571428537, +2.24999976, +4.85714197, +7.94285583, +10.0000000
56do iprob = 1, size(prob)
57 quan(iprob) = getQuan(piwilin, prob(iprob), sample, iweight)
58end do
59quan
60-1.14285719, +0.571428537, +2.24999976, +4.85714197, +7.94285583, +10.0000000
61
62
63sample = [10, 7, 4, 3, 2, 1, 0]
64rweight = exp(getNormLogPDF(getFilled(0._TKG, size(sample, 1, IK))))
65rweight
66+0.398942292, +0.398942292, +0.398942292, +0.398942292, +0.398942292, +0.398942292, +0.398942292
67prob = [0., .25, .5, .75, .9, 1.]
68quan = getQuan(neimean, prob, sample)
69quan
70+0.00000000, +0.500000000, +2.50000000, +5.50000000, +8.50000000, +10.0000000
71quan = getQuan(neinear, prob, sample, rweight)
72quan
73+0.00000000, +1.00000000, +2.00000000, +4.00000000, +7.00000000, +10.0000000
74quan = getQuan(neinext, prob, sample, rweight)
75quan
76+0.00000000, +1.00000000, +3.00000000, +7.00000000, +10.0000000, +10.0000000
77quan = getQuan(neiprev, prob, sample, rweight)
78quan
79+0.00000000, +0.00000000, +2.00000000, +4.00000000, +7.00000000, +10.0000000
80quan = getQuan(piwilin, prob, sample, rweight, sum(rweight))
81quan
82-1.00000000, +0.749999881, +2.50000000, +4.75000000, +7.89999962, +10.0000000
83do iprob = 1, size(prob)
84 quan(iprob) = getQuan(piwilin, prob(iprob), sample, rweight)
85end do
86quan
87-1.00000000, +0.749999881, +2.50000000, +4.75000000, +7.89999962, +10.0000000
88
89
90!%%%%%%%%%%%%%%%%%%%
91!2D sample quantile.
92!%%%%%%%%%%%%%%%%%%%
93
94
95dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
96[ndim, nsam, nprob]
97+3, +7, +6
98sample = getPoisRand(getFilled(10., ndim, nsam))
99sample
100+8.00000000, +10.0000000, +14.0000000, +10.0000000, +8.00000000, +11.0000000, +15.0000000
101+12.0000000, +8.00000000, +11.0000000, +13.0000000, +13.0000000, +14.0000000, +14.0000000
102+16.0000000, +3.00000000, +10.0000000, +7.00000000, +14.0000000, +11.0000000, +5.00000000
103prob = getLinSpace(0., 1., nprob)
104prob
105+0.00000000, +0.200000003, +0.400000006, +0.600000024, +0.800000012, +1.00000000
106quan2 = getQuan(neimean, prob, sample, dim)
107quan2
108+8.00000000, +8.00000000, +3.00000000
109+8.00000000, +9.50000000, +4.00000000
110+9.00000000, +11.5000000, +6.00000000
111+10.5000000, +13.0000000, +10.5000000
112+12.5000000, +13.5000000, +12.5000000
113+15.0000000, +14.0000000, +16.0000000
114quan2 = getQuan(neinear, prob, sample, dim)
115quan2
116+8.00000000, +8.00000000, +3.00000000
117+8.00000000, +8.00000000, +3.00000000
118+10.0000000, +12.0000000, +7.00000000
119+10.0000000, +13.0000000, +10.0000000
120+14.0000000, +14.0000000, +14.0000000
121+15.0000000, +14.0000000, +16.0000000
122quan2 = getQuan(neinext, prob, sample, dim)
123quan2
124+8.00000000, +8.00000000, +3.00000000
125+8.00000000, +11.0000000, +5.00000000
126+10.0000000, +12.0000000, +7.00000000
127+11.0000000, +13.0000000, +11.0000000
128+14.0000000, +14.0000000, +14.0000000
129+15.0000000, +14.0000000, +16.0000000
130quan2 = getQuan(neiprev, prob, sample, dim)
131quan2
132+8.00000000, +8.00000000, +3.00000000
133+8.00000000, +8.00000000, +3.00000000
134+8.00000000, +11.0000000, +5.00000000
135+10.0000000, +13.0000000, +10.0000000
136+11.0000000, +13.0000000, +11.0000000
137+15.0000000, +14.0000000, +16.0000000
138quan2 = getQuan(piwilin, prob, sample, dim)
139quan2
140+8.00000000, +5.00000095, +1.00000000
141+8.00000000, +9.19999886, +3.79999971
142+9.60000038, +11.7999992, +6.59999990
143+10.1999998, +13.0000010, +10.1999998
144+12.8000011, +13.6000004, +12.8000011
145+15.0000000, +14.0000000, +16.0000000
146quan1 = getQuan(neimean, prob(nprob/2), sample, dim)
147quan1
148+9.00000000, +11.5000000, +6.00000000
149quan1 = getQuan(neinear, prob(nprob/2), sample, dim)
150quan1
151+10.0000000, +12.0000000, +7.00000000
152quan1 = getQuan(neinext, prob(nprob/2), sample, dim)
153quan1
154+10.0000000, +12.0000000, +7.00000000
155quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)
156quan1
157+8.00000000, +11.0000000, +5.00000000
158quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)
159quan1
160+9.60000038, +11.7999992, +6.59999990
161
162
163dim = 1; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
164[ndim, nsam, nprob]
165+2, +10, +9
166sample = getPoisRand(getFilled(10., nsam, ndim))
167sample
168+12.0000000, +7.00000000
169+6.00000000, +10.0000000
170+8.00000000, +12.0000000
171+10.0000000, +17.0000000
172+10.0000000, +9.00000000
173+5.00000000, +9.00000000
174+16.0000000, +12.0000000
175+12.0000000, +5.00000000
176+8.00000000, +10.0000000
177+8.00000000, +6.00000000
178prob = getLinSpace(0., 1., nprob)
179prob
180+0.00000000, +0.125000000, +0.250000000, +0.375000000, +0.500000000, +0.625000000, +0.750000000, +0.875000000, +1.00000000
181quan2 = getQuan(neimean, prob, sample, dim)
182quan2
183+5.00000000, +5.00000000
184+5.50000000, +5.50000000
185+7.00000000, +6.50000000
186+8.00000000, +8.00000000
187+8.00000000, +9.00000000
188+10.0000000, +10.0000000
189+11.0000000, +11.0000000
190+12.0000000, +12.0000000
191+16.0000000, +17.0000000
192quan2 = getQuan(neinear, prob, sample, dim)
193quan2
194+5.00000000, +5.00000000
195+5.00000000, +5.00000000
196+6.00000000, +6.00000000
197+8.00000000, +9.00000000
198+8.00000000, +9.00000000
199+10.0000000, +10.0000000
200+10.0000000, +10.0000000
201+12.0000000, +12.0000000
202+16.0000000, +17.0000000
203quan2 = getQuan(neinext, prob, sample, dim)
204quan2
205+5.00000000, +5.00000000
206+6.00000000, +6.00000000
207+8.00000000, +7.00000000
208+8.00000000, +9.00000000
209+8.00000000, +9.00000000
210+10.0000000, +10.0000000
211+12.0000000, +12.0000000
212+12.0000000, +12.0000000
213+16.0000000, +17.0000000
214quan2 = getQuan(neiprev, prob, sample, dim)
215quan2
216+5.00000000, +5.00000000
217+5.00000000, +5.00000000
218+6.00000000, +6.00000000
219+8.00000000, +7.00000000
220+8.00000000, +9.00000000
221+10.0000000, +10.0000000
222+10.0000000, +10.0000000
223+12.0000000, +12.0000000
224+16.0000000, +17.0000000
225quan2 = getQuan(piwilin, prob, sample, dim)
226quan2
227+4.00000000, +4.00000000
228+5.25000000, +5.25000000
229+6.99999952, +6.50000000
230+8.00000000, +8.50000000
231+8.00000000, +9.00000000
232+10.0000010, +10.0000010
233+11.0000000, +11.0000000
234+12.0000000, +12.0000000
235+16.0000000, +17.0000000
236quan1 = getQuan(neimean, prob(nprob/2), sample, dim)
237quan1
238+8.00000000, +8.00000000
239quan1 = getQuan(neinear, prob(nprob/2), sample, dim)
240quan1
241+8.00000000, +9.00000000
242quan1 = getQuan(neinext, prob(nprob/2), sample, dim)
243quan1
244+8.00000000, +9.00000000
245quan1 = getQuan(neiprev, prob(nprob/2), sample, dim)
246quan1
247+8.00000000, +7.00000000
248quan1 = getQuan(piwilin, prob(nprob/2), sample, dim)
249quan1
250+8.00000000, +8.50000000
251
252
253!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254!2D frequency/reliability-weighted sample quantile.
255!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256
257
258dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
259[ndim, nsam, nprob]
260+2, +9, +6
261sample = getPoisRand(getFilled(10., ndim, nsam))
262sample
263+8.00000000, +9.00000000, +10.0000000, +10.0000000, +17.0000000, +9.00000000, +6.00000000, +10.0000000, +7.00000000
264+8.00000000, +3.00000000, +15.0000000, +12.0000000, +17.0000000, +10.0000000, +11.0000000, +11.0000000, +7.00000000
265iweight = getUnifRand(1, 9, nsam)
266iweight
267+7, +5, +8, +8, +8, +5, +8, +3, +9
268prob = getLinSpace(0., 1., nprob)
269prob
270+0.00000000, +0.200000003, +0.400000006, +0.600000024, +0.800000012, +1.00000000
271quan2 = getQuan(neimean, prob, sample, dim, iweight)
272quan2
273+6.00000000, +3.00000000
274+7.50000000, +7.50000000
275+8.50000000, +9.00000000
276+9.50000000, +11.0000000
277+10.0000000, +11.5000000
278+17.0000000, +17.0000000
279quan2 = getQuan(neinear, prob, sample, dim, iweight)
280quan2
281+6.00000000, +3.00000000
282+7.00000000, +7.00000000
283+9.00000000, +10.0000000
284+9.00000000, +11.0000000
285+10.0000000, +12.0000000
286+17.0000000, +17.0000000
287quan2 = getQuan(neinext, prob, sample, dim, iweight)
288quan2
289+6.00000000, +3.00000000
290+8.00000000, +8.00000000
291+9.00000000, +10.0000000
292+10.0000000, +11.0000000
293+10.0000000, +12.0000000
294+17.0000000, +17.0000000
295quan2 = getQuan(neiprev, prob, sample, dim, iweight)
296quan2
297+6.00000000, +3.00000000
298+7.00000000, +7.00000000
299+8.00000000, +8.00000000
300+9.00000000, +11.0000000
301+10.0000000, +11.0000000
302+17.0000000, +17.0000000
303quan2 = getQuan(piwilin, prob, sample, dim, iweight)
304quan2
305+4.59999943, -2.60000086
306+7.02500010, +7.02500010
307+8.55000019, +9.10000038
308+9.12000084, +11.0000000
309+10.0000000, +11.9750023
310+17.0000000, +17.0000000
311quan1 = getQuan(neimean, prob(nprob/2), sample, dim, iweight)
312quan1
313+8.50000000, +9.00000000
314quan1 = getQuan(neinear, prob(nprob/2), sample, dim, iweight)
315quan1
316+9.00000000, +10.0000000
317quan1 = getQuan(neinext, prob(nprob/2), sample, dim, iweight)
318quan1
319+9.00000000, +10.0000000
320quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, iweight)
321quan1
322+8.00000000, +8.00000000
323quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, iweight)
324quan1
325+8.55000019, +9.10000038
326
327
328!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329!2D frequency/reliability-weighted sample quantile.
330!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331
332
333dim = 2; ndim = getUnifRand(1, 3); nsam = getUnifRand(5, 10); nprob = getUnifRand(3, 9)
334[ndim, nsam, nprob]
335+2, +10, +6
336sample = getPoisRand(getFilled(10., ndim, nsam))
337sample
338+10.0000000, +13.0000000, +7.00000000, +17.0000000, +7.00000000, +5.00000000, +7.00000000, +12.0000000, +9.00000000, +11.0000000
339+14.0000000, +12.0000000, +8.00000000, +11.0000000, +11.0000000, +11.0000000, +11.0000000, +7.00000000, +6.00000000, +7.00000000
340rweight = getUnifRand(1, 9, nsam)
341rweight
342+6.00000000, +2.00000000, +8.00000000, +9.00000000, +7.00000000, +6.00000000, +2.00000000, +6.00000000, +7.00000000, +1.00000000
343prob = getLinSpace(0., 1., nprob)
344prob
345+0.00000000, +0.200000003, +0.400000006, +0.600000024, +0.800000012, +1.00000000
346quan2 = getQuan(neimean, prob, sample, dim, rweight)
347quan2
348+5.00000000, +6.00000000
349+7.00000000, +7.00000000
350+7.00000000, +7.50000000
351+9.50000000, +11.0000000
352+11.5000000, +11.0000000
353+17.0000000, +14.0000000
354quan2 = getQuan(neinear, prob, sample, dim, rweight)
355quan2
356+5.00000000, +6.00000000
357+7.00000000, +7.00000000
358+7.00000000, +8.00000000
359+9.00000000, +11.0000000
360+12.0000000, +11.0000000
361+17.0000000, +14.0000000
362quan2 = getQuan(neinext, prob, sample, dim, rweight)
363quan2
364+5.00000000, +6.00000000
365+7.00000000, +7.00000000
366+7.00000000, +8.00000000
367+10.0000000, +11.0000000
368+12.0000000, +11.0000000
369+17.0000000, +14.0000000
370quan2 = getQuan(neiprev, prob, sample, dim, rweight)
371quan2
372+5.00000000, +6.00000000
373+7.00000000, +7.00000000
374+7.00000000, +7.00000000
375+9.00000000, +11.0000000
376+11.0000000, +11.0000000
377+17.0000000, +14.0000000
378quan2 = getQuan(piwilin, prob, sample, dim, rweight)
379quan2
380-1.00000000, +3.00000000
381+7.00000000, +7.00000000
382+7.00000048, +7.62222242
383+9.06666756, +11.0000000
384+11.5333347, +11.0000000
385+17.0000000, +14.0000000
386quan1 = getQuan(neimean, prob(nprob/2), sample, dim, rweight)
387quan1
388+7.00000000, +7.50000000
389quan1 = getQuan(neinear, prob(nprob/2), sample, dim, rweight)
390quan1
391+7.00000000, +8.00000000
392quan1 = getQuan(neinext, prob(nprob/2), sample, dim, rweight)
393quan1
394+7.00000000, +8.00000000
395quan1 = getQuan(neiprev, prob(nprob/2), sample, dim, rweight)
396quan1
397+7.00000000, +7.00000000
398quan1 = getQuan(piwilin, prob(nprob/2), sample, dim, rweight)
399quan1
400+7.00000048, +7.62222242
401
402
Test:
test_pm_sampleQuan


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Thursday 2:45 AM, August 19, 2021, Dallas, TX

Definition at line 207 of file pm_sampleQuan.F90.


The documentation for this interface was generated from the following file: