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, +7
14ub
15+6, +8
16sample = getUnifRand(0., 1., ub(nsam))
17sample
18+0.845021009, +0.383731306, +0.471072674, +0.546872020E-1, +0.236333609E-1, +0.322626352, +0.332219064, +0.790640175
19var(0) = getVar(sample)
20var(0) ! reference
21+0.784204155E-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.784204230E-1
29var(0) ! reference
30+0.784204155E-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, +8
40ub
41+7, +14
42sample = getUnifRand(0., 1., ub(nsam))
43sample
44+0.740897596, +0.157958210, +0.230950475, +0.352295995, +0.679202974, +0.176904798E-1, +0.273275197, +0.330436230, +0.741446137, +0.980952740, +0.496228933, +0.199528396, +0.154796958, +0.421787679
45var(0) = getVar(sample)
46var(0) ! reference
47+0.723251775E-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.723251849E-1
55var(0) ! reference
56+0.723251775E-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, +4
66ub
67+3, +10
68sample = getUnifRand(0., 1., ub(nsam))
69sample
70+0.995704591, +0.788327277, +0.198935986, +0.219849706, +0.456416011, +0.368001997, +0.457125545, +0.950238883, +0.690007150, +0.111223698
71var(0) = getVar(sample)
72var(0) ! reference
73+0.903543830E-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.903543830E-1
81var(0) ! reference
82+0.903543830E-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, +4
92ub
93+3, +10
94sample = getUnifRand(0., 1., ub(nsam))
95sample
96+0.524425507E-2, +0.531278014, +0.425876617, +0.490891576, +0.328639328, +0.878290772, +0.713424802, +0.643482208, +0.485655725, +0.134280205
97var(0) = getVar(sample)
98var(0) ! reference
99+0.610728934E-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.610728934E-1
107var(0) ! reference
108+0.610728934E-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, +8
118ub
119+7, +11
120sample = getUnifRand(0., 1., ub(nsam))
121sample
122+0.402595401E-1, +0.280441105, +0.658920527, +0.739884198, +0.708028734, +0.218201280, +0.693225563, +0.602844119, +0.243383646E-1, +0.353536963, +0.697786748
123var(0) = getVar(sample)
124var(0) ! reference
125+0.707840845E-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.707840845E-1
133var(0) ! reference
134+0.707840845E-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, +6
144ub
145+5, +11
146sample = getUnifRand(0., 1., ub(nsam))
147sample
148+0.476853549, +0.865653753E-1, +0.617250562, +0.505376101, +0.660977662, +0.623197436, +0.806482494, +0.312701821, +0.208264351, +0.458419323E-3, +0.968725681E-1
149var(0) = getVar(sample)
150var(0) ! reference
151+0.674095601E-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.674095526E-1
159var(0) ! reference
160+0.674095601E-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, +7
172sample = getUnifRand(0., 1., ub(nsam))
173sample
174+0.484729528, +0.978721023, +0.125140071, +0.432808101, +0.916094184E-1, +0.596014261E-1, +0.317175984
175var(0) = getVar(sample)
176var(0) ! reference
177+0.889727995E-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.889728069E-1
185var(0) ! reference
186+0.889727995E-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, +9
198sample = getUnifRand(0., 1., ub(nsam))
199sample
200+0.297219694, +0.933530331E-1, +0.703978777, +0.247196257, +0.364216506, +0.323155046, +0.232632339, +0.877319813, +0.606127977E-1
201var(0) = getVar(sample)
202var(0) ! reference
203+0.645286441E-1
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.645286441E-1
211var(0) ! reference
212+0.645286441E-1
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, +8
222ub
223+7, +14
224sample = getUnifRand(0., 1., ub(nsam))
225sample
226+0.570672631, +0.697939277, +0.365645885E-1, +0.371245623, +0.892133892, +0.968810916E-1, +0.135812342, +0.512883008, +0.322879016, +0.526812673, +0.714168251, +0.819204152, +0.327968776, +0.628813803
227var(0) = getVar(sample)
228var(0) ! reference
229+0.672916248E-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.672916323E-1
237var(0) ! reference
238+0.672916248E-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, +8
248ub
249+7, +10
250sample = getUnifRand(0., 1., ub(nsam))
251sample
252+0.590761125, +0.185832620, +0.590418339, +0.377043843, +0.330911100, +0.369599581, +0.875694871, +0.327647269, +0.781106889, +0.188024163
253var(0) = getVar(sample)
254var(0) ! reference
255+0.508363955E-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.508363955E-1
263var(0) ! reference
264+0.508363955E-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, +10
281sample = getUnifRand(0., 1., ub(nsam))
282sample
283+0.874277771, +0.270702243, +0.401768565, +0.847591519, +0.121431172, +0.123015702, +0.896019816, +0.234859228, +0.630638659, +0.581406474
284iweight = getUnifRand(1, 10, size(sample, 1, IK))
285iweight
286+10, +1, +9, +9, +8, +7, +9, +4, +6, +9
287var(0) = getVar(sample, iweight)
288var(0) ! reference
289+0.887367129E-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.887367129E-1
297var(0) ! reference
298+0.887367129E-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, +5
310sample = getUnifRand(0., 1., ub(nsam))
311sample
312+0.613108516, +0.166736960, +0.972341597, +0.585116267, +0.817710638
313iweight = getUnifRand(1, 10, size(sample, 1, IK))
314iweight
315+4, +8, +8, +5, +10
316var(0) = getVar(sample, iweight)
317var(0) ! reference
318+0.859184787E-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.859184936E-1
326var(0) ! reference
327+0.859184787E-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, +7
337ub
338+6, +8
339sample = getUnifRand(0., 1., ub(nsam))
340sample
341+0.352708101, +0.610991418, +0.422332644, +0.579295278, +0.617163420, +0.239541650, +0.164115429, +0.756733656
342iweight = getUnifRand(1, 10, size(sample, 1, IK))
343iweight
344+2, +7, +6, +7, +3, +7, +6, +1
345var(0) = getVar(sample, iweight)
346var(0) ! reference
347+0.330111198E-1
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.330111124E-1
355var(0) ! reference
356+0.330111198E-1
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, +6
368sample = getUnifRand(0., 1., ub(nsam))
369sample
370+0.239554107, +0.785853088, +0.472142637, +0.309464037, +0.879417121, +0.334724069
371iweight = getUnifRand(1, 10, size(sample, 1, IK))
372iweight
373+7, +6, +10, +3, +10, +7
374var(0) = getVar(sample, iweight)
375var(0) ! reference
376+0.615579486E-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.615579449E-1
384var(0) ! reference
385+0.615579486E-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, +5
395ub
396+4, +10
397sample = getUnifRand(0., 1., ub(nsam))
398sample
399+0.107938349, +0.185720503, +0.724420488, +0.605752409, +0.120721400, +0.361175418, +0.809406042E-1, +0.373893559, +0.186714470, +0.632685423E-2
400iweight = getUnifRand(1, 10, size(sample, 1, IK))
401iweight
402+6, +6, +1, +6, +2, +10, +1, +1, +1, +2
403var(0) = getVar(sample, iweight)
404var(0) ! reference
405+0.383439064E-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.383439027E-1
413var(0) ! reference
414+0.383439064E-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, +8
424ub
425+7, +11
426sample = getUnifRand(0., 1., ub(nsam))
427sample
428+0.468764067, +0.699128866, +0.161218643E-1, +0.129814148E-1, +0.261719465, +0.502663195, +0.453652978, +0.170142472, +0.735274971, +0.118809104, +0.232171476
429iweight = getUnifRand(1, 10, size(sample, 1, IK))
430iweight
431+6, +10, +5, +8, +3, +1, +5, +2, +9, +3, +7
432var(0) = getVar(sample, iweight)
433var(0) ! reference
434+0.757819340E-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.757819414E-1
442var(0) ! reference
443+0.757819340E-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, +7
453ub
454+6, +11
455sample = getUnifRand(0., 1., ub(nsam))
456sample
457+0.822071016, +0.141513348E-1, +0.540459096, +0.488597572, +0.159037292, +0.522005916, +0.640177727E-2, +0.524438620, +0.362199068, +0.332183480, +0.735431373
458iweight = getUnifRand(1, 10, size(sample, 1, IK))
459iweight
460+8, +9, +1, +10, +2, +2, +10, +9, +8, +4, +5
461var(0) = getVar(sample, iweight)
462var(0) ! reference
463+0.775712058E-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.775711909E-1
471var(0) ! reference
472+0.775712058E-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, +6
482ub
483+5, +9
484sample = getUnifRand(0., 1., ub(nsam))
485sample
486+0.152891755, +0.727427006, +0.816354334, +0.922329128, +0.551097810, +0.255035281, +0.899888158, +0.279429376, +0.102800906
487iweight = getUnifRand(1, 10, size(sample, 1, IK))
488iweight
489+6, +7, +6, +7, +3, +3, +1, +2, +2
490var(0) = getVar(sample, iweight)
491var(0) ! reference
492+0.935117751E-1
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.935117826E-1
500var(0) ! reference
501+0.935117751E-1
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, +7
511ub
512+6, +11
513sample = getUnifRand(0., 1., ub(nsam))
514sample
515+0.549326956, +0.668236852, +0.248278618, +0.562482297, +0.172454178, +0.371302426, +0.308240116, +0.843222558, +0.721633434E-2, +0.356004775, +0.948620975
516iweight = getUnifRand(1, 10, size(sample, 1, IK))
517iweight
518+7, +6, +4, +6, +6, +6, +3, +9, +10, +1, +5
519var(0) = getVar(sample, iweight)
520var(0) ! reference
521+0.912159085E-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.912158936E-1
529var(0) ! reference
530+0.912159085E-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, +4
540ub
541+3, +6
542sample = getUnifRand(0., 1., ub(nsam))
543sample
544+0.215749085, +0.921963453E-1, +0.676572919E-1, +0.196767747, +0.235397577, +0.433342338
545iweight = getUnifRand(1, 10, size(sample, 1, IK))
546iweight
547+1, +4, +3, +5, +10, +8
548var(0) = getVar(sample, iweight)
549var(0) ! reference
550+0.156431925E-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.156431925E-1
558var(0) ! reference
559+0.156431925E-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, +5
574ub
575+4, +9
576sample = getUnifRand(0., 1., ub(nsam))
577sample
578+0.648651004, +0.952442408, +0.497245491, +0.442983508E-1, +0.877701581, +0.781578481, +0.659219265, +0.611897707E-1, +0.720934093
579rweight = getUnifRand(1., 2., size(sample, 1, IK))
580rweight
581+1.34451270, +1.05770946, +1.18040609, +1.50037289, +1.90160608, +1.07438898, +1.04538238, +1.15207767, +1.57768106
582var(0) = getVar(sample, rweight)
583var(0) ! reference
584+0.972964391E-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.972964391E-1
592var(0) ! reference
593+0.972964391E-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, +7
603ub
604+6, +11
605sample = getUnifRand(0., 1., ub(nsam))
606sample
607+0.351154506, +0.480478406E-1, +0.799078345, +0.788471699E-1, +0.180800676, +0.239218295, +0.301307321, +0.355985999, +0.843494058, +0.493849516, +0.204103768
608rweight = getUnifRand(1., 2., size(sample, 1, IK))
609rweight
610+1.57732928, +1.29992962, +1.15386093, +1.52773476, +1.46429431, +1.96494246, +1.44410264, +1.31318951, +1.34425139, +1.64185429, +1.53035641
611var(0) = getVar(sample, rweight)
612var(0) ! reference
613+0.569308810E-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.569308698E-1
621var(0) ! reference
622+0.569308810E-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, +6
632ub
633+5, +7
634sample = getUnifRand(0., 1., ub(nsam))
635sample
636+0.527710259, +0.292270005, +0.390216112E-1, +0.585245073, +0.186532736, +0.848828912, +0.224844217
637rweight = getUnifRand(1., 2., size(sample, 1, IK))
638rweight
639+1.96077466, +1.18250871, +1.57704568, +1.75421786, +1.38467681, +1.32395601, +1.26555550
640var(0) = getVar(sample, rweight)
641var(0) ! reference
642+0.650645494E-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.650645569E-1
650var(0) ! reference
651+0.650645494E-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, +3
661ub
662+2, +6
663sample = getUnifRand(0., 1., ub(nsam))
664sample
665+0.894289613, +0.462813616, +0.158811867, +0.866430640, +0.522170484, +0.498188317
666rweight = getUnifRand(1., 2., size(sample, 1, IK))
667rweight
668+1.94995356, +1.21578002, +1.88172495, +1.51983309, +1.20539308, +1.94298160
669var(0) = getVar(sample, rweight)
670var(0) ! reference
671+0.703480765E-1
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.703480691E-1
679var(0) ! reference
680+0.703480765E-1
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, +3
690ub
691+2, +9
692sample = getUnifRand(0., 1., ub(nsam))
693sample
694+0.620940089, +0.107390583, +0.905846417, +0.838826835, +0.854321182, +0.764041245, +0.363196850, +0.122537971, +0.627539337
695rweight = getUnifRand(1., 2., size(sample, 1, IK))
696rweight
697+1.38428640, +1.51403785, +1.18188334, +1.33694696, +1.93626308, +1.03825021, +1.06433582, +1.62703705, +1.34411049
698var(0) = getVar(sample, rweight)
699var(0) ! reference
700+0.908401310E-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.908401310E-1
708var(0) ! reference
709+0.908401310E-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, +7
719ub
720+6, +12
721sample = getUnifRand(0., 1., ub(nsam))
722sample
723+0.360336781, +0.700876832, +0.327799201, +0.460866272, +0.110032082, +0.527568877, +0.218173862E-1, +0.305281222, +0.423696041E-1, +0.727578759, +0.363450110, +0.783330202E-2
724rweight = getUnifRand(1., 2., size(sample, 1, IK))
725rweight
726+1.50077319, +1.29341102, +1.37354612, +1.82028127, +1.66371417, +1.09227252, +1.11610377, +1.61954474, +1.54437327, +1.58535028, +1.64587760, +1.39511490
727var(0) = getVar(sample, rweight)
728var(0) ! reference
729+0.547062643E-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.547062680E-1
737var(0) ! reference
738+0.547062643E-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.944296658, +0.871913254, +0.654471338, +0.970486999E-1, +0.405974984
753rweight = getUnifRand(1., 2., size(sample, 1, IK))
754rweight
755+1.30375934, +1.39338160, +1.47529328, +1.98242617, +1.74184537
756var(0) = getVar(sample, rweight)
757var(0) ! reference
758+0.102057241
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.102057256
766var(0) ! reference
767+0.102057241
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, +5
777ub
778+4, +10
779sample = getUnifRand(0., 1., ub(nsam))
780sample
781+0.619494915, +0.924784899, +0.283167660, +0.303697586, +0.662817717, +0.842297554, +0.370271325, +0.467912614, +0.610915303, +0.203982949
782rweight = getUnifRand(1., 2., size(sample, 1, IK))
783rweight
784+1.02364397, +1.41277802, +1.11440015, +1.38069582, +1.41518855, +1.71512938, +1.44862175, +1.96951556, +1.01935399, +1.52065945
785var(0) = getVar(sample, rweight)
786var(0) ! reference
787+0.550686046E-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.550686046E-1
795var(0) ! reference
796+0.550686046E-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, +3
806ub
807+2, +6
808sample = getUnifRand(0., 1., ub(nsam))
809sample
810+0.613244355, +0.202264249, +0.432505310, +0.625108123, +0.134365141, +0.172311544
811rweight = getUnifRand(1., 2., size(sample, 1, IK))
812rweight
813+1.56311893, +1.29226828, +1.17688870, +1.04870498, +1.05828714, +1.90559363
814var(0) = getVar(sample, rweight)
815var(0) ! reference
816+0.414039195E-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.414039195E-1
824var(0) ! reference
825+0.414039195E-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, +4
835ub
836+3, +5
837sample = getUnifRand(0., 1., ub(nsam))
838sample
839+0.750656724E-1, +0.827850521, +0.361106753, +0.659582496, +0.497432709
840rweight = getUnifRand(1., 2., size(sample, 1, IK))
841rweight
842+1.44790936, +1.16763639, +1.19120526, +1.01755381, +1.88859749
843var(0) = getVar(sample, rweight)
844var(0) ! reference
845+0.636462867E-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.636462867E-1
853var(0) ! reference
854+0.636462867E-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, +4
869ub
870+3, +9
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.248153925, +0.511797667, -0.435052156, -0.939655304E-1, +0.886184573, +0.827602386, +0.322565079, -0.822329521, +0.269650340
878-0.516603351, +0.908859611, -0.172476530, +0.826574445, +0.613175392, +0.977342606, -0.147323847, -0.892492294, -0.375847697
879+0.219380856E-1, -0.685542464, +0.477514863, +0.819028616, -0.540405631, -0.144897699, +0.216434002, -0.583325744, -0.893738270E-1
880var(:,0) = getVar(sample, dim)
881var(:,0) ! reference
882+0.279799819, +0.436762601, +0.227629662
883do isam = 1, nsam
884 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
885 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
886end do
887varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
888varMerged
889+0.279799789, +0.436762601, +0.227629662
890var(:,0) ! reference
891+0.279799819, +0.436762601, +0.227629662
892
893
894dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
895do isam = 2, nsam
896 lb(isam) = ub(isam - 1) + 1
897 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
898end do
899lb
900+1, +5
901ub
902+4, +10
903ndim = getUnifRand(1, minval(ub - lb + 1, 1))
904call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
905call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
906call setResized(varMerged, ndim)
907sample = getUnifRand(-1., +1., ndim, ub(nsam))
908sample
909-0.797366142, +0.199008822, -0.226268888, -0.113225579, -0.140914440, +0.723812461, +0.903447986, -0.299058080, -0.965169191, -0.621747017
910+0.541703582, -0.649439096, -0.963019729, +0.778552771, -0.709597230, -0.853698015, -0.488128543, -0.412154198E-2, +0.361043692, +0.597456932
911+0.151675463, -0.924453855, -0.442040682, +0.123770952, +0.297016859, +0.726726890, -0.859704018E-1, +0.479097128, -0.753562450E-1, +0.199317932E-1
912-0.461196899, -0.823972821, +0.454768181, +0.401366472, -0.149638414, -0.351350307, +0.820190430, +0.209568501, -0.150694847E-1, +0.166251421
913var(:,0) = getVar(sample, dim)
914var(:,0) ! reference
915+0.332806587, +0.401368618, +0.194037989, +0.214358360
916do isam = 1, nsam
917 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
918 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
919end do
920varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
921varMerged
922+0.332806617, +0.401368737, +0.194038004, +0.214358374
923var(:,0) ! reference
924+0.332806587, +0.401368618, +0.194037989, +0.214358360
925
926
927dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
928do isam = 2, nsam
929 lb(isam) = ub(isam - 1) + 1
930 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
931end do
932lb
933+1, +3
934ub
935+2, +4
936ndim = getUnifRand(1, minval(ub - lb + 1, 1))
937call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
938call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
939call setResized(varMerged, ndim)
940sample = getUnifRand(-1., +1., ndim, ub(nsam))
941sample
942+0.173232555E-1, +0.339896798, +0.599639773, +0.823149443
943+0.478179932, -0.395106673, -0.414477348, +0.485169411
944var(:,0) = getVar(sample, dim)
945var(:,0) ! reference
946+0.902161375E-1, +0.196508795
947do isam = 1, nsam
948 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
949 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
950end do
951varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
952varMerged
953+0.902161300E-1, +0.196508810
954var(:,0) ! reference
955+0.902161375E-1, +0.196508795
956
957
958dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
959do isam = 2, nsam
960 lb(isam) = ub(isam - 1) + 1
961 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
962end do
963lb
964+1, +7
965ub
966+6, +10
967ndim = getUnifRand(1, minval(ub - lb + 1, 1))
968call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
969call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
970call setResized(varMerged, ndim)
971sample = getUnifRand(-1., +1., ndim, ub(nsam))
972sample
973-0.275495291, +0.410267711, -0.729905367, -0.998810530, +0.390446544, -0.988397598E-1, -0.577250242, -0.480860472, -0.283899307E-1, +0.709905624E-1
974+0.742626190E-2, -0.440370440, +0.932383895, +0.758915663, +0.936729431, +0.844413042, -0.377067089, +0.514225364, -0.956914425E-1, +0.864498734
975+0.477515936, +0.684455633E-1, +0.764305234, +0.525687814, +0.730454087, -0.589884996, +0.901432157, -0.500141978, -0.934976816, +0.255442858
976var(:,0) = getVar(sample, dim)
977var(:,0) ! reference
978+0.196986839, +0.283622354, +0.368848294
979do isam = 1, nsam
980 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
981 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
982end do
983varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
984varMerged
985+0.196986854, +0.283622354, +0.368848294
986var(:,0) ! reference
987+0.196986839, +0.283622354, +0.368848294
988
989
990dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
991do isam = 2, nsam
992 lb(isam) = ub(isam - 1) + 1
993 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
994end do
995lb
996+1, +5
997ub
998+4, +10
999ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1000call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1001call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1002call setResized(varMerged, ndim)
1003sample = getUnifRand(-1., +1., ndim, ub(nsam))
1004sample
1005-0.597249508, -0.458823204, -0.433884382, -0.445451736, -0.667106271, -0.683564663, +0.138984084, -0.809266448, +0.765522718E-1, -0.950678110
1006-0.327559710E-1, -0.965742826, -0.723844409, -0.129585028, +0.574365258, +0.158004284, +0.489083767, +0.287865400, +0.313292742E-1, -0.559178591E-1
1007var(:,0) = getVar(sample, dim)
1008var(:,0) ! reference
1009+0.111671649, +0.214203030
1010do isam = 1, nsam
1011 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1012 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1013end do
1014varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1015varMerged
1016+0.111671656, +0.214203030
1017var(:,0) ! reference
1018+0.111671649, +0.214203030
1019
1020
1021dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1022do isam = 2, nsam
1023 lb(isam) = ub(isam - 1) + 1
1024 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1025end do
1026lb
1027+1, +5
1028ub
1029+4, +6
1030ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1031call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1032call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1033call setResized(varMerged, ndim)
1034sample = getUnifRand(-1., +1., ndim, ub(nsam))
1035sample
1036+0.521445274E-1, +0.533009768, +0.476377010E-1, -0.782297134, +0.352764249, +0.164822817
1037var(:,0) = getVar(sample, dim)
1038var(:,0) ! reference
1039+0.171684191
1040do isam = 1, nsam
1041 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1042 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1043end do
1044varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1045varMerged
1046+0.171684191
1047var(:,0) ! reference
1048+0.171684191
1049
1050
1051dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1052do isam = 2, nsam
1053 lb(isam) = ub(isam - 1) + 1
1054 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1055end do
1056lb
1057+1, +6
1058ub
1059+5, +10
1060ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1061call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1062call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1063call setResized(varMerged, ndim)
1064sample = getUnifRand(-1., +1., ndim, ub(nsam))
1065sample
1066-0.892595410, +0.519562602, +0.471104383E-1, +0.481790423, +0.397010207, +0.141675472E-1, -0.270151377, +0.625864863, +0.265135765, -0.251355052
1067-0.498014688, +0.508736491, -0.675096869, +0.748944163, +0.828250647E-1, -0.843198180, -0.903139949, +0.770450592, -0.754778624, -0.382663965
1068+0.270352721, +0.836495519, +0.982545853, -0.865757108, +0.922610760, +0.681728959, +0.352025032, -0.128420711, -0.887451887, +0.476047039
1069var(:,0) = getVar(sample, dim)
1070var(:,0) ! reference
1071+0.196928531, +0.398805946, +0.426126450
1072do isam = 1, nsam
1073 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1074 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1075end do
1076varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1077varMerged
1078+0.196928531, +0.398805976, +0.426126480
1079var(:,0) ! reference
1080+0.196928531, +0.398805946, +0.426126450
1081
1082
1083dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1084do isam = 2, nsam
1085 lb(isam) = ub(isam - 1) + 1
1086 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1087end do
1088lb
1089+1, +3
1090ub
1091+2, +5
1092ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1093call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1094call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1095call setResized(varMerged, ndim)
1096sample = getUnifRand(-1., +1., ndim, ub(nsam))
1097sample
1098+0.214864254, -0.760604024, -0.379057288, -0.637412071, -0.750266910
1099-0.843136668, -0.544027567, +0.407981515, +0.636411905, +0.174571753
1100var(:,0) = getVar(sample, dim)
1101var(:,0) ! reference
1102+0.133611009, +0.320626318
1103do isam = 1, nsam
1104 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1105 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1106end do
1107varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1108varMerged
1109+0.133611023, +0.320626318
1110var(:,0) ! reference
1111+0.133611009, +0.320626318
1112
1113
1114dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1115do isam = 2, nsam
1116 lb(isam) = ub(isam - 1) + 1
1117 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1118end do
1119lb
1120+1, +3
1121ub
1122+2, +9
1123ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1124call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1125call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1126call setResized(varMerged, ndim)
1127sample = getUnifRand(-1., +1., ndim, ub(nsam))
1128sample
1129-0.280235648, -0.839136243, -0.553574085, +0.578182817, -0.176584601, -0.648778677, +0.240890980, -0.243295550, +0.928897381
1130+0.511403918, +0.946263194, +0.491499543, +0.994845629E-1, -0.381803513, -0.455132723E-1, -0.261011362, +0.898139954, +0.204270959
1131var(:,0) = getVar(sample, dim)
1132var(:,0) ! reference
1133+0.305098653, +0.199875101
1134do isam = 1, nsam
1135 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1136 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1137end do
1138varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1139varMerged
1140+0.305098653, +0.199875131
1141var(:,0) ! reference
1142+0.305098653, +0.199875101
1143
1144
1145dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1146do isam = 2, nsam
1147 lb(isam) = ub(isam - 1) + 1
1148 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1149end do
1150lb
1151+1, +6
1152ub
1153+5, +9
1154ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1155call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1156call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1157call setResized(varMerged, ndim)
1158sample = getUnifRand(-1., +1., ndim, ub(nsam))
1159sample
1160-0.299777985E-1, -0.822377205E-2, -0.694473743, +0.289564490, +0.355713844, -0.873055458E-1, -0.642620802, -0.296371698, +0.602029562
1161+0.740467429, -0.908668280, -0.322185278, -0.829017758, +0.717821121, -0.698438287, -0.643073201, +0.630609751, +0.129834890
1162+0.886547327, -0.728577018, +0.582403660, +0.179798961, -0.907945633E-1, -0.961394191, +0.261752605E-1, -0.479997993, -0.769479156
1163+0.180607080, -0.649794340, +0.406925917, +0.485662341, +0.530227423E-1, +0.115342617, +0.822233796, -0.362503052, -0.907731652
1164var(:,0) = getVar(sample, dim)
1165var(:,0) ! reference
1166+0.170601174, +0.426754355, +0.359990865, +0.277953416
1167do isam = 1, nsam
1168 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1169 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1170end do
1171varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1172varMerged
1173+0.170601174, +0.426754355, +0.359990835, +0.277953386
1174var(:,0) ! reference
1175+0.170601174, +0.426754355, +0.359990865, +0.277953416
1176
1177
1178!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179!Compute the biased merged variance of a frequency weighted multivariate sample.
1180!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1181
1182
1183dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1184do isam = 2, nsam
1185 lb(isam) = ub(isam - 1) + 1
1186 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1187end do
1188lb
1189+1, +4
1190ub
1191+3, +8
1192ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1193call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1194call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1195call setResized(varMerged, ndim)
1196sample = getUnifRand(-1., +1., ndim, ub(nsam))
1197sample
1198+0.881604314, -0.895746112, +0.575713992, +0.572323680, +0.397349358, +0.731005907, -0.553747773, +0.289146304
1199-0.148853421, -0.475860596, +0.846124530, +0.172455549, -0.650237560, +0.894009590, +0.304798365, +0.193701744
1200-0.598479390, +0.437420487, +0.908769965, -0.592620730, +0.209958196, -0.311087847, -0.812090755, -0.164920807
1201iweight = getUnifRand(1, 10, size(sample, dim, IK))
1202iweight
1203+7, +4, +3, +9, +4, +6, +7, +7
1204var(:,0) = getVar(sample, 2_IK, iweight)
1205var(:,0) ! reference
1206+0.324096948, +0.206631124, +0.232492760
1207do isam = 1, nsam
1208 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1209 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1210end do
1211varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1212varMerged
1213+0.324096978, +0.206631124, +0.232492775
1214var(:,0) ! reference
1215+0.324096948, +0.206631124, +0.232492760
1216
1217
1218dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1219do isam = 2, nsam
1220 lb(isam) = ub(isam - 1) + 1
1221 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1222end do
1223lb
1224+1, +7
1225ub
1226+6, +12
1227ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1228call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1229call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1230call setResized(varMerged, ndim)
1231sample = getUnifRand(-1., +1., ndim, ub(nsam))
1232sample
1233+0.734284520, -0.926915884, -0.774410605, -0.715377450, -0.964297891, -0.464085460, +0.575999022E-1, +0.312040210, +0.554503560, +0.842101574, +0.967288017E-2, +0.244652033
1234-0.126430869, -0.965817213, -0.553023100, -0.324027300, -0.625915170, -0.383487701, -0.497414947, -0.432289958, +0.343441486, +0.273284197, +0.922684789, +0.675285816
1235+0.438598394, +0.111232996, +0.279046774, +0.106586695, +0.666089892, +0.281361341, -0.644698262, +0.589793682, -0.823212147, -0.422694087, +0.935795307E-1, +0.154405594
1236iweight = getUnifRand(1, 10, size(sample, dim, IK))
1237iweight
1238+1, +9, +2, +9, +6, +6, +5, +6, +5, +9, +8, +7
1239var(:,0) = getVar(sample, 2_IK, iweight)
1240var(:,0) ! reference
1241+0.391175568, +0.356345445, +0.177875265
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.391175628, +0.356345415, +0.177875280
1249var(:,0) ! reference
1250+0.391175568, +0.356345445, +0.177875265
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, +7
1260ub
1261+6, +11
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.508738756E-1, -0.938986659, -0.114867210, -0.658498287, -0.111835003E-1, +0.549366951, +0.739959598, -0.310875535, +0.479647160, +0.406591415, -0.785005331
1269+0.157791734, -0.239802599, -0.791406751, +0.953121424, -0.966597438, -0.628845930, -0.608467221, -0.881785274, -0.894540071, -0.938087702, -0.956108570E-1
1270-0.478577614, +0.983921170, -0.219852090, +0.930095553, -0.243473649, +0.774161458, -0.520842791, +0.202416062, -0.961986661, +0.242954016, +0.393709660
1271+0.819673538, +0.981452942, +0.129938006, -0.654617071, -0.949551702, +0.339841127, +0.922917843, -0.288217902, +0.791724920, +0.573927283, +0.817890525
1272+0.523743391, -0.295578957, -0.948847294, +0.644690394, -0.666046023, -0.851729870, +0.731022000, +0.182640195, +0.157777667, -0.537541151, +0.429963589
1273iweight = getUnifRand(1, 10, size(sample, dim, IK))
1274iweight
1275+1, +4, +3, +7, +8, +8, +5, +9, +9, +7, +10
1276var(:,0) = getVar(sample, 2_IK, iweight)
1277var(:,0) ! reference
1278+0.306535840, +0.329051346, +0.369700938, +0.440514028, +0.316087961
1279do isam = 1, nsam
1280 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1281 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1282end do
1283varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1284varMerged
1285+0.306535840, +0.329051286, +0.369700968, +0.440514028, +0.316087931
1286var(:,0) ! reference
1287+0.306535840, +0.329051346, +0.369700938, +0.440514028, +0.316087961
1288
1289
1290dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1291do isam = 2, nsam
1292 lb(isam) = ub(isam - 1) + 1
1293 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1294end do
1295lb
1296+1, +3
1297ub
1298+2, +8
1299ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1300call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1301call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1302call setResized(varMerged, ndim)
1303sample = getUnifRand(-1., +1., ndim, ub(nsam))
1304sample
1305+0.438171625E-1, -0.113482118, -0.142538428, -0.324009895, -0.819524169, +0.912526369, -0.366175175, +0.731071234E-1
1306iweight = getUnifRand(1, 10, size(sample, dim, IK))
1307iweight
1308+8, +4, +1, +7, +2, +1, +4, +10
1309var(:,0) = getVar(sample, 2_IK, iweight)
1310var(:,0) ! reference
1311+0.854306147E-1
1312do isam = 1, nsam
1313 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1314 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1315end do
1316varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1317varMerged
1318+0.854306147E-1
1319var(:,0) ! reference
1320+0.854306147E-1
1321
1322
1323dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1324do isam = 2, nsam
1325 lb(isam) = ub(isam - 1) + 1
1326 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1327end do
1328lb
1329+1, +7
1330ub
1331+6, +9
1332ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1333call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1334call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1335call setResized(varMerged, ndim)
1336sample = getUnifRand(-1., +1., ndim, ub(nsam))
1337sample
1338-0.716207623, +0.487008810, -0.140450478, -0.694884539, +0.358793020, -0.958923221, -0.917250037, -0.814795494E-2, -0.369347930
1339iweight = getUnifRand(1, 10, size(sample, dim, IK))
1340iweight
1341+5, +10, +6, +7, +7, +8, +6, +2, +9
1342var(:,0) = getVar(sample, 2_IK, iweight)
1343var(:,0) ! reference
1344+0.288540065
1345do isam = 1, nsam
1346 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1347 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1348end do
1349varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1350varMerged
1351+0.288540035
1352var(:,0) ! reference
1353+0.288540065
1354
1355
1356dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1357do isam = 2, nsam
1358 lb(isam) = ub(isam - 1) + 1
1359 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1360end do
1361lb
1362+1, +5
1363ub
1364+4, +6
1365ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1366call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1367call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1368call setResized(varMerged, ndim)
1369sample = getUnifRand(-1., +1., ndim, ub(nsam))
1370sample
1371-0.558561444, -0.937835574, -0.434760809, +0.628745914, +0.469564915, -0.867653251
1372iweight = getUnifRand(1, 10, size(sample, dim, IK))
1373iweight
1374+8, +10, +6, +5, +2, +9
1375var(:,0) = getVar(sample, 2_IK, iweight)
1376var(:,0) ! reference
1377+0.285902947
1378do isam = 1, nsam
1379 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1380 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1381end do
1382varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1383varMerged
1384+0.285902977
1385var(:,0) ! reference
1386+0.285902947
1387
1388
1389dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1390do isam = 2, nsam
1391 lb(isam) = ub(isam - 1) + 1
1392 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1393end do
1394lb
1395+1, +7
1396ub
1397+6, +13
1398ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1399call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1400call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1401call setResized(varMerged, ndim)
1402sample = getUnifRand(-1., +1., ndim, ub(nsam))
1403sample
1404-0.985231638, +0.515649319, +0.947988153, +0.310510874, +0.666336656, +0.564023137, +0.190540791, +0.169001102, -0.716942787, +0.992497087, -0.405874372, -0.609213233, +0.397433162
1405+0.630192995, -0.996184349E-2, -0.157305837, +0.734052420, +0.673275590, +0.367967725, +0.430515528, +0.658683777, +0.194660187, +0.502692461E-1, +0.880883813, -0.338512540, -0.949913144
1406-0.832275867, -0.160214305, +0.694209099, +0.285406590, -0.756618977E-1, +0.695375562, +0.970763445, +0.582557917, +0.484848022E-2, -0.592172742, +0.407902241, -0.344997525, +0.427755237
1407+0.881013751, +0.602115273, -0.731452107, +0.213244677, +0.407594442E-1, -0.338384748, +0.623474717, -0.479794502, -0.422784209, +0.778139949, +0.988516808E-1, +0.764218092, -0.254656792
1408iweight = getUnifRand(1, 10, size(sample, dim, IK))
1409iweight
1410+2, +1, +9, +10, +8, +2, +9, +3, +3, +4, +7, +4, +7
1411var(:,0) = getVar(sample, 2_IK, iweight)
1412var(:,0) ! reference
1413+0.294096649, +0.302271187, +0.220465630, +0.246193051
1414do isam = 1, nsam
1415 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1416 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1417end do
1418varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1419varMerged
1420+0.294096649, +0.302271217, +0.220465630, +0.246193051
1421var(:,0) ! reference
1422+0.294096649, +0.302271187, +0.220465630, +0.246193051
1423
1424
1425dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1426do isam = 2, nsam
1427 lb(isam) = ub(isam - 1) + 1
1428 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1429end do
1430lb
1431+1, +3
1432ub
1433+2, +8
1434ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1435call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1436call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1437call setResized(varMerged, ndim)
1438sample = getUnifRand(-1., +1., ndim, ub(nsam))
1439sample
1440+0.670528531, +0.272649050, +0.799606323, +0.199103236, -0.726552725, +0.923892260E-1, -0.227307916, -0.425842166
1441-0.578824282E-1, -0.620721817, +0.786860824, +0.278024673E-1, -0.912083387, +0.589691281, -0.172497630, -0.891990423
1442iweight = getUnifRand(1, 10, size(sample, dim, IK))
1443iweight
1444+10, +8, +5, +9, +4, +3, +5, +9
1445var(:,0) = getVar(sample, 2_IK, iweight)
1446var(:,0) ! reference
1447+0.221257299, +0.285338104
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.221257299, +0.285338104
1455var(:,0) ! reference
1456+0.221257299, +0.285338104
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, +8
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.220469117, +0.277107954E-1, -0.791590691, -0.636202812, -0.146848321, +0.480560780, -0.683056116, -0.737797022
1475iweight = getUnifRand(1, 10, size(sample, dim, IK))
1476iweight
1477+7, +10, +4, +5, +2, +6, +5, +1
1478var(:,0) = getVar(sample, 2_IK, iweight)
1479var(:,0) ! reference
1480+0.206419230
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.206419230
1488var(:,0) ! reference
1489+0.206419230
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, +6
1499ub
1500+5, +12
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.502020717, +0.827441096, -0.141045570, -0.522082686, +0.279956579, +0.993186235E-1, -0.159177542, -0.185684085, +0.605440140E-1, +0.136377692, +0.423890114, -0.459956765
1508+0.176876903, +0.505335331E-1, +0.677622199, -0.442644954, +0.334776640E-1, +0.690779686, -0.550491810, -0.608230114, +0.252909422, -0.266430855, -0.980308890, +0.442942739
1509+0.384657979, +0.435561538, +0.869737148, -0.758538246E-1, -0.951912165, +0.873623371, -0.263045907, +0.635682821, +0.104542375, +0.443997264, -0.480826497, -0.586323738E-1
1510iweight = getUnifRand(1, 10, size(sample, dim, IK))
1511iweight
1512+8, +7, +8, +1, +9, +2, +2, +9, +10, +9, +4, +10
1513var(:,0) = getVar(sample, 2_IK, iweight)
1514var(:,0) ! reference
1515+0.143853232, +0.203078970, +0.283765972
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.143853247, +0.203078970, +0.283765942
1523var(:,0) ! reference
1524+0.143853232, +0.203078970, +0.283765972
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, +7
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.502131462, -0.746106982, -0.300503016, -0.999782443, +0.443189144E-1, +0.455519557, +0.500223517
1548+0.275348306, +0.850111604, -0.470774412, -0.299486279, -0.507407069, +0.898362279, +0.831669331
1549rweight = getUnifRand(1., 2., size(sample, dim, IK))
1550rweight
1551+1.01353979, +1.74738526, +1.53852677, +1.71771812, +1.83832645, +1.98019576, +1.26734030
1552var(:,0) = getVar(sample, 2_IK, rweight)
1553var(:,0) ! reference
1554+0.297919780, +0.383017033
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.297919810, +0.383017033
1562var(:,0) ! reference
1563+0.297919780, +0.383017033
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, +8
1573ub
1574+7, +13
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.492861629, +0.785077691, -0.404614210E-1, -0.406001925, -0.756216884, +0.920918107, +0.535458684, +0.862004042, -0.261933565, -0.912631631, -0.112977743, -0.271438360E-1, -0.616488934
1582rweight = getUnifRand(1., 2., size(sample, dim, IK))
1583rweight
1584+1.89209628, +1.40125990, +1.98116851, +1.59924984, +1.92742884, +1.77556777, +1.94076705, +1.18031430, +1.55996013, +1.16285634, +1.01289797, +1.06307292, +1.71726394
1585var(:,0) = getVar(sample, 2_IK, rweight)
1586var(:,0) ! reference
1587+0.362946272
1588do isam = 1, nsam
1589 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1590 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1591end do
1592varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1593varMerged
1594+0.362946272
1595var(:,0) ! reference
1596+0.362946272
1597
1598
1599dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1600do isam = 2, nsam
1601 lb(isam) = ub(isam - 1) + 1
1602 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1603end do
1604lb
1605+1, +8
1606ub
1607+7, +14
1608ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1609call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1610call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1611call setResized(varMerged, ndim)
1612sample = getUnifRand(-1., +1., ndim, ub(nsam))
1613sample
1614+0.842771292, -0.890187025E-1, +0.750771761, -0.336473703, -0.755279303, +0.670924902, +0.156185031, -0.572536826, -0.489765406E-1, +0.798461437, +0.948037744, -0.300625086, -0.102650523, -0.642836452
1615-0.499690533, -0.680883646, +0.914862156, -0.595708489, -0.198691487, -0.500711203E-1, +0.325900316, +0.199739695, -0.963100076, +0.551795244, +0.925566912, +0.151748538, +0.492668152E-2, +0.560455203
1616-0.506217837, +0.830489278, -0.839918017, -0.211881399, -0.913953781E-1, -0.162350535, -0.124701619, -0.331104994E-1, -0.856443286, -0.622270703, +0.823140144E-3, -0.113244534, -0.904417396, -0.440245032
1617+0.717346668, +0.992115021, +0.232888222, -0.271940231, +0.816237926, -0.685805202, -0.349079490, -0.426141858, -0.705198765, -0.745509267, -0.966575980, -0.712008476E-1, +0.632662535, +0.715790153
1618rweight = getUnifRand(1., 2., size(sample, dim, IK))
1619rweight
1620+1.83510959, +1.18219364, +1.02842379, +1.36722660, +1.06629515, +1.81518745, +1.96314335, +1.16100883, +1.81501794, +1.57483649, +1.80689538, +1.58036375, +1.82988548, +1.49290407
1621var(:,0) = getVar(sample, 2_IK, rweight)
1622var(:,0) ! reference
1623+0.319511622, +0.317693233, +0.174716562, +0.426319122
1624do isam = 1, nsam
1625 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1626 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1627end do
1628varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1629varMerged
1630+0.319511682, +0.317693293, +0.174716562, +0.426319152
1631var(:,0) ! reference
1632+0.319511622, +0.317693233, +0.174716562, +0.426319122
1633
1634
1635dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1636do isam = 2, nsam
1637 lb(isam) = ub(isam - 1) + 1
1638 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1639end do
1640lb
1641+1, +8
1642ub
1643+7, +13
1644ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1645call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1646call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1647call setResized(varMerged, ndim)
1648sample = getUnifRand(-1., +1., ndim, ub(nsam))
1649sample
1650-0.447793603, -0.611723065, -0.572268009, -0.647246003, +0.861192465, +0.124569893, +0.500163198, +0.506938696E-1, +0.417342186, -0.812967658, -0.149348259, +0.720001578, +0.551292062
1651rweight = getUnifRand(1., 2., size(sample, dim, IK))
1652rweight
1653+1.68785191, +1.06774735, +1.46865368, +1.41092920, +1.47150648, +1.43943214, +1.35773158, +1.49829030, +1.36132097, +1.65332413, +1.58864403, +1.48007464, +1.04028034
1654var(:,0) = getVar(sample, 2_IK, rweight)
1655var(:,0) ! reference
1656+0.308211774
1657do isam = 1, nsam
1658 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1659 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1660end do
1661varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1662varMerged
1663+0.308211803
1664var(:,0) ! reference
1665+0.308211774
1666
1667
1668dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1669do isam = 2, nsam
1670 lb(isam) = ub(isam - 1) + 1
1671 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1672end do
1673lb
1674+1, +5
1675ub
1676+4, +11
1677ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1678call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1679call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1680call setResized(varMerged, ndim)
1681sample = getUnifRand(-1., +1., ndim, ub(nsam))
1682sample
1683+0.157045364, -0.358717322, +0.814313889, -0.472151399, +0.841434002, -0.848280430, +0.561260819, +0.879454851, -0.216105342, +0.904388309, -0.145375609
1684+0.572708368, -0.417698026, -0.867421031, -0.986497283, +0.224265099, -0.877309322, -0.622886658, +0.871299744, -0.973936319, +0.808501244E-2, -0.844509006
1685-0.399775982, -0.107835531E-1, -0.424404144E-1, -0.211063027, -0.179936647, -0.950003505, -0.342575788, -0.289553285, -0.116066337, -0.605256677, +0.390786290
1686rweight = getUnifRand(1., 2., size(sample, dim, IK))
1687rweight
1688+1.81007135, +1.90195537, +1.23146546, +1.22132969, +1.74873185, +1.34424853, +1.99542785, +1.55010390, +1.67846477, +1.16442585, +1.61701810
1689var(:,0) = getVar(sample, 2_IK, rweight)
1690var(:,0) ! reference
1691+0.338647395, +0.404145569, +0.100094534
1692do isam = 1, nsam
1693 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1694 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1695end do
1696varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1697varMerged
1698+0.338647425, +0.404145569, +0.100094542
1699var(:,0) ! reference
1700+0.338647395, +0.404145569, +0.100094534
1701
1702
1703dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1704do isam = 2, nsam
1705 lb(isam) = ub(isam - 1) + 1
1706 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1707end do
1708lb
1709+1, +4
1710ub
1711+3, +10
1712ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1713call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1714call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1715call setResized(varMerged, ndim)
1716sample = getUnifRand(-1., +1., ndim, ub(nsam))
1717sample
1718+0.620210290, -0.361890793, -0.390722632, +0.274759054, -0.206431270, +0.428899884, -0.726610899, +0.893729568, -0.179257870, +0.515061259
1719+0.988383174, -0.223206162, +0.229513288, -0.905630827, -0.861999750, -0.681332827, +0.696619749E-1, +0.355582237, -0.729834080, -0.760339379
1720+0.906401038, -0.976305246, -0.815969467, +0.371426702, -0.342071056E-2, +0.666623950, -0.763038278, +0.409526229, -0.935055137, +0.768824339
1721rweight = getUnifRand(1., 2., size(sample, dim, IK))
1722rweight
1723+1.50926352, +1.88646388, +1.96194077, +1.26393926, +1.04643250, +1.42938113, +1.50640869, +1.53481197, +1.93529058, +1.23534799
1724var(:,0) = getVar(sample, 2_IK, rweight)
1725var(:,0) ! reference
1726+0.254728138, +0.354471594, +0.551283300
1727do isam = 1, nsam
1728 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1729 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1730end do
1731varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1732varMerged
1733+0.254728138, +0.354471564, +0.551283300
1734var(:,0) ! reference
1735+0.254728138, +0.354471594, +0.551283300
1736
1737
1738dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1739do isam = 2, nsam
1740 lb(isam) = ub(isam - 1) + 1
1741 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1742end do
1743lb
1744+1, +3
1745ub
1746+2, +4
1747ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1748call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1749call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1750call setResized(varMerged, ndim)
1751sample = getUnifRand(-1., +1., ndim, ub(nsam))
1752sample
1753-0.799981952, -0.150984883, -0.288643599, +0.716029048
1754rweight = getUnifRand(1., 2., size(sample, dim, IK))
1755rweight
1756+1.33277273, +1.82335830, +1.46112192, +1.68813431
1757var(:,0) = getVar(sample, 2_IK, rweight)
1758var(:,0) ! reference
1759+0.290700287
1760do isam = 1, nsam
1761 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1762 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1763end do
1764varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1765varMerged
1766+0.290700257
1767var(:,0) ! reference
1768+0.290700287
1769
1770
1771dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1772do isam = 2, nsam
1773 lb(isam) = ub(isam - 1) + 1
1774 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1775end do
1776lb
1777+1, +6
1778ub
1779+5, +7
1780ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1781call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1782call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1783call setResized(varMerged, ndim)
1784sample = getUnifRand(-1., +1., ndim, ub(nsam))
1785sample
1786-0.490163565, -0.952632546, -0.359111190, +0.118270040, -0.697934985, +0.650201082, +0.545851111
1787rweight = getUnifRand(1., 2., size(sample, dim, IK))
1788rweight
1789+1.89066720, +1.00845265, +1.11416030, +1.54784727, +1.73965836, +1.66254270, +1.80471933
1790var(:,0) = getVar(sample, 2_IK, rweight)
1791var(:,0) ! reference
1792+0.322905600
1793do isam = 1, nsam
1794 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1795 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1796end do
1797varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1798varMerged
1799+0.322905660
1800var(:,0) ! reference
1801+0.322905600
1802
1803
1804dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1805do isam = 2, nsam
1806 lb(isam) = ub(isam - 1) + 1
1807 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1808end do
1809lb
1810+1, +4
1811ub
1812+3, +10
1813ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1814call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1815call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1816call setResized(varMerged, ndim)
1817sample = getUnifRand(-1., +1., ndim, ub(nsam))
1818sample
1819+0.239275575, +0.481070995, -0.787302971, -0.425553083, -0.854183316, -0.123865247, -0.337124705, +0.663263083, -0.118128657, +0.880027533
1820+0.500170350, -0.869734168, +0.246530652, -0.312808156, -0.674386740, +0.753904104, +0.548166275, +0.413945436, -0.479273319, -0.491525054
1821+0.395317435, -0.133545399, +0.837477088, +0.416940451, -0.133447051, -0.231696367, +0.473082066E-2, +0.403489947, -0.421745181, -0.177896023E-2
1822rweight = getUnifRand(1., 2., size(sample, dim, IK))
1823rweight
1824+1.02310753, +1.43028569, +1.38176870, +1.18758535, +1.96829116, +1.93422508, +1.58826995, +1.24541020, +1.52453411, +1.71510065
1825var(:,0) = getVar(sample, 2_IK, rweight)
1826var(:,0) ! reference
1827+0.329579890, +0.329564095, +0.126985148
1828do isam = 1, nsam
1829 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1830 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1831end do
1832varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1833varMerged
1834+0.329579890, +0.329564095, +0.126985162
1835var(:,0) ! reference
1836+0.329579890, +0.329564095, +0.126985148
1837
1838
1839dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1840do isam = 2, nsam
1841 lb(isam) = ub(isam - 1) + 1
1842 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1843end do
1844lb
1845+1, +5
1846ub
1847+4, +8
1848ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1849call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1850call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1851call setResized(varMerged, ndim)
1852sample = getUnifRand(-1., +1., ndim, ub(nsam))
1853sample
1854+0.683735609, +0.927791119, -0.118900418, -0.407752037, -0.977032781, +0.167124033, -0.736724138E-1, +0.964440465
1855-0.546610236, +0.690082908, -0.582648039, +0.653517127, -0.441436052, +0.334902763, -0.289391279, +0.871204376
1856+0.481626272, -0.462958694, -0.531870008, -0.333116174, +0.847521544, -0.455672860, -0.401755214, +0.301874042
1857-0.739399314, +0.425172210, -0.875718355, +0.357468128, +0.731451154, +0.374519467, +0.194556475, -0.906761289
1858rweight = getUnifRand(1., 2., size(sample, dim, IK))
1859rweight
1860+1.64261055, +1.49371743, +1.40928197, +1.25560689, +1.42823911, +1.28698277, +1.63394737, +1.60990977
1861var(:,0) = getVar(sample, 2_IK, rweight)
1862var(:,0) ! reference
1863+0.409825385, +0.334594548, +0.247494191, +0.396060824
1864do isam = 1, nsam
1865 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1866 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1867end do
1868varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1869varMerged
1870+0.409825385, +0.334594518, +0.247494176, +0.396060824
1871var(:,0) ! reference
1872+0.409825385, +0.334594548, +0.247494191, +0.396060824
1873
1874
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 Austin

Definition at line 8330 of file pm_sampleVar.F90.


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