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

Generate and return the (weighted) merged variance of a complex or real sample resulting from the merger of two separate (weighted) samples \(A\) and \(B\).
More...

Detailed Description

Generate and return the (weighted) merged variance of a complex or real sample resulting from the merger of two separate (weighted) samples \(A\) and \(B\).

See the documentation of pm_sampleVar for more information and definition online updating of sample variance.

Note
The input and output variances of this generic interface are all biased variances.
A biased variance can be readily unbiased by multiplying it with the appropriate bias-correction factors detailed in the documentation of pm_sampleVar.
Parameters
[in]varB: The input object of the same type and kind and rank and shape as the input argument varA, containing the biased variance of the second sample that must be merged with the first sample.
[in]varA: The input scalar or vector of shape (1:ndim) of type real of the same kind as that of the input argument meanDiff, containing the biased variance of the first sample that must be merged with the second sample.
[in]meanDiff: The input object of,
  1. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128),
  2. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
containing the difference of mean of the two samples meanDiff = meanA - meanB.
The subtraction order is immaterial.
[in]fracA: The input scalar of type real of the same kind as kind of varA, containing the sum of the weights of all points in sample \(A\) divided by the sum of the weights of all points in the merged sample.
If the sample is unweighted, then fracA is simply size(sampleA) / (size(sampleA) + size(sampleB)).
Returns
varMerged : The output object of the same type and kind and rank and shape as meanDiff, containing the biased variance of the sample resulting form the merger of the two samples.


Possible calling interfaces

! univariate sample
varMerged = getVarMerged(varB, varA, meanDiff, fracA)
! ndim-dimensional sample
varMerged = getVarMerged(varB(1:ndim), varA(1:ndim), meanDiff(1:ndim), fracA)
Generate and return the (weighted) merged variance of a complex or real sample resulting from the mer...
This module contains classes and procedures for computing the properties related to the covariance ma...
Warning
The condition 0 < fracA .and. fracA < 1 must hold for the corresponding input arguments.
The condition size(varB) == size(varA) must hold for the corresponding input arguments.
The condition size(varA) == size(meanDiff) 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.
See also
getCor
setCor
getCov
setCov
getVar
setVar
getMean
setMean
getCovMerged
setCovMerged
getVarMerged
setVarMerged
getMeanMerged
setMeanMerged
setVarMeanMerged


Example usage

1program example
2
3 use pm_kind, only: SK, IK, RK
4 use pm_kind, only: TKG => RKS ! All other real types are also supported.
5 use pm_sampleVar, only: getVar
6 use pm_sampleMean, only: getMean
10 use pm_distUnif, only: getUnifRand
11 use pm_arrayRange, only: getRange
12 use pm_io, only: display_type
13
14 implicit none
15
16 integer(IK) , parameter :: nsam = 2
17 integer(IK) , allocatable :: iweight(:)
18 integer(IK) :: isam, ndim, lb(nsam), ub(nsam)
19 integer(IK) :: dim, itry, ntry = 10
20 type(display_type) :: disp
21 disp = display_type(file = "main.out.F90")
22
23 call disp%skip()
24 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show("!Compute the biased merged variance of a univariate sample.")
26 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27 call disp%skip()
28
29 block
30 real(TKG) :: mean(1:nsam), var(0:nsam), varMerged
31 real(TKG), allocatable :: sample(:)
32 do itry = 1, ntry
33 call disp%skip()
34 call disp%show("lb(1) = 1; ub(1) = getUnifRand(2, 7)")
35 lb(1) = 1; ub(1) = getUnifRand(2, 7)
36 call disp%show("do isam = 2, nsam")
37 call disp%show(" lb(isam) = ub(isam - 1) + 1")
38 call disp%show(" ub(isam) = ub(isam - 1) + getUnifRand(2, 7)")
39 call disp%show("end do")
40 do isam = 2, nsam
41 lb(isam) = ub(isam - 1) + 1
42 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
43 end do
44 call disp%show("lb")
45 call disp%show( lb )
46 call disp%show("ub")
47 call disp%show( ub )
48 call disp%show("sample = getUnifRand(0., 1., ub(nsam))")
49 sample = getUnifRand(0., 1., ub(nsam))
50 call disp%show("sample")
51 call disp%show( sample )
52 call disp%show("var(0) = getVar(sample)")
53 var(0) = getVar(sample)
54 call disp%show("var(0) ! reference")
55 call disp%show( var(0) )
56 call disp%show("do isam = 1, nsam")
57 call disp%show(" var(isam) = getVar(sample(lb(isam):ub(isam)))")
58 call disp%show(" mean(isam) = getMean(sample(lb(isam):ub(isam)))")
59 call disp%show("end do")
60 do isam = 1, nsam
61 var(isam) = getVar(sample(lb(isam):ub(isam)))
62 mean(isam) = getMean(sample(lb(isam):ub(isam)))
63 end do
64 call disp%show("varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))")
65 varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
66 call disp%show("varMerged")
67 call disp%show( varMerged )
68 call disp%show("var(0) ! reference")
69 call disp%show( var(0) )
70 call disp%skip()
71 end do
72 end block
73
74 call disp%skip()
75 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
76 call disp%show("!Compute the biased merged variance of a frequency weighted univariate sample.")
77 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
78 call disp%skip()
79
80 block
81 real(TKG) :: mean(1:nsam), var(0:nsam), varMerged
82 real(TKG), allocatable :: sample(:)
83 do itry = 1, ntry
84 call disp%skip()
85 call disp%show("lb(1) = 1; ub(1) = getUnifRand(2, 7)")
86 lb(1) = 1; ub(1) = getUnifRand(2, 7)
87 call disp%show("do isam = 2, nsam")
88 call disp%show(" lb(isam) = ub(isam - 1) + 1")
89 call disp%show(" ub(isam) = ub(isam - 1) + getUnifRand(2, 7)")
90 call disp%show("end do")
91 do isam = 2, nsam
92 lb(isam) = ub(isam - 1) + 1
93 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
94 end do
95 call disp%show("lb")
96 call disp%show( lb )
97 call disp%show("ub")
98 call disp%show( ub )
99 call disp%show("sample = getUnifRand(0., 1., ub(nsam))")
100 sample = getUnifRand(0., 1., ub(nsam))
101 call disp%show("sample")
102 call disp%show( sample )
103 call disp%show("iweight = getUnifRand(1, 10, size(sample, 1, IK))")
104 iweight = getUnifRand(1, 10, size(sample, 1, IK))
105 call disp%show("iweight")
106 call disp%show( iweight )
107 call disp%show("var(0) = getVar(sample, iweight)")
108 var(0) = getVar(sample, iweight)
109 call disp%show("var(0) ! reference")
110 call disp%show( var(0) )
111 call disp%show("do isam = 1, nsam")
112 call disp%show(" var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))")
113 call disp%show(" mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))")
114 call disp%show("end do")
115 do isam = 1, nsam
116 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
117 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
118 end do
119 call disp%show("varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))")
120 varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
121 call disp%show("varMerged")
122 call disp%show( varMerged )
123 call disp%show("var(0) ! reference")
124 call disp%show( var(0) )
125 call disp%skip()
126 end do
127 end block
128
129 call disp%skip()
130 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
131 call disp%show("!Compute the biased merged variance of a reliability weighted univariate sample.")
132 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
133 call disp%skip()
134
135 block
136 real(TKG) :: mean(1:nsam), var(0:nsam), varMerged
137 real(TKG), allocatable :: sample(:), rweight(:)
138 do itry = 1, ntry
139 call disp%skip()
140 call disp%show("lb(1) = 1; ub(1) = getUnifRand(2, 7)")
141 lb(1) = 1; ub(1) = getUnifRand(2, 7)
142 call disp%show("do isam = 2, nsam")
143 call disp%show(" lb(isam) = ub(isam - 1) + 1")
144 call disp%show(" ub(isam) = ub(isam - 1) + getUnifRand(2, 7)")
145 call disp%show("end do")
146 do isam = 2, nsam
147 lb(isam) = ub(isam - 1) + 1
148 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
149 end do
150 call disp%show("lb")
151 call disp%show( lb )
152 call disp%show("ub")
153 call disp%show( ub )
154 call disp%show("sample = getUnifRand(0., 1., ub(nsam))")
155 sample = getUnifRand(0., 1., ub(nsam))
156 call disp%show("sample")
157 call disp%show( sample )
158 call disp%show("rweight = getUnifRand(1., 2., size(sample, 1, IK))")
159 rweight = getUnifRand(1., 2., size(sample, 1, IK))
160 call disp%show("rweight")
161 call disp%show( rweight )
162 call disp%show("var(0) = getVar(sample, rweight)")
163 var(0) = getVar(sample, rweight)
164 call disp%show("var(0) ! reference")
165 call disp%show( var(0) )
166 call disp%show("do isam = 1, nsam")
167 call disp%show(" var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))")
168 call disp%show(" mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))")
169 call disp%show("end do")
170 do isam = 1, nsam
171 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
172 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
173 end do
174 call disp%show("varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))")
175 varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
176 call disp%show("varMerged")
177 call disp%show( varMerged )
178 call disp%show("var(0) ! reference")
179 call disp%show( var(0) )
180 call disp%skip()
181 end do
182 end block
183
184 call disp%skip()
185 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
186 call disp%show("!Compute the biased merged variance of a multivariate sample.")
187 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
188 call disp%skip()
189
190 block
191 real(TKG), allocatable :: mean(:,:), var(:,:), varMerged(:)
192 real(TKG), allocatable :: sample(:,:)
193 do itry = 1, ntry
194 call disp%skip()
195 call disp%show("dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)")
196 dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
197 call disp%show("do isam = 2, nsam")
198 call disp%show(" lb(isam) = ub(isam - 1) + 1")
199 call disp%show(" ub(isam) = ub(isam - 1) + getUnifRand(2, 7)")
200 call disp%show("end do")
201 do isam = 2, nsam
202 lb(isam) = ub(isam - 1) + 1
203 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
204 end do
205 call disp%show("lb")
206 call disp%show( lb )
207 call disp%show("ub")
208 call disp%show( ub )
209 call disp%show("ndim = getUnifRand(1, minval(ub - lb + 1, 1))")
210 ndim = getUnifRand(1, minval(ub - lb + 1, 1))
211 call disp%show("call setRebound(var, [1_IK, 0_IK], [ndim, nsam])")
212 call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
213 call disp%show("call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])")
214 call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
215 call disp%show("call setResized(varMerged, ndim)")
216 call setResized(varMerged, ndim)
217 call disp%show("sample = getUnifRand(-1., +1., ndim, ub(nsam))")
218 sample = getUnifRand(-1., +1., ndim, ub(nsam))
219 call disp%show("sample")
220 call disp%show( sample )
221 call disp%show("var(:,0) = getVar(sample, dim)")
222 var(:,0) = getVar(sample, dim)
223 call disp%show("var(:,0) ! reference")
224 call disp%show( var(:,0) )
225 call disp%show("do isam = 1, nsam")
226 call disp%show(" var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)")
227 call disp%show(" mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)")
228 call disp%show("end do")
229 do isam = 1, nsam
230 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
231 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
232 end do
233 call disp%show("varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))")
234 varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
235 call disp%show("varMerged")
236 call disp%show( varMerged )
237 call disp%show("var(:,0) ! reference")
238 call disp%show( var(:,0) )
239 call disp%skip()
240 end do
241 end block
242
243 call disp%skip()
244 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
245 call disp%show("!Compute the biased merged variance of a frequency weighted multivariate sample.")
246 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
247 call disp%skip()
248
249 block
250 real(TKG), allocatable :: mean(:,:), var(:,:), varMerged(:)
251 real(TKG), allocatable :: sample(:,:)
252 do itry = 1, ntry
253 call disp%skip()
254 call disp%show("dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)")
255 dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
256 call disp%show("do isam = 2, nsam")
257 call disp%show(" lb(isam) = ub(isam - 1) + 1")
258 call disp%show(" ub(isam) = ub(isam - 1) + getUnifRand(2, 7)")
259 call disp%show("end do")
260 do isam = 2, nsam
261 lb(isam) = ub(isam - 1) + 1
262 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
263 end do
264 call disp%show("lb")
265 call disp%show( lb )
266 call disp%show("ub")
267 call disp%show( ub )
268 call disp%show("ndim = getUnifRand(1, minval(ub - lb + 1, 1))")
269 ndim = getUnifRand(1, minval(ub - lb + 1, 1))
270 call disp%show("call setRebound(var, [1_IK, 0_IK], [ndim, nsam])")
271 call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
272 call disp%show("call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])")
273 call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
274 call disp%show("call setResized(varMerged, ndim)")
275 call setResized(varMerged, ndim)
276 call disp%show("sample = getUnifRand(-1., +1., ndim, ub(nsam))")
277 sample = getUnifRand(-1., +1., ndim, ub(nsam))
278 call disp%show("sample")
279 call disp%show( sample )
280 call disp%show("iweight = getUnifRand(1, 10, size(sample, dim, IK))")
281 iweight = getUnifRand(1, 10, size(sample, dim, IK))
282 call disp%show("iweight")
283 call disp%show( iweight )
284 call disp%show("var(:,0) = getVar(sample, 2_IK, iweight)")
285 var(:,0) = getVar(sample, 2_IK, iweight)
286 call disp%show("var(:,0) ! reference")
287 call disp%show( var(:,0) )
288 call disp%show("do isam = 1, nsam")
289 call disp%show(" var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))")
290 call disp%show(" mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))")
291 call disp%show("end do")
292 do isam = 1, nsam
293 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
294 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
295 end do
296 call disp%show("varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))")
297 varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
298 call disp%show("varMerged")
299 call disp%show( varMerged )
300 call disp%show("var(:,0) ! reference")
301 call disp%show( var(:,0) )
302 call disp%skip()
303 end do
304 end block
305
306 call disp%skip()
307 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
308 call disp%show("!Compute the biased merged variance of a reliability weighted multivariate sample.")
309 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
310 call disp%skip()
311
312 block
313 real(TKG), allocatable :: sample(:,:), mean(:,:)
314 real(TKG), allocatable :: rweight(:), var(:,:), varMerged(:)
315 do itry = 1, ntry
316 call disp%skip()
317 call disp%show("dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)")
318 dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
319 call disp%show("do isam = 2, nsam")
320 call disp%show(" lb(isam) = ub(isam - 1) + 1")
321 call disp%show(" ub(isam) = ub(isam - 1) + getUnifRand(2, 7)")
322 call disp%show("end do")
323 do isam = 2, nsam
324 lb(isam) = ub(isam - 1) + 1
325 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
326 end do
327 call disp%show("lb")
328 call disp%show( lb )
329 call disp%show("ub")
330 call disp%show( ub )
331 call disp%show("ndim = getUnifRand(1, minval(ub - lb + 1, 1))")
332 ndim = getUnifRand(1, minval(ub - lb + 1, 1))
333 call disp%show("call setRebound(var, [1_IK, 0_IK], [ndim, nsam])")
334 call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
335 call disp%show("call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])")
336 call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
337 call disp%show("call setResized(varMerged, ndim)")
338 call setResized(varMerged, ndim)
339 call disp%show("sample = getUnifRand(-1., +1., ndim, ub(nsam))")
340 sample = getUnifRand(-1., +1., ndim, ub(nsam))
341 call disp%show("sample")
342 call disp%show( sample )
343 call disp%show("rweight = getUnifRand(1., 2., size(sample, dim, IK))")
344 rweight = getUnifRand(1., 2., size(sample, dim, IK))
345 call disp%show("rweight")
346 call disp%show( rweight )
347 call disp%show("var(:,0) = getVar(sample, 2_IK, rweight)")
348 var(:,0) = getVar(sample, 2_IK, rweight)
349 call disp%show("var(:,0) ! reference")
350 call disp%show( var(:,0) )
351 call disp%show("do isam = 1, nsam")
352 call disp%show(" var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))")
353 call disp%show(" mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))")
354 call disp%show("end do")
355 do isam = 1, nsam
356 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
357 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
358 end do
359 call disp%show("varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))")
360 varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
361 call disp%show("varMerged")
362 call disp%show( varMerged )
363 call disp%show("var(:,0) ! reference")
364 call disp%show( var(:,0) )
365 call disp%skip()
366 end do
367 end block
368
369end program example
Generate minimally-spaced character, integer, real sequences or sequences at fixed intervals of size ...
Resize (shrink or expand) an input allocatable array of rank 1..3 to arbitrary new lower and upper bo...
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
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
Generate and return the (weighted) mean of an input sample of nsam observations with ndim = 1 or 2 at...
Generate and return the variance of the input sample of type complex or real of shape (nsam) or (ndim...
This module contains procedures and generic interfaces for generating ranges of discrete character,...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
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 RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
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
This module contains classes and procedures for computing the first moment (i.e., the statistical mea...
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!Compute the biased merged variance of a univariate sample.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7lb(1) = 1; ub(1) = getUnifRand(2, 7)
8do isam = 2, nsam
9 lb(isam) = ub(isam - 1) + 1
10 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
11end do
12lb
13+1, +8
14ub
15+7, +12
16sample = getUnifRand(0., 1., ub(nsam))
17sample
18+0.365969598, +0.539367974, +0.860647857, +0.669404268, +0.639917970, +0.934130669, +0.761378646, +0.769686580, +0.910623789, +0.107624352, +0.204128623E-1, +0.404817104
19var(0) = getVar(sample)
20var(0) ! reference
21+0.840269998E-1
22do isam = 1, nsam
23 var(isam) = getVar(sample(lb(isam):ub(isam)))
24 mean(isam) = getMean(sample(lb(isam):ub(isam)))
25end do
26varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
27varMerged
28+0.840269998E-1
29var(0) ! reference
30+0.840269998E-1
31
32
33lb(1) = 1; ub(1) = getUnifRand(2, 7)
34do isam = 2, nsam
35 lb(isam) = ub(isam - 1) + 1
36 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
37end do
38lb
39+1, +5
40ub
41+4, +11
42sample = getUnifRand(0., 1., ub(nsam))
43sample
44+0.891571641E-1, +0.317646980, +0.591190279, +0.989820838, +0.288057327E-2, +0.923178732, +0.856376529, +0.651625335, +0.543845952, +0.681804121, +0.401710033
45var(0) = getVar(sample)
46var(0) ! reference
47+0.948817730E-1
48do isam = 1, nsam
49 var(isam) = getVar(sample(lb(isam):ub(isam)))
50 mean(isam) = getMean(sample(lb(isam):ub(isam)))
51end do
52varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
53varMerged
54+0.948817730E-1
55var(0) ! reference
56+0.948817730E-1
57
58
59lb(1) = 1; ub(1) = getUnifRand(2, 7)
60do isam = 2, nsam
61 lb(isam) = ub(isam - 1) + 1
62 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
63end do
64lb
65+1, +8
66ub
67+7, +10
68sample = getUnifRand(0., 1., ub(nsam))
69sample
70+0.549304366, +0.507123470E-1, +0.278680503, +0.427578390, +0.692629993, +0.272925079, +0.277589381, +0.598483503, +0.275083840, +0.243517518
71var(0) = getVar(sample)
72var(0) ! reference
73+0.344901979E-1
74do isam = 1, nsam
75 var(isam) = getVar(sample(lb(isam):ub(isam)))
76 mean(isam) = getMean(sample(lb(isam):ub(isam)))
77end do
78varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
79varMerged
80+0.344901942E-1
81var(0) ! reference
82+0.344901979E-1
83
84
85lb(1) = 1; ub(1) = getUnifRand(2, 7)
86do isam = 2, nsam
87 lb(isam) = ub(isam - 1) + 1
88 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
89end do
90lb
91+1, +8
92ub
93+7, +13
94sample = getUnifRand(0., 1., ub(nsam))
95sample
96+0.635099828, +0.994973958, +0.706785679, +0.517038107, +0.955167711, +0.644648612, +0.403783441, +0.643406510, +0.512327194, +0.206679702E-1, +0.994967818E-1, +0.920399427E-1, +0.567415178
97var(0) = getVar(sample)
98var(0) ! reference
99+0.860706717E-1
100do isam = 1, nsam
101 var(isam) = getVar(sample(lb(isam):ub(isam)))
102 mean(isam) = getMean(sample(lb(isam):ub(isam)))
103end do
104varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
105varMerged
106+0.860706717E-1
107var(0) ! reference
108+0.860706717E-1
109
110
111lb(1) = 1; ub(1) = getUnifRand(2, 7)
112do isam = 2, nsam
113 lb(isam) = ub(isam - 1) + 1
114 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
115end do
116lb
117+1, +4
118ub
119+3, +10
120sample = getUnifRand(0., 1., ub(nsam))
121sample
122+0.127256453, +0.323118567E-1, +0.867960989, +0.121276140, +0.780102551, +0.505891681, +0.692693591, +0.235909045, +0.668296993, +0.820031404
123var(0) = getVar(sample)
124var(0) ! reference
125+0.950409621E-1
126do isam = 1, nsam
127 var(isam) = getVar(sample(lb(isam):ub(isam)))
128 mean(isam) = getMean(sample(lb(isam):ub(isam)))
129end do
130varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
131varMerged
132+0.950409546E-1
133var(0) ! reference
134+0.950409621E-1
135
136
137lb(1) = 1; ub(1) = getUnifRand(2, 7)
138do isam = 2, nsam
139 lb(isam) = ub(isam - 1) + 1
140 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
141end do
142lb
143+1, +3
144ub
145+2, +7
146sample = getUnifRand(0., 1., ub(nsam))
147sample
148+0.138990223, +0.164124370E-1, +0.659975231, +0.816543758, +0.326628506, +0.369476438, +0.718675852E-1
149var(0) = getVar(sample)
150var(0) ! reference
151+0.782111436E-1
152do isam = 1, nsam
153 var(isam) = getVar(sample(lb(isam):ub(isam)))
154 mean(isam) = getMean(sample(lb(isam):ub(isam)))
155end do
156varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
157varMerged
158+0.782111585E-1
159var(0) ! reference
160+0.782111436E-1
161
162
163lb(1) = 1; ub(1) = getUnifRand(2, 7)
164do isam = 2, nsam
165 lb(isam) = ub(isam - 1) + 1
166 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
167end do
168lb
169+1, +3
170ub
171+2, +5
172sample = getUnifRand(0., 1., ub(nsam))
173sample
174+0.747892261, +0.292134821, +0.224555314, +0.347658992, +0.881615758
175var(0) = getVar(sample)
176var(0) ! reference
177+0.698718205E-1
178do isam = 1, nsam
179 var(isam) = getVar(sample(lb(isam):ub(isam)))
180 mean(isam) = getMean(sample(lb(isam):ub(isam)))
181end do
182varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
183varMerged
184+0.698718205E-1
185var(0) ! reference
186+0.698718205E-1
187
188
189lb(1) = 1; ub(1) = getUnifRand(2, 7)
190do isam = 2, nsam
191 lb(isam) = ub(isam - 1) + 1
192 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
193end do
194lb
195+1, +4
196ub
197+3, +8
198sample = getUnifRand(0., 1., ub(nsam))
199sample
200+0.388197541, +0.239570796, +0.423648715, +0.863466620, +0.826491952, +0.997288525, +0.358664215, +0.289916992E-3
201var(0) = getVar(sample)
202var(0) ! reference
203+0.105081044
204do isam = 1, nsam
205 var(isam) = getVar(sample(lb(isam):ub(isam)))
206 mean(isam) = getMean(sample(lb(isam):ub(isam)))
207end do
208varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
209varMerged
210+0.105081037
211var(0) ! reference
212+0.105081044
213
214
215lb(1) = 1; ub(1) = getUnifRand(2, 7)
216do isam = 2, nsam
217 lb(isam) = ub(isam - 1) + 1
218 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
219end do
220lb
221+1, +6
222ub
223+5, +9
224sample = getUnifRand(0., 1., ub(nsam))
225sample
226+0.578138411, +0.826375186, +0.332468510, +0.586797655, +0.663269103, +0.832929969, +0.983767748, +0.220828533, +0.234472811
227var(0) = getVar(sample)
228var(0) ! reference
229+0.671313033E-1
230do isam = 1, nsam
231 var(isam) = getVar(sample(lb(isam):ub(isam)))
232 mean(isam) = getMean(sample(lb(isam):ub(isam)))
233end do
234varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
235varMerged
236+0.671313033E-1
237var(0) ! reference
238+0.671313033E-1
239
240
241lb(1) = 1; ub(1) = getUnifRand(2, 7)
242do isam = 2, nsam
243 lb(isam) = ub(isam - 1) + 1
244 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
245end do
246lb
247+1, +5
248ub
249+4, +10
250sample = getUnifRand(0., 1., ub(nsam))
251sample
252+0.671956599, +0.629860103, +0.177184701, +0.887980044, +0.434041619, +0.608365059, +0.628340721, +0.341608107, +0.694782138E-1, +0.421007276E-1
253var(0) = getVar(sample)
254var(0) ! reference
255+0.727927834E-1
256do isam = 1, nsam
257 var(isam) = getVar(sample(lb(isam):ub(isam)))
258 mean(isam) = getMean(sample(lb(isam):ub(isam)))
259end do
260varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), ub(1) / real(ub(2), TKG))
261varMerged
262+0.727927908E-1
263var(0) ! reference
264+0.727927834E-1
265
266
267!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268!Compute the biased merged variance of a frequency weighted univariate sample.
269!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270
271
272lb(1) = 1; ub(1) = getUnifRand(2, 7)
273do isam = 2, nsam
274 lb(isam) = ub(isam - 1) + 1
275 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
276end do
277lb
278+1, +4
279ub
280+3, +6
281sample = getUnifRand(0., 1., ub(nsam))
282sample
283+0.192155838, +0.215730846, +0.244340599, +0.760361016, +0.366439998, +0.792468250
284iweight = getUnifRand(1, 10, size(sample, 1, IK))
285iweight
286+1, +7, +4, +1, +2, +9
287var(0) = getVar(sample, iweight)
288var(0) ! reference
289+0.739608407E-1
290do isam = 1, nsam
291 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
292 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
293end do
294varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
295varMerged
296+0.739608333E-1
297var(0) ! reference
298+0.739608407E-1
299
300
301lb(1) = 1; ub(1) = getUnifRand(2, 7)
302do isam = 2, nsam
303 lb(isam) = ub(isam - 1) + 1
304 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
305end do
306lb
307+1, +3
308ub
309+2, +8
310sample = getUnifRand(0., 1., ub(nsam))
311sample
312+0.185890496, +0.705393016, +0.708951175, +0.382265210, +0.243085206, +0.628276885, +0.576271594, +0.778601766E-1
313iweight = getUnifRand(1, 10, size(sample, 1, IK))
314iweight
315+1, +2, +2, +2, +2, +8, +1, +5
316var(0) = getVar(sample, iweight)
317var(0) ! reference
318+0.604952313E-1
319do isam = 1, nsam
320 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
321 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
322end do
323varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
324varMerged
325+0.604952350E-1
326var(0) ! reference
327+0.604952313E-1
328
329
330lb(1) = 1; ub(1) = getUnifRand(2, 7)
331do isam = 2, nsam
332 lb(isam) = ub(isam - 1) + 1
333 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
334end do
335lb
336+1, +3
337ub
338+2, +4
339sample = getUnifRand(0., 1., ub(nsam))
340sample
341+0.415813923E-2, +0.174619198, +0.167224348, +0.997489572
342iweight = getUnifRand(1, 10, size(sample, 1, IK))
343iweight
344+9, +3, +4, +6
345var(0) = getVar(sample, iweight)
346var(0) ! reference
347+0.173051462
348do isam = 1, nsam
349 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
350 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
351end do
352varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
353varMerged
354+0.173051462
355var(0) ! reference
356+0.173051462
357
358
359lb(1) = 1; ub(1) = getUnifRand(2, 7)
360do isam = 2, nsam
361 lb(isam) = ub(isam - 1) + 1
362 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
363end do
364lb
365+1, +3
366ub
367+2, +9
368sample = getUnifRand(0., 1., ub(nsam))
369sample
370+0.768472910, +0.586231112, +0.418836236, +0.253783464, +0.916766822, +0.117777646, +0.934052646, +0.425538063, +0.554310918
371iweight = getUnifRand(1, 10, size(sample, 1, IK))
372iweight
373+2, +2, +3, +2, +8, +1, +3, +1, +6
374var(0) = getVar(sample, iweight)
375var(0) ! reference
376+0.609881021E-1
377do isam = 1, nsam
378 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
379 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
380end do
381varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
382varMerged
383+0.609881058E-1
384var(0) ! reference
385+0.609881021E-1
386
387
388lb(1) = 1; ub(1) = getUnifRand(2, 7)
389do isam = 2, nsam
390 lb(isam) = ub(isam - 1) + 1
391 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
392end do
393lb
394+1, +6
395ub
396+5, +9
397sample = getUnifRand(0., 1., ub(nsam))
398sample
399+0.403336704, +0.437636077, +0.112331212, +0.430452704, +0.875146091, +0.120087147, +0.333021164, +0.831938624, +0.318392038
400iweight = getUnifRand(1, 10, size(sample, 1, IK))
401iweight
402+10, +8, +2, +4, +7, +6, +2, +9, +1
403var(0) = getVar(sample, iweight)
404var(0) ! reference
405+0.688609034E-1
406do isam = 1, nsam
407 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
408 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
409end do
410varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
411varMerged
412+0.688609034E-1
413var(0) ! reference
414+0.688609034E-1
415
416
417lb(1) = 1; ub(1) = getUnifRand(2, 7)
418do isam = 2, nsam
419 lb(isam) = ub(isam - 1) + 1
420 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
421end do
422lb
423+1, +3
424ub
425+2, +5
426sample = getUnifRand(0., 1., ub(nsam))
427sample
428+0.499932528, +0.195486009, +0.106252372, +0.968675613E-1, +0.156602442
429iweight = getUnifRand(1, 10, size(sample, 1, IK))
430iweight
431+6, +5, +1, +3, +2
432var(0) = getVar(sample, iweight)
433var(0) ! reference
434+0.286398139E-1
435do isam = 1, nsam
436 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
437 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
438end do
439varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
440varMerged
441+0.286398157E-1
442var(0) ! reference
443+0.286398139E-1
444
445
446lb(1) = 1; ub(1) = getUnifRand(2, 7)
447do isam = 2, nsam
448 lb(isam) = ub(isam - 1) + 1
449 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
450end do
451lb
452+1, +4
453ub
454+3, +10
455sample = getUnifRand(0., 1., ub(nsam))
456sample
457+0.473103821, +0.804166555, +0.371435285, +0.185356438, +0.802984834, +0.267572820, +0.237235248, +0.869830072, +0.413538218, +0.836687207
458iweight = getUnifRand(1, 10, size(sample, 1, IK))
459iweight
460+3, +4, +1, +4, +8, +9, +1, +10, +10, +5
461var(0) = getVar(sample, iweight)
462var(0) ! reference
463+0.680362508E-1
464do isam = 1, nsam
465 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
466 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
467end do
468varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
469varMerged
470+0.680362433E-1
471var(0) ! reference
472+0.680362508E-1
473
474
475lb(1) = 1; ub(1) = getUnifRand(2, 7)
476do isam = 2, nsam
477 lb(isam) = ub(isam - 1) + 1
478 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
479end do
480lb
481+1, +3
482ub
483+2, +7
484sample = getUnifRand(0., 1., ub(nsam))
485sample
486+0.517180562E-1, +0.344385505E-1, +0.442240477, +0.325714469, +0.817954063, +0.824210465, +0.619122744
487iweight = getUnifRand(1, 10, size(sample, 1, IK))
488iweight
489+3, +9, +2, +1, +1, +10, +9
490var(0) = getVar(sample, iweight)
491var(0) ! reference
492+0.109426953
493do isam = 1, nsam
494 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
495 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
496end do
497varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
498varMerged
499+0.109426960
500var(0) ! reference
501+0.109426953
502
503
504lb(1) = 1; ub(1) = getUnifRand(2, 7)
505do isam = 2, nsam
506 lb(isam) = ub(isam - 1) + 1
507 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
508end do
509lb
510+1, +5
511ub
512+4, +6
513sample = getUnifRand(0., 1., ub(nsam))
514sample
515+0.302187026, +0.403615534, +0.636334836, +0.439223647, +0.608977139, +0.551796615
516iweight = getUnifRand(1, 10, size(sample, 1, IK))
517iweight
518+7, +1, +8, +1, +5, +6
519var(0) = getVar(sample, iweight)
520var(0) ! reference
521+0.180437546E-1
522do isam = 1, nsam
523 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
524 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
525end do
526varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
527varMerged
528+0.180437528E-1
529var(0) ! reference
530+0.180437546E-1
531
532
533lb(1) = 1; ub(1) = getUnifRand(2, 7)
534do isam = 2, nsam
535 lb(isam) = ub(isam - 1) + 1
536 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
537end do
538lb
539+1, +8
540ub
541+7, +11
542sample = getUnifRand(0., 1., ub(nsam))
543sample
544+0.630253553, +0.915598571, +0.574551821E-1, +0.878818750, +0.508635521, +0.545359790, +0.559843779E-1, +0.117216945, +0.880172908, +0.529791057, +0.784381747
545iweight = getUnifRand(1, 10, size(sample, 1, IK))
546iweight
547+8, +3, +6, +1, +8, +7, +1, +5, +9, +1, +9
548var(0) = getVar(sample, iweight)
549var(0) ! reference
550+0.804087371E-1
551do isam = 1, nsam
552 var(isam) = getVar(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
553 mean(isam) = getMean(sample(lb(isam):ub(isam)), iweight(lb(isam):ub(isam)))
554end do
555varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
556varMerged
557+0.804087296E-1
558var(0) ! reference
559+0.804087371E-1
560
561
562!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
563!Compute the biased merged variance of a reliability weighted univariate sample.
564!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
565
566
567lb(1) = 1; ub(1) = getUnifRand(2, 7)
568do isam = 2, nsam
569 lb(isam) = ub(isam - 1) + 1
570 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
571end do
572lb
573+1, +8
574ub
575+7, +9
576sample = getUnifRand(0., 1., ub(nsam))
577sample
578+0.911826611, +0.678420842, +0.241578221, +0.291455209, +0.881421745, +0.462833643, +0.529112577, +0.102979422, +0.205452263
579rweight = getUnifRand(1., 2., size(sample, 1, IK))
580rweight
581+1.12894595, +1.98632443, +1.10174203, +1.31219566, +1.29628932, +1.80648267, +1.92742968, +1.41125298, +1.57952511
582var(0) = getVar(sample, rweight)
583var(0) ! reference
584+0.687604100E-1
585do isam = 1, nsam
586 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
587 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
588end do
589varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
590varMerged
591+0.687604100E-1
592var(0) ! reference
593+0.687604100E-1
594
595
596lb(1) = 1; ub(1) = getUnifRand(2, 7)
597do isam = 2, nsam
598 lb(isam) = ub(isam - 1) + 1
599 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
600end do
601lb
602+1, +5
603ub
604+4, +9
605sample = getUnifRand(0., 1., ub(nsam))
606sample
607+0.892997205, +0.973314822, +0.266717613, +0.949708164, +0.277200639, +0.874832392, +0.977554679, +0.665105820, +0.217965484
608rweight = getUnifRand(1., 2., size(sample, 1, IK))
609rweight
610+1.70789027, +1.55572355, +1.11108840, +1.58028388, +1.53585505, +1.16611719, +1.23605156, +1.70818591, +1.33596683
611var(0) = getVar(sample, rweight)
612var(0) ! reference
613+0.930187553E-1
614do isam = 1, nsam
615 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
616 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
617end do
618varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
619varMerged
620+0.930187702E-1
621var(0) ! reference
622+0.930187553E-1
623
624
625lb(1) = 1; ub(1) = getUnifRand(2, 7)
626do isam = 2, nsam
627 lb(isam) = ub(isam - 1) + 1
628 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
629end do
630lb
631+1, +8
632ub
633+7, +10
634sample = getUnifRand(0., 1., ub(nsam))
635sample
636+0.762252808E-1, +0.726244450E-1, +0.747029185, +0.969027877, +0.935334861, +0.989501536, +0.640519679, +0.570739210, +0.515088022, +0.572620869
637rweight = getUnifRand(1., 2., size(sample, 1, IK))
638rweight
639+1.41976547, +1.06699586, +1.46102047, +1.67751622, +1.08413863, +1.15341854, +1.15464854, +1.84910917, +1.43810034, +1.45353150
640var(0) = getVar(sample, rweight)
641var(0) ! reference
642+0.912902877E-1
643do isam = 1, nsam
644 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
645 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
646end do
647varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
648varMerged
649+0.912903026E-1
650var(0) ! reference
651+0.912902877E-1
652
653
654lb(1) = 1; ub(1) = getUnifRand(2, 7)
655do isam = 2, nsam
656 lb(isam) = ub(isam - 1) + 1
657 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
658end do
659lb
660+1, +4
661ub
662+3, +5
663sample = getUnifRand(0., 1., ub(nsam))
664sample
665+0.178883016, +0.933498085, +0.399465799, +0.527028441E-1, +0.970194817
666rweight = getUnifRand(1., 2., size(sample, 1, IK))
667rweight
668+1.79133403, +1.94495845, +1.75885487, +1.83700788, +1.50504875
669var(0) = getVar(sample, rweight)
670var(0) ! reference
671+0.143508106
672do isam = 1, nsam
673 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
674 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
675end do
676varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
677varMerged
678+0.143508106
679var(0) ! reference
680+0.143508106
681
682
683lb(1) = 1; ub(1) = getUnifRand(2, 7)
684do isam = 2, nsam
685 lb(isam) = ub(isam - 1) + 1
686 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
687end do
688lb
689+1, +4
690ub
691+3, +5
692sample = getUnifRand(0., 1., ub(nsam))
693sample
694+0.365253389, +0.311100841, +0.563895702, +0.103803277, +0.832665324
695rweight = getUnifRand(1., 2., size(sample, 1, IK))
696rweight
697+1.27340698, +1.69329238, +1.98719263, +1.65814424, +1.58595431
698var(0) = getVar(sample, rweight)
699var(0) ! reference
700+0.607101247E-1
701do isam = 1, nsam
702 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
703 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
704end do
705varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
706varMerged
707+0.607101172E-1
708var(0) ! reference
709+0.607101247E-1
710
711
712lb(1) = 1; ub(1) = getUnifRand(2, 7)
713do isam = 2, nsam
714 lb(isam) = ub(isam - 1) + 1
715 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
716end do
717lb
718+1, +4
719ub
720+3, +10
721sample = getUnifRand(0., 1., ub(nsam))
722sample
723+0.909076452, +0.518222034, +0.436950326, +0.654068232, +0.522867918, +0.790539801, +0.350945711, +0.834322810, +0.449866116, +0.610065579
724rweight = getUnifRand(1., 2., size(sample, 1, IK))
725rweight
726+1.92141294, +1.56948042, +1.43730164, +1.53060627, +1.59464717, +1.34180748, +1.91020441, +1.82805824, +1.76202059, +1.00744009
727var(0) = getVar(sample, rweight)
728var(0) ! reference
729+0.347288698E-1
730do isam = 1, nsam
731 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
732 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
733end do
734varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
735varMerged
736+0.347288661E-1
737var(0) ! reference
738+0.347288698E-1
739
740
741lb(1) = 1; ub(1) = getUnifRand(2, 7)
742do isam = 2, nsam
743 lb(isam) = ub(isam - 1) + 1
744 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
745end do
746lb
747+1, +3
748ub
749+2, +5
750sample = getUnifRand(0., 1., ub(nsam))
751sample
752+0.658622622, +0.334244370, +0.122356057, +0.504886746, +0.857854366
753rweight = getUnifRand(1., 2., size(sample, 1, IK))
754rweight
755+1.53603125, +1.08443141, +1.44010758, +1.10636520, +1.67062020
756var(0) = getVar(sample, rweight)
757var(0) ! reference
758+0.710145757E-1
759do isam = 1, nsam
760 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
761 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
762end do
763varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
764varMerged
765+0.710145757E-1
766var(0) ! reference
767+0.710145757E-1
768
769
770lb(1) = 1; ub(1) = getUnifRand(2, 7)
771do isam = 2, nsam
772 lb(isam) = ub(isam - 1) + 1
773 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
774end do
775lb
776+1, +4
777ub
778+3, +8
779sample = getUnifRand(0., 1., ub(nsam))
780sample
781+0.932872117, +0.641629338, +0.877119541, +0.446920037, +0.709850550, +0.757925570, +0.830348372, +0.669314921
782rweight = getUnifRand(1., 2., size(sample, 1, IK))
783rweight
784+1.14050269, +1.08093762, +1.51856613, +1.80405986, +1.21332240, +1.72392678, +1.32793570, +1.48838687
785var(0) = getVar(sample, rweight)
786var(0) ! reference
787+0.223825574E-1
788do isam = 1, nsam
789 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
790 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
791end do
792varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
793varMerged
794+0.223825593E-1
795var(0) ! reference
796+0.223825574E-1
797
798
799lb(1) = 1; ub(1) = getUnifRand(2, 7)
800do isam = 2, nsam
801 lb(isam) = ub(isam - 1) + 1
802 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
803end do
804lb
805+1, +4
806ub
807+3, +10
808sample = getUnifRand(0., 1., ub(nsam))
809sample
810+0.167209864, +0.598109961E-1, +0.134212732, +0.333488286, +0.864756107E-1, +0.670296252, +0.977488756E-1, +0.655621290E-2, +0.124229550, +0.411810398
811rweight = getUnifRand(1., 2., size(sample, 1, IK))
812rweight
813+1.62893629, +1.45038533, +1.80866027, +1.38803196, +1.90581834, +1.95609832, +1.21783710, +1.99536443, +1.49530077, +1.21245432
814var(0) = getVar(sample, rweight)
815var(0) ! reference
816+0.416639149E-1
817do isam = 1, nsam
818 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
819 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
820end do
821varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
822varMerged
823+0.416639261E-1
824var(0) ! reference
825+0.416639149E-1
826
827
828lb(1) = 1; ub(1) = getUnifRand(2, 7)
829do isam = 2, nsam
830 lb(isam) = ub(isam - 1) + 1
831 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
832end do
833lb
834+1, +8
835ub
836+7, +12
837sample = getUnifRand(0., 1., ub(nsam))
838sample
839+0.120754421, +0.594324768, +0.387402773, +0.882316947, +0.362297416, +0.400876224, +0.964011550, +0.608533800, +0.575663090, +0.269784451, +0.296675801, +0.120380878
840rweight = getUnifRand(1., 2., size(sample, 1, IK))
841rweight
842+1.58186078, +1.94900036, +1.31332421, +1.22539473, +1.75035024, +1.06165195, +1.20171714, +1.13796735, +1.01178527, +1.96979940, +1.91439486, +1.14375329
843var(0) = getVar(sample, rweight)
844var(0) ! reference
845+0.612387210E-1
846do isam = 1, nsam
847 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
848 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
849end do
850varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
851varMerged
852+0.612387173E-1
853var(0) ! reference
854+0.612387210E-1
855
856
857!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
858!Compute the biased merged variance of a multivariate sample.
859!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860
861
862dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
863do isam = 2, nsam
864 lb(isam) = ub(isam - 1) + 1
865 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
866end do
867lb
868+1, +7
869ub
870+6, +11
871ndim = getUnifRand(1, minval(ub - lb + 1, 1))
872call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
873call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
874call setResized(varMerged, ndim)
875sample = getUnifRand(-1., +1., ndim, ub(nsam))
876sample
877+0.822533369, -0.201804757, +0.185117960, +0.926655412, +0.898510456, +0.854184985, -0.198894858, +0.246800184, +0.257098556, -0.657779813, +0.649523735E-1
878-0.269520998, -0.244022012, -0.495082617, -0.118978500, +0.675124764, -0.604276538, +0.977416039E-1, -0.935224771, -0.769565582, -0.327815652, -0.323675990
879var(:,0) = getVar(sample, dim)
880var(:,0) ! reference
881+0.256479889, +0.172895908
882do isam = 1, nsam
883 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
884 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
885end do
886varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
887varMerged
888+0.256479919, +0.172895879
889var(:,0) ! reference
890+0.256479889, +0.172895908
891
892
893dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
894do isam = 2, nsam
895 lb(isam) = ub(isam - 1) + 1
896 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
897end do
898lb
899+1, +7
900ub
901+6, +10
902ndim = getUnifRand(1, minval(ub - lb + 1, 1))
903call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
904call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
905call setResized(varMerged, ndim)
906sample = getUnifRand(-1., +1., ndim, ub(nsam))
907sample
908+0.784901023, -0.886325717, +0.452937007, -0.742119551E-1, -0.546293736, +0.917783022, +0.463622808, +0.296071410, -0.133958697, +0.855198860
909-0.178349018E-2, -0.318868160, +0.616620779, +0.812220573E-2, +0.662694097, +0.828704715, +0.459209561, -0.170265436E-1, -0.973475456, +0.563909769
910var(:,0) = getVar(sample, dim)
911var(:,0) ! reference
912+0.335140675, +0.275049657
913do isam = 1, nsam
914 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
915 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
916end do
917varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
918varMerged
919+0.335140675, +0.275049627
920var(:,0) ! reference
921+0.335140675, +0.275049657
922
923
924dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
925do isam = 2, nsam
926 lb(isam) = ub(isam - 1) + 1
927 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
928end do
929lb
930+1, +8
931ub
932+7, +11
933ndim = getUnifRand(1, minval(ub - lb + 1, 1))
934call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
935call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
936call setResized(varMerged, ndim)
937sample = getUnifRand(-1., +1., ndim, ub(nsam))
938sample
939-0.771070242, +0.114753842, -0.316683888, -0.300210595, +0.403383136, +0.710779905, -0.787927747, -0.677094460E-1, -0.589005709, -0.976577401, -0.160291910
940+0.437226176, +0.736133933, -0.754325032, -0.116185308, -0.636162400, -0.482977629E-1, +0.594291925, -0.546994328, +0.868991137, +0.338348985, -0.172033668
941+0.221798420E-1, +0.999202132, +0.744336605, +0.401337624, +0.854566097E-1, +0.143545985, -0.813827395, -0.670041323, +0.722679019, +0.192085505, -0.812834501E-1
942-0.917914629, -0.830164075, -0.597445130, +0.185401440, +0.901916027, -0.490061164, -0.965566635E-1, +0.884055257, +0.676346183, -0.291362405, -0.378295302
943var(:,0) = getVar(sample, dim)
944var(:,0) ! reference
945+0.248637274, +0.293594152, +0.285629094, +0.397294104
946do isam = 1, nsam
947 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
948 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
949end do
950varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
951varMerged
952+0.248637319, +0.293594152, +0.285629094, +0.397294074
953var(:,0) ! reference
954+0.248637274, +0.293594152, +0.285629094, +0.397294104
955
956
957dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
958do isam = 2, nsam
959 lb(isam) = ub(isam - 1) + 1
960 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
961end do
962lb
963+1, +6
964ub
965+5, +12
966ndim = getUnifRand(1, minval(ub - lb + 1, 1))
967call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
968call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
969call setResized(varMerged, ndim)
970sample = getUnifRand(-1., +1., ndim, ub(nsam))
971sample
972+0.907283187, +0.895410895, +0.629059315, -0.562860847, +0.839654565, -0.659306049, -0.726124048, -0.473100781, +0.676214695E-1, +0.378771424, -0.253709197, +0.327527642
973+0.317063570, -0.187385082E-2, -0.681246638, +0.315501690, +0.625920057, -0.330458879E-1, -0.609752417, -0.734395981, +0.196926594, -0.786827326, +0.898350477, +0.845467329
974-0.897233605, +0.404576778, -0.795149207, +0.408176303, +0.347421646, -0.169090033E-1, +0.286790609, +0.283926129, +0.659218550, -0.810095549, -0.459394097, +0.146639347
975-0.554223537, +0.256314039, -0.358138800, -0.459490180, +0.668642998, +0.654584765, +0.774138689, -0.129163146, -0.451373935, +0.702569485, -0.544707775, +0.555702567
976-0.137287259, -0.135267258, -0.466312408, -0.619010925E-1, -0.324093103E-1, -0.110737085, -0.806897879E-1, -0.446021676, -0.330206275, -0.725614309, -0.888796568, -0.493605852
977var(:,0) = getVar(sample, dim)
978var(:,0) ! reference
979+0.365954876, +0.344797492, +0.279876530, +0.283589393, +0.727569461E-1
980do isam = 1, nsam
981 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
982 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
983end do
984varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
985varMerged
986+0.365954936, +0.344797522, +0.279876560, +0.283589393, +0.727569610E-1
987var(:,0) ! reference
988+0.365954876, +0.344797492, +0.279876530, +0.283589393, +0.727569461E-1
989
990
991dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
992do isam = 2, nsam
993 lb(isam) = ub(isam - 1) + 1
994 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
995end do
996lb
997+1, +5
998ub
999+4, +10
1000ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1001call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1002call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1003call setResized(varMerged, ndim)
1004sample = getUnifRand(-1., +1., ndim, ub(nsam))
1005sample
1006+0.837407947, -0.291133165, +0.730831504, +0.181254148E-1, +0.238177776, +0.837677240, -0.703911781E-1, +0.943988085, -0.955191851E-1, -0.292454958E-1
1007-0.874317527, -0.965081692, +0.829295158, +0.738942623E-1, -0.363408327, +0.474955320, +0.742375135, -0.513280034, +0.399335742, +0.596296668
1008-0.911384463, -0.165361166E-1, -0.188089252, -0.654661417, -0.640970349, -0.624086976, +0.595846415, +0.240228176, -0.295981288, +0.752123594E-1
1009var(:,0) = getVar(sample, dim)
1010var(:,0) ! reference
1011+0.201154396, +0.406026363, +0.201534152
1012do isam = 1, nsam
1013 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1014 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1015end do
1016varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1017varMerged
1018+0.201154366, +0.406026363, +0.201534137
1019var(:,0) ! reference
1020+0.201154396, +0.406026363, +0.201534152
1021
1022
1023dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1024do isam = 2, nsam
1025 lb(isam) = ub(isam - 1) + 1
1026 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1027end do
1028lb
1029+1, +4
1030ub
1031+3, +8
1032ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1033call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1034call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1035call setResized(varMerged, ndim)
1036sample = getUnifRand(-1., +1., ndim, ub(nsam))
1037sample
1038+0.793565989, +0.682521343, -0.213110447E-1, -0.220548153, -0.605292916, -0.656153202, +0.276506782, -0.641230226
1039-0.783159852, +0.339449286, +0.499422073, +0.153867483, +0.136586905, -0.619032264, +0.438970208, +0.796170235E-1
1040var(:,0) = getVar(sample, dim)
1041var(:,0) ! reference
1042+0.301253051, +0.199375749
1043do isam = 1, nsam
1044 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1045 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1046end do
1047varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1048varMerged
1049+0.301253080, +0.199375764
1050var(:,0) ! reference
1051+0.301253051, +0.199375749
1052
1053
1054dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1055do isam = 2, nsam
1056 lb(isam) = ub(isam - 1) + 1
1057 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1058end do
1059lb
1060+1, +3
1061ub
1062+2, +8
1063ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1064call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1065call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1066call setResized(varMerged, ndim)
1067sample = getUnifRand(-1., +1., ndim, ub(nsam))
1068sample
1069-0.233726263, +0.243409276, -0.850091696, +0.694321275, +0.735538960, +0.726227641, -0.250964403, +0.449663281
1070-0.129350901, -0.768071175, -0.770327449, -0.187208772, -0.795598865, -0.979716659, -0.741080523, -0.546659231E-1
1071var(:,0) = getVar(sample, dim)
1072var(:,0) ! reference
1073+0.295693815, +0.116427571
1074do isam = 1, nsam
1075 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1076 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1077end do
1078varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1079varMerged
1080+0.295693845, +0.116427571
1081var(:,0) ! reference
1082+0.295693815, +0.116427571
1083
1084
1085dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1086do isam = 2, nsam
1087 lb(isam) = ub(isam - 1) + 1
1088 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1089end do
1090lb
1091+1, +5
1092ub
1093+4, +11
1094ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1095call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1096call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1097call setResized(varMerged, ndim)
1098sample = getUnifRand(-1., +1., ndim, ub(nsam))
1099sample
1100+0.157640338, +0.685888290, +0.667116046, +0.782219768, -0.533158422, -0.829219818E-1, +0.226912737, +0.129403710, -0.117244959, -0.660314322, -0.733315945E-1
1101var(:,0) = getVar(sample, dim)
1102var(:,0) ! reference
1103+0.203605101
1104do isam = 1, nsam
1105 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1106 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1107end do
1108varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1109varMerged
1110+0.203605086
1111var(:,0) ! reference
1112+0.203605101
1113
1114
1115dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1116do isam = 2, nsam
1117 lb(isam) = ub(isam - 1) + 1
1118 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1119end do
1120lb
1121+1, +7
1122ub
1123+6, +13
1124ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1125call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1126call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1127call setResized(varMerged, ndim)
1128sample = getUnifRand(-1., +1., ndim, ub(nsam))
1129sample
1130-0.837792277, -0.716931462, +0.793094635E-1, +0.314378858, +0.848489285, +0.830800533E-1, -0.549773335, -0.464801788, +0.171472073, -0.786471963, +0.265978813, +0.950421095E-1, +0.701242685E-1
1131-0.341052294, -0.187232494, +0.490494967, -0.937614918, -0.882568955, +0.594423175, +0.566866159, -0.971008658, -0.857906342E-1, +0.902328134, +0.215884447, -0.122589350, +0.603598356
1132+0.222824574, +0.678692818, -0.593200922, -0.993439794, -0.269551039, -0.537260652, +0.904311776, +0.699999213, -0.149301410, +0.531911850, -0.298003197, -0.383806109, +0.461785674
1133var(:,0) = getVar(sample, dim)
1134var(:,0) ! reference
1135+0.241687492, +0.377940953, +0.328225732
1136do isam = 1, nsam
1137 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1138 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1139end do
1140varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1141varMerged
1142+0.241687477, +0.377941012, +0.328225791
1143var(:,0) ! reference
1144+0.241687492, +0.377940953, +0.328225732
1145
1146
1147dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1148do isam = 2, nsam
1149 lb(isam) = ub(isam - 1) + 1
1150 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1151end do
1152lb
1153+1, +6
1154ub
1155+5, +9
1156ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1157call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1158call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1159call setResized(varMerged, ndim)
1160sample = getUnifRand(-1., +1., ndim, ub(nsam))
1161sample
1162-0.887034059, +0.971585512E-1, +0.449972272, +0.589379072E-1, -0.770032287, +0.403831482, +0.688744545, -0.487589121, +0.463336825
1163-0.136800647, +0.818308592, +0.817033172, +0.200883627, -0.232460737, +0.384944201, +0.569100022, -0.966175199, +0.660362840
1164-0.400850534, +0.482622504, +0.847465158, -0.753340483, -0.932233572, -0.960196733, +0.634031653, -0.497366428, -0.455193639
1165var(:,0) = getVar(sample, dim)
1166var(:,0) ! reference
1167+0.298334181, +0.310532451, +0.429640919
1168do isam = 1, nsam
1169 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1170 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1171end do
1172varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1173varMerged
1174+0.298334152, +0.310532451, +0.429640949
1175var(:,0) ! reference
1176+0.298334181, +0.310532451, +0.429640919
1177
1178
1179!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1180!Compute the biased merged variance of a frequency weighted multivariate sample.
1181!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1182
1183
1184dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1185do isam = 2, nsam
1186 lb(isam) = ub(isam - 1) + 1
1187 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1188end do
1189lb
1190+1, +5
1191ub
1192+4, +8
1193ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1194call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1195call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1196call setResized(varMerged, ndim)
1197sample = getUnifRand(-1., +1., ndim, ub(nsam))
1198sample
1199-0.346815348, -0.975849390, +0.961728454, -0.498436689E-1, +0.330421448, -0.333267450E-1, +0.206635833, -0.883876920
1200+0.141075373, -0.623292327, -0.831227303, -0.602367163, -0.938077092, -0.193790674, +0.887881994, +0.650165439
1201+0.169270158, +0.229446888E-1, +0.480728030, +0.586300850, -0.562178493, -0.660140872, +0.419149041, -0.325677276
1202+0.161718726, +0.531843901E-1, +0.882487416, +0.228562117, -0.490270257, +0.275135636, +0.947010517E-1, -0.879087925
1203iweight = getUnifRand(1, 10, size(sample, dim, IK))
1204iweight
1205+7, +7, +3, +1, +8, +4, +10, +7
1206var(:,0) = getVar(sample, 2_IK, iweight)
1207var(:,0) ! reference
1208+0.333731890, +0.495526791, +0.168917492, +0.213474572
1209do isam = 1, nsam
1210 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1211 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1212end do
1213varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1214varMerged
1215+0.333731949, +0.495526850, +0.168917507, +0.213474587
1216var(:,0) ! reference
1217+0.333731890, +0.495526791, +0.168917492, +0.213474572
1218
1219
1220dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1221do isam = 2, nsam
1222 lb(isam) = ub(isam - 1) + 1
1223 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1224end do
1225lb
1226+1, +7
1227ub
1228+6, +13
1229ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1230call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1231call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1232call setResized(varMerged, ndim)
1233sample = getUnifRand(-1., +1., ndim, ub(nsam))
1234sample
1235+0.996523380, -0.337075353, +0.660981417, -0.592251658, -0.744774818, +0.103395224, -0.325147510, -0.838988304, -0.149564028, +0.992459655, +0.167228341, -0.941172719, -0.679996967
1236iweight = getUnifRand(1, 10, size(sample, dim, IK))
1237iweight
1238+6, +2, +10, +9, +7, +8, +10, +8, +10, +10, +7, +5, +10
1239var(:,0) = getVar(sample, 2_IK, iweight)
1240var(:,0) ! reference
1241+0.419346809
1242do isam = 1, nsam
1243 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1244 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1245end do
1246varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1247varMerged
1248+0.419346809
1249var(:,0) ! reference
1250+0.419346809
1251
1252
1253dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1254do isam = 2, nsam
1255 lb(isam) = ub(isam - 1) + 1
1256 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1257end do
1258lb
1259+1, +8
1260ub
1261+7, +9
1262ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1263call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1264call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1265call setResized(varMerged, ndim)
1266sample = getUnifRand(-1., +1., ndim, ub(nsam))
1267sample
1268+0.184363127, +0.348393202, +0.526417613, -0.357596278, -0.811357856, -0.642525315, -0.211865783, -0.503559589, -0.298101902
1269+0.260335207E-1, -0.941589832, +0.606511831, -0.795395136, +0.473697662, +0.523055553, +0.454682112E-1, +0.762981892, +0.870145679
1270iweight = getUnifRand(1, 10, size(sample, dim, IK))
1271iweight
1272+7, +7, +6, +4, +8, +2, +3, +6, +8
1273var(:,0) = getVar(sample, 2_IK, iweight)
1274var(:,0) ! reference
1275+0.202948958, +0.405113071
1276do isam = 1, nsam
1277 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1278 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1279end do
1280varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1281varMerged
1282+0.202948943, +0.405113101
1283var(:,0) ! reference
1284+0.202948958, +0.405113071
1285
1286
1287dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1288do isam = 2, nsam
1289 lb(isam) = ub(isam - 1) + 1
1290 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1291end do
1292lb
1293+1, +7
1294ub
1295+6, +9
1296ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1297call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1298call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1299call setResized(varMerged, ndim)
1300sample = getUnifRand(-1., +1., ndim, ub(nsam))
1301sample
1302-0.884651184, +0.244111896, +0.590127826, +0.292065501, -0.900294185, -0.539452672, -0.871702194, +0.317164063, -0.292907476
1303+0.633534789, +0.783125281, -0.768205166, -0.899906754, -0.896088719, +0.257887483, -0.428955317, +0.415202737, -0.791176558
1304-0.688297391, -0.197516441, +0.167887926, -0.289689898, -0.192551613, +0.760492921, -0.347185135E-1, +0.156588912, -0.152474523
1305iweight = getUnifRand(1, 10, size(sample, dim, IK))
1306iweight
1307+2, +4, +5, +8, +5, +9, +9, +6, +4
1308var(:,0) = getVar(sample, 2_IK, iweight)
1309var(:,0) ! reference
1310+0.306273907, +0.366800100, +0.143454388
1311do isam = 1, nsam
1312 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1313 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1314end do
1315varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1316varMerged
1317+0.306273907, +0.366800100, +0.143454403
1318var(:,0) ! reference
1319+0.306273907, +0.366800100, +0.143454388
1320
1321
1322dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1323do isam = 2, nsam
1324 lb(isam) = ub(isam - 1) + 1
1325 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1326end do
1327lb
1328+1, +7
1329ub
1330+6, +12
1331ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1332call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1333call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1334call setResized(varMerged, ndim)
1335sample = getUnifRand(-1., +1., ndim, ub(nsam))
1336sample
1337+0.792176247, +0.247698784, -0.120775580, +0.415964007, -0.284881592E-1, -0.494365692E-1, +0.899451017, -0.954319715, +0.636990070, +0.730323792E-1, +0.781589150, +0.504717350
1338+0.194655299, +0.965791941E-1, -0.586743951, +0.704725504, -0.369609475, +0.629681468, +0.258773565, +0.272131324, +0.912307739, +0.865791559, -0.803885102, -0.183542252
1339+0.442858934, -0.847361207, +0.661986351, -0.212518334, +0.836201668, +0.806870103, -0.761285543, -0.938312531, +0.723911881, -0.670963526, -0.238749623, +0.248911381E-1
1340-0.661587596, -0.655667543, +0.649488091, +0.144449711, +0.920401812E-1, +0.966109753, +0.367500305, -0.228299975, -0.774057388, +0.896820307, +0.503402114, +0.103186369E-1
1341iweight = getUnifRand(1, 10, size(sample, dim, IK))
1342iweight
1343+10, +8, +7, +1, +4, +10, +10, +6, +6, +4, +8, +8
1344var(:,0) = getVar(sample, 2_IK, iweight)
1345var(:,0) ! reference
1346+0.261162996, +0.260256201, +0.446453691, +0.363874108
1347do isam = 1, nsam
1348 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1349 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1350end do
1351varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1352varMerged
1353+0.261162996, +0.260256201, +0.446453750, +0.363874108
1354var(:,0) ! reference
1355+0.261162996, +0.260256201, +0.446453691, +0.363874108
1356
1357
1358dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1359do isam = 2, nsam
1360 lb(isam) = ub(isam - 1) + 1
1361 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1362end do
1363lb
1364+1, +8
1365ub
1366+7, +11
1367ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1368call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1369call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1370call setResized(varMerged, ndim)
1371sample = getUnifRand(-1., +1., ndim, ub(nsam))
1372sample
1373+0.140013695E-1, -0.776290894E-1, -0.472523689, -0.684229851, -0.373419404, +0.521303415E-1, -0.971325397, -0.307337046, +0.638170123, -0.417646766, +0.301136494
1374-0.374989510, -0.211510181, -0.640881062E-2, +0.395775914, +0.134289265E-2, +0.605209351, -0.868660927, +0.923526287, -0.989169359, -0.165797114, +0.176223159
1375iweight = getUnifRand(1, 10, size(sample, dim, IK))
1376iweight
1377+9, +5, +10, +5, +3, +5, +1, +4, +8, +8, +3
1378var(:,0) = getVar(sample, 2_IK, iweight)
1379var(:,0) ! reference
1380+0.164171442, +0.261275947
1381do isam = 1, nsam
1382 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1383 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1384end do
1385varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1386varMerged
1387+0.164171472, +0.261275977
1388var(:,0) ! reference
1389+0.164171442, +0.261275947
1390
1391
1392dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1393do isam = 2, nsam
1394 lb(isam) = ub(isam - 1) + 1
1395 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1396end do
1397lb
1398+1, +3
1399ub
1400+2, +6
1401ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1402call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1403call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1404call setResized(varMerged, ndim)
1405sample = getUnifRand(-1., +1., ndim, ub(nsam))
1406sample
1407-0.461739540, +0.360735059, -0.173306227, +0.136063457, -0.729244232, -0.446571589
1408-0.643176913, +0.262316346, +0.762135625, -0.713714957, -0.547412157, -0.291866064
1409iweight = getUnifRand(1, 10, size(sample, dim, IK))
1410iweight
1411+1, +9, +9, +10, +9, +2
1412var(:,0) = getVar(sample, 2_IK, iweight)
1413var(:,0) ! reference
1414+0.160794541, +0.345188975
1415do isam = 1, nsam
1416 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1417 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1418end do
1419varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1420varMerged
1421+0.160794526, +0.345188975
1422var(:,0) ! reference
1423+0.160794541, +0.345188975
1424
1425
1426dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1427do isam = 2, nsam
1428 lb(isam) = ub(isam - 1) + 1
1429 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1430end do
1431lb
1432+1, +6
1433ub
1434+5, +8
1435ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1436call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1437call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1438call setResized(varMerged, ndim)
1439sample = getUnifRand(-1., +1., ndim, ub(nsam))
1440sample
1441+0.735610485, -0.993516803, -0.554462671E-1, -0.911352158, +0.218448043, -0.296621442, +0.770020485, -0.482940316
1442iweight = getUnifRand(1, 10, size(sample, dim, IK))
1443iweight
1444+8, +10, +6, +9, +7, +10, +9, +5
1445var(:,0) = getVar(sample, 2_IK, iweight)
1446var(:,0) ! reference
1447+0.437461168
1448do isam = 1, nsam
1449 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1450 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1451end do
1452varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1453varMerged
1454+0.437461197
1455var(:,0) ! reference
1456+0.437461168
1457
1458
1459dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1460do isam = 2, nsam
1461 lb(isam) = ub(isam - 1) + 1
1462 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1463end do
1464lb
1465+1, +7
1466ub
1467+6, +10
1468ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1469call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1470call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1471call setResized(varMerged, ndim)
1472sample = getUnifRand(-1., +1., ndim, ub(nsam))
1473sample
1474+0.613574386, -0.222642422, -0.313583851, +0.890709400, -0.515742302, -0.363742828, +0.778588891, -0.461034775, +0.129873395, -0.482453704
1475iweight = getUnifRand(1, 10, size(sample, dim, IK))
1476iweight
1477+6, +5, +4, +3, +10, +7, +1, +3, +2, +3
1478var(:,0) = getVar(sample, 2_IK, iweight)
1479var(:,0) ! reference
1480+0.230730146
1481do isam = 1, nsam
1482 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1483 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1484end do
1485varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1486varMerged
1487+0.230730161
1488var(:,0) ! reference
1489+0.230730146
1490
1491
1492dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1493do isam = 2, nsam
1494 lb(isam) = ub(isam - 1) + 1
1495 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1496end do
1497lb
1498+1, +7
1499ub
1500+6, +13
1501ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1502call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1503call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1504call setResized(varMerged, ndim)
1505sample = getUnifRand(-1., +1., ndim, ub(nsam))
1506sample
1507-0.954358459, -0.950636029, +0.291834116, +0.994037390, -0.121437311, +0.614416599E-2, -0.804266214, +0.487909436, +0.456443667, +0.105119705, +0.631949186, +0.988863826, +0.329134822
1508-0.366969109E-1, +0.583245873, +0.327589750, -0.303538680, +0.260551572, -0.442986488, +0.698370099, -0.194320440, -0.909412265, +0.226153851, +0.299042821, -0.789839268, +0.526757479
1509+0.765581608, -0.422755241, +0.608958125, +0.462303162, -0.205655098E-1, +0.290399790, +0.831194997, +0.488145351E-1, -0.119636059E-1, +0.669911742, +0.657019138, +0.759059668, +0.344942570
1510iweight = getUnifRand(1, 10, size(sample, dim, IK))
1511iweight
1512+10, +9, +8, +4, +6, +4, +9, +5, +9, +8, +9, +6, +2
1513var(:,0) = getVar(sample, 2_IK, iweight)
1514var(:,0) ! reference
1515+0.456371874, +0.256696731, +0.164911643
1516do isam = 1, nsam
1517 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1518 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1519end do
1520varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1521varMerged
1522+0.456371874, +0.256696761, +0.164911643
1523var(:,0) ! reference
1524+0.456371874, +0.256696731, +0.164911643
1525
1526
1527!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1528!Compute the biased merged variance of a reliability weighted multivariate sample.
1529!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1530
1531
1532dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1533do isam = 2, nsam
1534 lb(isam) = ub(isam - 1) + 1
1535 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1536end do
1537lb
1538+1, +4
1539ub
1540+3, +5
1541ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1542call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1543call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1544call setResized(varMerged, ndim)
1545sample = getUnifRand(-1., +1., ndim, ub(nsam))
1546sample
1547+0.660363078, -0.966759086, -0.860092759, -0.356497884, -0.644602895
1548-0.533545017E-1, +0.950456858, -0.800315857, +0.460979104, +0.588412404
1549rweight = getUnifRand(1., 2., size(sample, dim, IK))
1550rweight
1551+1.57147098, +1.79876924, +1.14372087, +1.13252592, +1.82317734
1552var(:,0) = getVar(sample, 2_IK, rweight)
1553var(:,0) ! reference
1554+0.359834194, +0.337686747
1555do isam = 1, nsam
1556 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1557 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1558end do
1559varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1560varMerged
1561+0.359834164, +0.337686747
1562var(:,0) ! reference
1563+0.359834194, +0.337686747
1564
1565
1566dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1567do isam = 2, nsam
1568 lb(isam) = ub(isam - 1) + 1
1569 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1570end do
1571lb
1572+1, +6
1573ub
1574+5, +10
1575ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1576call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1577call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1578call setResized(varMerged, ndim)
1579sample = getUnifRand(-1., +1., ndim, ub(nsam))
1580sample
1581-0.791878700, -0.491848469, -0.960410953, -0.100202799, +0.893252730, -0.587533832, +0.475235939, +0.610859752, +0.706519961, +0.591389418
1582-0.348970175, -0.442520380, +0.872310042, +0.584486842, +0.967864990E-1, -0.393078208, +0.565749526, +0.876973033, +0.873039484, +0.733671665
1583+0.205409646, -0.975620985, +0.444479227, -0.456634045, +0.832700610, -0.122840166, +0.894105792, +0.269454122, +0.644260287, -0.979103208
1584+0.172781944, -0.797153831, +0.922139406, -0.428922176E-1, +0.444456697, +0.151862741, -0.842796326, +0.828892708, +0.411669493, +0.163495660
1585rweight = getUnifRand(1., 2., size(sample, dim, IK))
1586rweight
1587+1.24288142, +1.26046181, +1.58228040, +1.67941308, +1.19372642, +1.60810089, +1.29749918, +1.79418826, +1.83854413, +1.86654139
1588var(:,0) = getVar(sample, 2_IK, rweight)
1589var(:,0) ! reference
1590+0.425889641, +0.272481233, +0.419787347, +0.289969563
1591do isam = 1, nsam
1592 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1593 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1594end do
1595varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1596varMerged
1597+0.425889671, +0.272481233, +0.419787407, +0.289969563
1598var(:,0) ! reference
1599+0.425889641, +0.272481233, +0.419787347, +0.289969563
1600
1601
1602dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1603do isam = 2, nsam
1604 lb(isam) = ub(isam - 1) + 1
1605 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1606end do
1607lb
1608+1, +7
1609ub
1610+6, +13
1611ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1612call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1613call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1614call setResized(varMerged, ndim)
1615sample = getUnifRand(-1., +1., ndim, ub(nsam))
1616sample
1617+0.693080068, +0.380644560, +0.389378667, +0.397407651, +0.901105642, +0.882100344, -0.511245847, +0.842516065, -0.100411177, -0.207977295E-1, -0.707914472, -0.862921238, +0.537495375
1618-0.346648693E-1, -0.215473890, +0.720063448E-1, +0.316514850, +0.403852701, +0.975278497, +0.628647685, +0.580743670, +0.246021152, -0.453594923, +0.974860907, +0.999689102, -0.191987038
1619+0.362644196, +0.591808677, +0.515258908, +0.386660457, -0.227061629, -0.841854453, -0.110002756, +0.876263976, +0.429481030, -0.447105527, +0.650120497, +0.709533453, -0.454079509
1620-0.473112345, +0.651614308, +0.766399860, +0.262941003, -0.192683578, -0.271325111, -0.696439862, +0.258036613, -0.573599100, -0.905174017E-1, +0.292499542, +0.708933115, +0.633116961
1621-0.168622732E-1, +0.764720440E-1, -0.535539389, +0.501987219, +0.962664723, -0.365248442, -0.859807730E-1, +0.870487928, +0.155248761, -0.447557092, +0.807462215, -0.913901329E-1, -0.595916629
1622+0.250450134, -0.635687232, -0.719767094, +0.777232051, -0.712450147, +0.800201893, -0.236097932, +0.810490489, -0.561327577, +0.430908442, +0.934778214, -0.778853416, -0.880653858
1623rweight = getUnifRand(1., 2., size(sample, dim, IK))
1624rweight
1625+1.09385085, +1.36129546, +1.17108357, +1.61249471, +1.46207738, +1.89953399, +1.02423453, +1.90906286, +1.98339987, +1.90777624, +1.63946795, +1.79679871, +1.91663694
1626var(:,0) = getVar(sample, 2_IK, rweight)
1627var(:,0) ! reference
1628+0.345990241, +0.232519254, +0.299046457, +0.224219635, +0.279615343, +0.503155470
1629do isam = 1, nsam
1630 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1631 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1632end do
1633varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1634varMerged
1635+0.345990270, +0.232519254, +0.299046457, +0.224219665, +0.279615343, +0.503155529
1636var(:,0) ! reference
1637+0.345990241, +0.232519254, +0.299046457, +0.224219635, +0.279615343, +0.503155470
1638
1639
1640dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1641do isam = 2, nsam
1642 lb(isam) = ub(isam - 1) + 1
1643 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1644end do
1645lb
1646+1, +7
1647ub
1648+6, +8
1649ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1650call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1651call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1652call setResized(varMerged, ndim)
1653sample = getUnifRand(-1., +1., ndim, ub(nsam))
1654sample
1655+0.756149054, -0.774503589, -0.671933651, +0.986950755, -0.499761939, -0.419576168E-1, -0.480232477, +0.862828612
1656rweight = getUnifRand(1., 2., size(sample, dim, IK))
1657rweight
1658+1.37810230, +1.20350397, +1.84911561, +1.26827312, +1.88262701, +1.24688554, +1.93623257, +1.51983833
1659var(:,0) = getVar(sample, 2_IK, rweight)
1660var(:,0) ! reference
1661+0.456735879
1662do isam = 1, nsam
1663 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1664 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1665end do
1666varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1667varMerged
1668+0.456735909
1669var(:,0) ! reference
1670+0.456735879
1671
1672
1673dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1674do isam = 2, nsam
1675 lb(isam) = ub(isam - 1) + 1
1676 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1677end do
1678lb
1679+1, +5
1680ub
1681+4, +11
1682ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1683call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1684call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1685call setResized(varMerged, ndim)
1686sample = getUnifRand(-1., +1., ndim, ub(nsam))
1687sample
1688-0.151960611, -0.758148432, +0.898804069, +0.413609624, +0.152255177, +0.475582719, +0.910844803, -0.148987293, +0.669309855, -0.724211097, -0.650645018
1689-0.479493976, -0.699717879, -0.154049277, -0.858289242, -0.916954398, -0.304045558, +0.641827703, -0.954472065, -0.527627110, -0.466414332, +0.712178707
1690-0.275203347, +0.989192605, -0.126069307, -0.276707411E-1, +0.214401841, -0.615044832E-1, +0.192118645, -0.587381244, +0.208611965, -0.176807046, -0.832059741
1691rweight = getUnifRand(1., 2., size(sample, dim, IK))
1692rweight
1693+1.04653037, +1.30666733, +1.85078406, +1.30741811, +1.10350037, +1.88958347, +1.50808024, +1.12076640, +1.56512475, +1.25214911, +1.48790658
1694var(:,0) = getVar(sample, 2_IK, rweight)
1695var(:,0) ! reference
1696+0.376059651, +0.295622885, +0.194241762
1697do isam = 1, nsam
1698 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1699 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1700end do
1701varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1702varMerged
1703+0.376059651, +0.295622855, +0.194241747
1704var(:,0) ! reference
1705+0.376059651, +0.295622885, +0.194241762
1706
1707
1708dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1709do isam = 2, nsam
1710 lb(isam) = ub(isam - 1) + 1
1711 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1712end do
1713lb
1714+1, +8
1715ub
1716+7, +11
1717ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1718call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1719call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1720call setResized(varMerged, ndim)
1721sample = getUnifRand(-1., +1., ndim, ub(nsam))
1722sample
1723-0.299291253, +0.862094164, +0.214979172, -0.552385569, -0.726424932, +0.252487063, +0.326475739, +0.711191654, -0.774406672, -0.234422445, -0.180139065
1724-0.552764893, -0.253407121, -0.150469661, +0.203090191, +0.221945047, +0.262630105, -0.433197021, +0.864746094, +0.104330301, +0.674487352, +0.899980068E-1
1725+0.730610251, -0.427738070, +0.668025970, +0.531019568, -0.730203867, -0.137626171, -0.700907826, +0.761593103, +0.606769919, +0.607911348, +0.846730828
1726rweight = getUnifRand(1., 2., size(sample, dim, IK))
1727rweight
1728+1.71857429, +1.43184614, +1.12418556, +1.39916444, +1.68876648, +1.52994049, +1.75960684, +1.10115457, +1.34660971, +1.89873075, +1.71198916
1729var(:,0) = getVar(sample, 2_IK, rweight)
1730var(:,0) ! reference
1731+0.258907527, +0.169161752, +0.365339160
1732do isam = 1, nsam
1733 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1734 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1735end do
1736varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1737varMerged
1738+0.258907527, +0.169161752, +0.365339160
1739var(:,0) ! reference
1740+0.258907527, +0.169161752, +0.365339160
1741
1742
1743dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1744do isam = 2, nsam
1745 lb(isam) = ub(isam - 1) + 1
1746 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1747end do
1748lb
1749+1, +8
1750ub
1751+7, +10
1752ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1753call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1754call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1755call setResized(varMerged, ndim)
1756sample = getUnifRand(-1., +1., ndim, ub(nsam))
1757sample
1758+0.727317214, -0.444257975, -0.845570683, -0.235957503, -0.861949801, -0.228896856, +0.879729629, +0.530003190, +0.947062969E-1, +0.260903120
1759rweight = getUnifRand(1., 2., size(sample, dim, IK))
1760rweight
1761+1.16687036, +1.07370543, +1.71065629, +1.92600822, +1.54404330, +1.66079140, +1.08190048, +1.65655899, +1.21597373, +1.73632741
1762var(:,0) = getVar(sample, 2_IK, rweight)
1763var(:,0) ! reference
1764+0.323390335
1765do isam = 1, nsam
1766 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1767 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1768end do
1769varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1770varMerged
1771+0.323390335
1772var(:,0) ! reference
1773+0.323390335
1774
1775
1776dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1777do isam = 2, nsam
1778 lb(isam) = ub(isam - 1) + 1
1779 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1780end do
1781lb
1782+1, +6
1783ub
1784+5, +7
1785ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1786call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1787call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1788call setResized(varMerged, ndim)
1789sample = getUnifRand(-1., +1., ndim, ub(nsam))
1790sample
1791+0.190700412, -0.513439417, -0.997154713, -0.503218651, +0.957273960, +0.287846088, +0.357133389
1792rweight = getUnifRand(1., 2., size(sample, dim, IK))
1793rweight
1794+1.94418788, +1.43793130, +1.50021744, +1.48280120, +1.04479861, +1.82410073, +1.26461220
1795var(:,0) = getVar(sample, 2_IK, rweight)
1796var(:,0) ! reference
1797+0.338011712
1798do isam = 1, nsam
1799 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1800 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1801end do
1802varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1803varMerged
1804+0.338011682
1805var(:,0) ! reference
1806+0.338011712
1807
1808
1809dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1810do isam = 2, nsam
1811 lb(isam) = ub(isam - 1) + 1
1812 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1813end do
1814lb
1815+1, +4
1816ub
1817+3, +6
1818ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1819call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1820call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1821call setResized(varMerged, ndim)
1822sample = getUnifRand(-1., +1., ndim, ub(nsam))
1823sample
1824+0.845301390, -0.305573821, +0.674729347E-1, +0.892303944, +0.279717922, -0.799050927
1825-0.924136758, +0.278034925, -0.953253865, +0.399394274, -0.262610793, -0.783197761
1826rweight = getUnifRand(1., 2., size(sample, dim, IK))
1827rweight
1828+1.44209433, +1.96993470, +1.90179718, +1.97132242, +1.40143275, +1.01933360
1829var(:,0) = getVar(sample, 2_IK, rweight)
1830var(:,0) ! reference
1831+0.320065200, +0.333336234
1832do isam = 1, nsam
1833 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1834 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1835end do
1836varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1837varMerged
1838+0.320065200, +0.333336264
1839var(:,0) ! reference
1840+0.320065200, +0.333336234
1841
1842
1843dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1844do isam = 2, nsam
1845 lb(isam) = ub(isam - 1) + 1
1846 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1847end do
1848lb
1849+1, +7
1850ub
1851+6, +9
1852ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1853call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1854call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1855call setResized(varMerged, ndim)
1856sample = getUnifRand(-1., +1., ndim, ub(nsam))
1857sample
1858+0.865042210E-1, +0.537455678, -0.533723950, +0.667766571, +0.107939363, +0.363443971, +0.951228142E-1, -0.645814896, -0.645524263
1859+0.337412357E-1, -0.675078392, -0.374974608, +0.435822606, -0.226102591, -0.514562845, +0.380314350, +0.183895230, -0.222754359
1860rweight = getUnifRand(1., 2., size(sample, dim, IK))
1861rweight
1862+1.75644445, +1.22698855, +1.81325841, +1.67027819, +1.14698446, +1.45705974, +1.58294988, +1.00524092, +1.64840508
1863var(:,0) = getVar(sample, 2_IK, rweight)
1864var(:,0) ! reference
1865+0.222054631, +0.134773955
1866do isam = 1, nsam
1867 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1868 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1869end do
1870varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1871varMerged
1872+0.222054631, +0.134773955
1873var(:,0) ! reference
1874+0.222054631, +0.134773955
1875
1876
Test:
test_pm_sampleVar


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, April 21, 2017, 1:54 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 8330 of file pm_sampleVar.F90.


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