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, +3
14ub
15+2, +5
16sample = getUnifRand(0., 1., ub(nsam))
17sample
18+0.182234049, +0.174402058, +0.354931891, +0.732171595, +0.320593596
19var(0) = getVar(sample)
20var(0) ! reference
21+0.411766320E-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.411766320E-1
29var(0) ! reference
30+0.411766320E-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, +3
40ub
41+2, +9
42sample = getUnifRand(0., 1., ub(nsam))
43sample
44+0.394102752, +0.520990670, +0.653989136, +0.344925046, +0.981275141, +0.783666909, +0.728793263, +0.505231023, +0.607062221
45var(0) = getVar(sample)
46var(0) ! reference
47+0.355262533E-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.355262458E-1
55var(0) ! reference
56+0.355262533E-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, +9
68sample = getUnifRand(0., 1., ub(nsam))
69sample
70+0.457133591, +0.722469449, +0.698928177, +0.773981571, +0.912563741, +0.511028051, +0.616661668, +0.444111347, +0.638008118E-3
71var(0) = getVar(sample)
72var(0) ! reference
73+0.619151518E-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.619151480E-1
81var(0) ! reference
82+0.619151518E-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, +6
94sample = getUnifRand(0., 1., ub(nsam))
95sample
96+0.820026875, +0.732278943, +0.300563812, +0.411590040, +0.103396237, +0.895732105
97var(0) = getVar(sample)
98var(0) ! reference
99+0.843800828E-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.843800828E-1
107var(0) ! reference
108+0.843800828E-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, +7
118ub
119+6, +12
120sample = getUnifRand(0., 1., ub(nsam))
121sample
122+0.894285798, +0.518491447, +0.916641355E-1, +0.466368794, +0.731559634, +0.894708276, +0.569462001, +0.549168408, +0.733779073, +0.425113976, +0.620083451, +0.121405125
123var(0) = getVar(sample)
124var(0) ! reference
125+0.605594628E-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.605594665E-1
133var(0) ! reference
134+0.605594628E-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, +7
144ub
145+6, +11
146sample = getUnifRand(0., 1., ub(nsam))
147sample
148+0.621514916E-1, +0.946530819, +0.683901906E-1, +0.100940526, +0.655119061, +0.905247390, +0.476840019, +0.560650647, +0.556125045E-1, +0.518945634, +0.399103642
149var(0) = getVar(sample)
150var(0) ! reference
151+0.987234414E-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.987234488E-1
159var(0) ! reference
160+0.987234414E-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, +6
172sample = getUnifRand(0., 1., ub(nsam))
173sample
174+0.211919963, +0.880710065, +0.350499451, +0.791747332, +0.902127206, +0.245084167
175var(0) = getVar(sample)
176var(0) ! reference
177+0.896256045E-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.896256045E-1
185var(0) ! reference
186+0.896256045E-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, +5
196ub
197+4, +9
198sample = getUnifRand(0., 1., ub(nsam))
199sample
200+0.307436645, +0.480020404, +0.772786438, +0.642742932, +0.614730835, +0.492664635, +0.498254180, +0.481053591, +0.884803534
201var(0) = getVar(sample)
202var(0) ! reference
203+0.270412825E-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.270412825E-1
211var(0) ! reference
212+0.270412825E-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, +5
222ub
223+4, +7
224sample = getUnifRand(0., 1., ub(nsam))
225sample
226+0.884218514, +0.725850701, +0.519775867, +0.592363238, +0.183229625, +0.568227768, +0.108527780
227var(0) = getVar(sample)
228var(0) ! reference
229+0.664054751E-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.664054900E-1
237var(0) ! reference
238+0.664054751E-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, +6
248ub
249+5, +12
250sample = getUnifRand(0., 1., ub(nsam))
251sample
252+0.297161162, +0.115397573, +0.112330317E-1, +0.502772689, +0.862255096, +0.554976463E-1, +0.161580920, +0.863208115, +0.429677367, +0.734817386E-1, +0.218621731, +0.859770536
253var(0) = getVar(sample)
254var(0) ! reference
255+0.998879448E-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.998879597E-1
263var(0) ! reference
264+0.998879448E-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, +9
281sample = getUnifRand(0., 1., ub(nsam))
282sample
283+0.382468760, +0.160813332E-1, +0.502995074, +0.222122133, +0.272891521E-1, +0.781097829, +0.626653910, +0.487210989, +0.888671935
284iweight = getUnifRand(1, 10, size(sample, 1, IK))
285iweight
286+4, +6, +5, +3, +7, +1, +5, +9, +7
287var(0) = getVar(sample, iweight)
288var(0) ! reference
289+0.880235136E-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.880235210E-1
297var(0) ! reference
298+0.880235136E-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, +5
308ub
309+4, +10
310sample = getUnifRand(0., 1., ub(nsam))
311sample
312+0.212393701, +0.716215372E-2, +0.342143774, +0.696201861, +0.656434298, +0.884062767, +0.135542870, +0.762080252, +0.379738927, +0.245942116
313iweight = getUnifRand(1, 10, size(sample, 1, IK))
314iweight
315+6, +4, +8, +2, +2, +5, +5, +10, +5, +5
316var(0) = getVar(sample, iweight)
317var(0) ! reference
318+0.779508278E-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.779508352E-1
326var(0) ! reference
327+0.779508278E-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, +6
337ub
338+5, +9
339sample = getUnifRand(0., 1., ub(nsam))
340sample
341+0.672796369E-1, +0.942123413, +0.258355558, +0.306882620, +0.890473545, +0.604522109, +0.986822784, +0.755068541, +0.780144870
342iweight = getUnifRand(1, 10, size(sample, 1, IK))
343iweight
344+10, +5, +3, +6, +4, +1, +9, +7, +8
345var(0) = getVar(sample, iweight)
346var(0) ! reference
347+0.120559603
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.120559603
355var(0) ! reference
356+0.120559603
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, +7
366ub
367+6, +10
368sample = getUnifRand(0., 1., ub(nsam))
369sample
370+0.207137406, +0.778321564, +0.245814145, +0.157964289, +0.645820141, +0.464404225E-1, +0.793581903, +0.675531030, +0.953924894, +0.833395481
371iweight = getUnifRand(1, 10, size(sample, 1, IK))
372iweight
373+10, +10, +6, +5, +6, +5, +2, +7, +8, +6
374var(0) = getVar(sample, iweight)
375var(0) ! reference
376+0.977604240E-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.977604240E-1
384var(0) ! reference
385+0.977604240E-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, +7
395ub
396+6, +11
397sample = getUnifRand(0., 1., ub(nsam))
398sample
399+0.261079252, +0.208326221, +0.221093297, +0.657559276, +0.908049285, +0.411810219, +0.142913520, +0.409741879, +0.695946991, +0.536857486, +0.178360701
400iweight = getUnifRand(1, 10, size(sample, 1, IK))
401iweight
402+6, +4, +5, +4, +4, +8, +8, +5, +2, +10, +4
403var(0) = getVar(sample, iweight)
404var(0) ! reference
405+0.468110219E-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.468110181E-1
413var(0) ! reference
414+0.468110219E-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, +6
424ub
425+5, +10
426sample = getUnifRand(0., 1., ub(nsam))
427sample
428+0.739604712, +0.644864678, +0.173360646, +0.939315081, +0.387524664, +0.674909353E-2, +0.750232339, +0.373526454, +0.589611828, +0.307395577
429iweight = getUnifRand(1, 10, size(sample, 1, IK))
430iweight
431+4, +2, +9, +3, +6, +7, +6, +2, +4, +4
432var(0) = getVar(sample, iweight)
433var(0) ! reference
434+0.828140676E-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.828140602E-1
442var(0) ! reference
443+0.828140676E-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, +10
455sample = getUnifRand(0., 1., ub(nsam))
456sample
457+0.204181612, +0.638289094, +0.538448095, +0.561043084, +0.931908429, +0.181455910, +0.547008276, +0.226407468, +0.948878646, +0.146112025
458iweight = getUnifRand(1, 10, size(sample, 1, IK))
459iweight
460+1, +1, +10, +2, +5, +3, +7, +9, +9, +1
461var(0) = getVar(sample, iweight)
462var(0) ! reference
463+0.790180787E-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.790180713E-1
471var(0) ! reference
472+0.790180787E-1
473
474
475lb(1) = 1; ub(1) = getUnifRand(2, 7)
476do isam = 2, nsam
477 lb(isam) = ub(isam - 1) + 1
478 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
479end do
480lb
481+1, +3
482ub
483+2, +7
484sample = getUnifRand(0., 1., ub(nsam))
485sample
486+0.241582334, +0.937866032, +0.721477926, +0.576555371, +0.322586000, +0.139803231, +0.370469451
487iweight = getUnifRand(1, 10, size(sample, 1, IK))
488iweight
489+9, +6, +7, +7, +6, +8, +6
490var(0) = getVar(sample, iweight)
491var(0) ! reference
492+0.684061646E-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.684061721E-1
500var(0) ! reference
501+0.684061646E-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, +8
511ub
512+7, +11
513sample = getUnifRand(0., 1., ub(nsam))
514sample
515+0.550140142E-1, +0.493609071, +0.680733919, +0.900699377, +0.283688903E-1, +0.770627379, +0.158058465, +0.647689104E-1, +0.322618127, +0.635512114, +0.487133205
516iweight = getUnifRand(1, 10, size(sample, 1, IK))
517iweight
518+6, +7, +4, +6, +4, +3, +10, +9, +2, +4, +2
519var(0) = getVar(sample, iweight)
520var(0) ! reference
521+0.934224948E-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.934224874E-1
529var(0) ! reference
530+0.934224948E-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, +6
540ub
541+5, +10
542sample = getUnifRand(0., 1., ub(nsam))
543sample
544+0.172061801, +0.104882240, +0.494392276, +0.907616019E-1, +0.991736829, +0.920448720, +0.734997630, +0.176617503E-1, +0.348574579, +0.736647189
545iweight = getUnifRand(1, 10, size(sample, 1, IK))
546iweight
547+3, +7, +5, +3, +7, +7, +9, +1, +3, +3
548var(0) = getVar(sample, iweight)
549var(0) ! reference
550+0.116501093
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.116501093
558var(0) ! reference
559+0.116501093
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, +7
574ub
575+6, +13
576sample = getUnifRand(0., 1., ub(nsam))
577sample
578+0.241393149, +0.446497917, +0.411644340, +0.526767552, +0.819054604, +0.137987673, +0.849699497, +0.723814964, +0.965118051, +0.929320276, +0.107089281, +0.821529627, +0.908233047
579rweight = getUnifRand(1., 2., size(sample, 1, IK))
580rweight
581+1.50712216, +1.78421557, +1.26805973, +1.60264945, +1.13804126, +1.52093470, +1.21997702, +1.07993650, +1.25062084, +1.72983623, +1.50810754, +1.17462063, +1.21772325
582var(0) = getVar(sample, rweight)
583var(0) ! reference
584+0.917367637E-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.917367563E-1
592var(0) ! reference
593+0.917367637E-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, +8
603ub
604+7, +12
605sample = getUnifRand(0., 1., ub(nsam))
606sample
607+0.804200172E-1, +0.400269091, +0.749942899, +0.773480117, +0.247625411, +0.250891566, +0.377739012, +0.107215047, +0.350010455, +0.695428252, +0.103977323, +0.427896380
608rweight = getUnifRand(1., 2., size(sample, 1, IK))
609rweight
610+1.20228100, +1.68826616, +1.74923539, +1.14268935, +1.54522192, +1.06151533, +1.62226963, +1.82337391, +1.30488539, +1.32070589, +1.11754572, +1.67581749
611var(0) = getVar(sample, rweight)
612var(0) ! reference
613+0.537035055E-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.537035055E-1
621var(0) ! reference
622+0.537035055E-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, +3
632ub
633+2, +9
634sample = getUnifRand(0., 1., ub(nsam))
635sample
636+0.600084484, +0.987446547, +0.553228319, +0.165071189, +0.571564436E-1, +0.363627315, +0.852417886, +0.344087064, +0.873355448
637rweight = getUnifRand(1., 2., size(sample, 1, IK))
638rweight
639+1.27783585, +1.30037594, +1.35578585, +1.50270128, +1.27560782, +1.13776350, +1.97723854, +1.39861393, +1.45295167
640var(0) = getVar(sample, rweight)
641var(0) ! reference
642+0.959173515E-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.959173590E-1
650var(0) ! reference
651+0.959173515E-1
652
653
654lb(1) = 1; ub(1) = getUnifRand(2, 7)
655do isam = 2, nsam
656 lb(isam) = ub(isam - 1) + 1
657 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
658end do
659lb
660+1, +4
661ub
662+3, +6
663sample = getUnifRand(0., 1., ub(nsam))
664sample
665+0.756574214, +0.651462615, +0.457411945, +0.522556722, +0.835842490, +0.850333810
666rweight = getUnifRand(1., 2., size(sample, 1, IK))
667rweight
668+1.48484850, +1.54371405, +1.63704360, +1.49473596, +1.44965625, +1.20809340
669var(0) = getVar(sample, rweight)
670var(0) ! reference
671+0.223727692E-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.223727636E-1
679var(0) ! reference
680+0.223727692E-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, +7
690ub
691+6, +13
692sample = getUnifRand(0., 1., ub(nsam))
693sample
694+0.533710480, +0.379129648E-1, +0.377497971, +0.393967807, +0.649170280E-1, +0.236934423E-1, +0.382070601, +0.166612923, +0.263942838, +0.539084435, +0.758674443, +0.100698471E-1, +0.746632993
695rweight = getUnifRand(1., 2., size(sample, 1, IK))
696rweight
697+1.28215456, +1.69083428, +1.12115908, +1.76506662, +1.94708931, +1.82721555, +1.45491838, +1.09081769, +1.82040095, +1.48964703, +1.74974298, +1.27573442, +1.16934860
698var(0) = getVar(sample, rweight)
699var(0) ! reference
700+0.647288337E-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.647288263E-1
708var(0) ! reference
709+0.647288337E-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, +5
719ub
720+4, +11
721sample = getUnifRand(0., 1., ub(nsam))
722sample
723+0.899174333, +0.869121373, +0.288118899, +0.228682518, +0.643190801, +0.419505060, +0.917797685E-1, +0.155795097, +0.938460112, +0.969295204, +0.704379857
724rweight = getUnifRand(1., 2., size(sample, 1, IK))
725rweight
726+1.13296819, +1.59760189, +1.32898784, +1.78510380, +1.96092296, +1.40463126, +1.78327227, +1.60435784, +1.12021804, +1.60888720, +1.00969958
727var(0) = getVar(sample, rweight)
728var(0) ! reference
729+0.104945906
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.104945906
737var(0) ! reference
738+0.104945906
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, +8
748ub
749+7, +9
750sample = getUnifRand(0., 1., ub(nsam))
751sample
752+0.106950462, +0.762413621, +0.230133176, +0.243330598, +0.631156564E-1, +0.580528975, +0.280849993, +0.945764184E-1, +0.639413238
753rweight = getUnifRand(1., 2., size(sample, 1, IK))
754rweight
755+1.74599206, +1.79333878, +1.40395093, +1.14305711, +1.31284583, +1.14865160, +1.14433563, +1.67870092, +1.04902983
756var(0) = getVar(sample, rweight)
757var(0) ! reference
758+0.649335608E-1
759do isam = 1, nsam
760 var(isam) = getVar(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
761 mean(isam) = getMean(sample(lb(isam):ub(isam)), rweight(lb(isam):ub(isam)))
762end do
763varMerged = getVarMerged(var(2), var(1), mean(1) - mean(2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
764varMerged
765+0.649335533E-1
766var(0) ! reference
767+0.649335608E-1
768
769
770lb(1) = 1; ub(1) = getUnifRand(2, 7)
771do isam = 2, nsam
772 lb(isam) = ub(isam - 1) + 1
773 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
774end do
775lb
776+1, +8
777ub
778+7, +9
779sample = getUnifRand(0., 1., ub(nsam))
780sample
781+0.195795536, +0.113153994, +0.446503401, +0.348111033, +0.484188795E-1, +0.839976966, +0.396041870E-1, +0.713612437, +0.334916830
782rweight = getUnifRand(1., 2., size(sample, 1, IK))
783rweight
784+1.24312186, +1.73380291, +1.03255630, +1.79509151, +1.36219239, +1.39871526, +1.97807014, +1.26520848, +1.33232641
785var(0) = getVar(sample, rweight)
786var(0) ! reference
787+0.716665611E-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.716665536E-1
795var(0) ! reference
796+0.716665611E-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, +6
806ub
807+5, +8
808sample = getUnifRand(0., 1., ub(nsam))
809sample
810+0.852416635, +0.196719468, +0.960464537, +0.737778425, +0.721706808, +0.323797107, +0.166052580E-1, +0.925366163
811rweight = getUnifRand(1., 2., size(sample, 1, IK))
812rweight
813+1.00925803, +1.61511040, +1.95938897, +1.39958072, +1.57727003, +1.59608912, +1.57364964, +1.14815056
814var(0) = getVar(sample, rweight)
815var(0) ! reference
816+0.118136249
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.118136235
824var(0) ! reference
825+0.118136249
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, +9
837sample = getUnifRand(0., 1., ub(nsam))
838sample
839+0.209782124, +0.712045968, +0.782803535, +0.251813829, +0.330472410, +0.238080859, +0.685545087, +0.303183138, +0.498852432
840rweight = getUnifRand(1., 2., size(sample, 1, IK))
841rweight
842+1.50622416, +1.99256253, +1.21514440, +1.38746262, +1.64365280, +1.10160744, +1.34711730, +1.84184217, +1.87492967
843var(0) = getVar(sample, rweight)
844var(0) ! reference
845+0.434703678E-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.434703678E-1
853var(0) ! reference
854+0.434703678E-1
855
856
857!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
858!Compute the biased merged variance of a multivariate sample.
859!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
860
861
862dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
863do isam = 2, nsam
864 lb(isam) = ub(isam - 1) + 1
865 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
866end do
867lb
868+1, +7
869ub
870+6, +11
871ndim = getUnifRand(1, minval(ub - lb + 1, 1))
872call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
873call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
874call setResized(varMerged, ndim)
875sample = getUnifRand(-1., +1., ndim, ub(nsam))
876sample
877-0.749916792, +0.453539014, +0.615008116, -0.928921223, -0.219670534, +0.292535782, +0.323567629, +0.587503195, -0.780987501, -0.146038294, -0.144385219
878+0.697900414, -0.795978904, -0.107652307, +0.226983190, +0.503564835, -0.358899355, +0.338962197, +0.655435085, +0.203135014E-1, +0.620153785, -0.317101717
879-0.593229055, +0.103547335, -0.701852441, +0.117344379, +0.474931598, +0.973372102, -0.920551896, -0.489921570, +0.199093342, +0.830528617, +0.995258808
880+0.714928985, +0.329129219, -0.440688252, +0.438212156, -0.586013794E-1, -0.521080494, -0.691058755, -0.999635100, +0.792109728, -0.155686259, +0.778898954
881var(:,0) = getVar(sample, dim)
882var(:,0) ! reference
883+0.290976822, +0.217824772, +0.432780325, +0.364788532
884do isam = 1, nsam
885 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
886 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
887end do
888varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
889varMerged
890+0.290976822, +0.217824787, +0.432780266, +0.364788532
891var(:,0) ! reference
892+0.290976822, +0.217824772, +0.432780325, +0.364788532
893
894
895dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
896do isam = 2, nsam
897 lb(isam) = ub(isam - 1) + 1
898 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
899end do
900lb
901+1, +4
902ub
903+3, +7
904ndim = getUnifRand(1, minval(ub - lb + 1, 1))
905call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
906call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
907call setResized(varMerged, ndim)
908sample = getUnifRand(-1., +1., ndim, ub(nsam))
909sample
910-0.334140778, +0.137058496, +0.617300034, +0.853786230, +0.541783571, +0.554969907, -0.912194610
911var(:,0) = getVar(sample, dim)
912var(:,0) ! reference
913+0.338592917
914do isam = 1, nsam
915 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
916 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
917end do
918varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
919varMerged
920+0.338592887
921var(:,0) ! reference
922+0.338592917
923
924
925dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
926do isam = 2, nsam
927 lb(isam) = ub(isam - 1) + 1
928 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
929end do
930lb
931+1, +5
932ub
933+4, +6
934ndim = getUnifRand(1, minval(ub - lb + 1, 1))
935call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
936call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
937call setResized(varMerged, ndim)
938sample = getUnifRand(-1., +1., ndim, ub(nsam))
939sample
940-0.849942207, +0.280510187, +0.112172842, +0.248636842, -0.612146616, +0.977401495
941var(:,0) = getVar(sample, dim)
942var(:,0) ! reference
943+0.366906494
944do isam = 1, nsam
945 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
946 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
947end do
948varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
949varMerged
950+0.366906464
951var(:,0) ! reference
952+0.366906494
953
954
955dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
956do isam = 2, nsam
957 lb(isam) = ub(isam - 1) + 1
958 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
959end do
960lb
961+1, +7
962ub
963+6, +11
964ndim = getUnifRand(1, minval(ub - lb + 1, 1))
965call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
966call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
967call setResized(varMerged, ndim)
968sample = getUnifRand(-1., +1., ndim, ub(nsam))
969sample
970-0.367299318E-1, +0.910193920, -0.940887809, +0.607653856, +0.407092571E-1, +0.883340597, -0.368195891, -0.773453832, +0.413041472, +0.801011562, -0.817763686
971-0.778404474E-1, +0.395709395, -0.280297995, +0.353466749, -0.117959976E-1, +0.461422205E-1, +0.579531431, -0.582221746, +0.111515522, +0.707805634, +0.655520678
972-0.472600222, +0.936433554, +0.270764351, -0.260689378, -0.530220509, -0.688758850, -0.552282572, -0.804906607, -0.553962708, -0.895261168, +0.828867793
973var(:,0) = getVar(sample, dim)
974var(:,0) ! reference
975+0.457639694, +0.150823519, +0.370132446
976do isam = 1, nsam
977 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
978 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
979end do
980varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
981varMerged
982+0.457639664, +0.150823534, +0.370132446
983var(:,0) ! reference
984+0.457639694, +0.150823519, +0.370132446
985
986
987dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
988do isam = 2, nsam
989 lb(isam) = ub(isam - 1) + 1
990 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
991end do
992lb
993+1, +4
994ub
995+3, +7
996ndim = getUnifRand(1, minval(ub - lb + 1, 1))
997call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
998call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
999call setResized(varMerged, ndim)
1000sample = getUnifRand(-1., +1., ndim, ub(nsam))
1001sample
1002+0.211210370, -0.947193980, +0.111217260, -0.223239183, -0.731491446, -0.495772958, -0.167142749
1003+0.366180539, +0.579234004, -0.925782323, -0.284307837, +0.566305757, +0.721643209, +0.760748148
1004+0.614027977, +0.453370810, +0.526137352E-1, +0.221462250E-1, -0.857443810, -0.704608202, +0.647227287
1005var(:,0) = getVar(sample, dim)
1006var(:,0) ! reference
1007+0.156350523, +0.339005321, +0.318433851
1008do isam = 1, nsam
1009 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1010 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1011end do
1012varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1013varMerged
1014+0.156350508, +0.339005262, +0.318433821
1015var(:,0) ! reference
1016+0.156350523, +0.339005321, +0.318433851
1017
1018
1019dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1020do isam = 2, nsam
1021 lb(isam) = ub(isam - 1) + 1
1022 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1023end do
1024lb
1025+1, +5
1026ub
1027+4, +10
1028ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1029call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1030call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1031call setResized(varMerged, ndim)
1032sample = getUnifRand(-1., +1., ndim, ub(nsam))
1033sample
1034+0.729136467E-1, +0.919345975, -0.584258318, +0.513003826, -0.797199249, +0.189422250, +0.547718048, +0.335495591, +0.825600624, -0.318479180
1035+0.822069526, -0.297078967, +0.482046008, +0.950898290, +0.719182491E-1, -0.510404825, +0.426832318, -0.929520726, +0.421145916, +0.148303032
1036-0.209717035, +0.747431159, +0.605551600, -0.908388972, -0.989658117, +0.982118011, -0.848757386, +0.763515592, -0.456957817E-1, +0.277994871
1037-0.821491957, -0.354919553, +0.564793706, +0.280522823, +0.545062900, -0.563867688, -0.618705869, -0.794882417, +0.327454448, -0.897135377
1038var(:,0) = getVar(sample, dim)
1039var(:,0) ! reference
1040+0.303183675, +0.316026211, +0.510717392, +0.319588780
1041do isam = 1, nsam
1042 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1043 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1044end do
1045varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1046varMerged
1047+0.303183645, +0.316026211, +0.510717452, +0.319588780
1048var(:,0) ! reference
1049+0.303183675, +0.316026211, +0.510717392, +0.319588780
1050
1051
1052dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1053do isam = 2, nsam
1054 lb(isam) = ub(isam - 1) + 1
1055 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1056end do
1057lb
1058+1, +6
1059ub
1060+5, +10
1061ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1062call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1063call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1064call setResized(varMerged, ndim)
1065sample = getUnifRand(-1., +1., ndim, ub(nsam))
1066sample
1067+0.345724344, +0.712543964, +0.428986669, +0.102499723E-1, +0.942600250, +0.331936598, +0.617372990E-1, +0.659617305, -0.443056226, -0.660589814
1068+0.875529170, +0.952810526, +0.537762403, -0.305003524, -0.143729329, +0.423889279, +0.635076642, -0.405161619, +0.802453756E-1, +0.430371761
1069-0.789544344, -0.154722571, +0.772343755, +0.280399919, +0.250911474, -0.470714808, +0.513374686, -0.162416816, +0.485970020, -0.589061022
1070var(:,0) = getVar(sample, dim)
1071var(:,0) ! reference
1072+0.231054947, +0.206634909, +0.247821555
1073do isam = 1, nsam
1074 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1075 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1076end do
1077varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1078varMerged
1079+0.231054962, +0.206634924, +0.247821540
1080var(:,0) ! reference
1081+0.231054947, +0.206634909, +0.247821555
1082
1083
1084dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1085do isam = 2, nsam
1086 lb(isam) = ub(isam - 1) + 1
1087 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1088end do
1089lb
1090+1, +5
1091ub
1092+4, +7
1093ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1094call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1095call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1096call setResized(varMerged, ndim)
1097sample = getUnifRand(-1., +1., ndim, ub(nsam))
1098sample
1099-0.745620131, +0.443072200, +0.483624816, +0.693880081, -0.113230348, -0.536841512, -0.611517191
1100-0.926283598, -0.354040146, -0.353227496, -0.558184743, -0.985724330, +0.544318318, -0.530130148
1101+0.154554605, -0.973571301, -0.316626310, +0.326328516, +0.103562593, -0.341183066, +0.717426300
1102var(:,0) = getVar(sample, dim)
1103var(:,0) ! reference
1104+0.303034753, +0.219884068, +0.257827371
1105do isam = 1, nsam
1106 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1107 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1108end do
1109varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1110varMerged
1111+0.303034753, +0.219884053, +0.257827371
1112var(:,0) ! reference
1113+0.303034753, +0.219884068, +0.257827371
1114
1115
1116dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1117do isam = 2, nsam
1118 lb(isam) = ub(isam - 1) + 1
1119 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1120end do
1121lb
1122+1, +8
1123ub
1124+7, +12
1125ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1126call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1127call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1128call setResized(varMerged, ndim)
1129sample = getUnifRand(-1., +1., ndim, ub(nsam))
1130sample
1131+0.528558731, +0.166404963, +0.146934748, +0.474631786, -0.596880913, -0.804815531, +0.821363926E-2, -0.525782704, -0.561072707, -0.250146389, +0.487488151, +0.761578321
1132+0.544338822, +0.248280048, -0.803667188, -0.468506336, -0.131528735, +0.264473796, +0.310732722, +0.863679767, -0.561181068, +0.121952653, +0.580270529, -0.823903799
1133var(:,0) = getVar(sample, dim)
1134var(:,0) ! reference
1135+0.252266377, +0.291387320
1136do isam = 1, nsam
1137 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1138 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1139end do
1140varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1141varMerged
1142+0.252266377, +0.291387349
1143var(:,0) ! reference
1144+0.252266377, +0.291387320
1145
1146
1147dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1148do isam = 2, nsam
1149 lb(isam) = ub(isam - 1) + 1
1150 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1151end do
1152lb
1153+1, +8
1154ub
1155+7, +12
1156ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1157call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1158call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1159call setResized(varMerged, ndim)
1160sample = getUnifRand(-1., +1., ndim, ub(nsam))
1161sample
1162-0.898758650, -0.547863126, -0.197484970, +0.761881709, +0.191407800, -0.574218512, -0.277059078E-1, +0.521361113, -0.490401626, +0.813009858, +0.997668028, -0.738099813
1163-0.375911236, -0.603721261, -0.489737988E-1, -0.399604797, -0.350819588, +0.645075798, +0.825294733, +0.748874426, +0.276730180, +0.312628269, +0.280309558, +0.420260191
1164-0.348385930, +0.183301568, -0.214887738, +0.304707289, -0.498770237, +0.641340494, +0.532469869, +0.888386965, +0.490027070, +0.348145485, -0.407190323, +0.501203299
1165+0.633232713, -0.593353271, -0.327264547, -0.165911317, -0.680372596, +0.946252465, +0.642266870, -0.367314935, +0.296236396, +0.580231309, +0.829143047, +0.386150002
1166var(:,0) = getVar(sample, dim)
1167var(:,0) ! reference
1168+0.400413573, +0.219087601, +0.193083942, +0.304887116
1169do isam = 1, nsam
1170 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), dim)
1171 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), dim)
1172end do
1173varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(ub(1), TKG) / real(ub(2), TKG))
1174varMerged
1175+0.400413573, +0.219087601, +0.193083957, +0.304887086
1176var(:,0) ! reference
1177+0.400413573, +0.219087601, +0.193083942, +0.304887116
1178
1179
1180!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1181!Compute the biased merged variance of a frequency weighted multivariate sample.
1182!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1183
1184
1185dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1186do isam = 2, nsam
1187 lb(isam) = ub(isam - 1) + 1
1188 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1189end do
1190lb
1191+1, +7
1192ub
1193+6, +10
1194ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1195call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1196call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1197call setResized(varMerged, ndim)
1198sample = getUnifRand(-1., +1., ndim, ub(nsam))
1199sample
1200+0.352119207E-1, -0.138987422, +0.152720571, -0.173815727, -0.507582903, +0.340385675, +0.863062739, +0.452156901, +0.926291466, +0.760297656
1201-0.786398768, -0.485031605, +0.622089505, -0.488249063, +0.796400309E-1, +0.158301115, -0.765911341E-1, +0.398253322, -0.424673796, +0.989440084
1202-0.457106352, -0.399992108, +0.215908289, +0.432372093E-1, +0.987445116, +0.301909566, +0.498178244, +0.959921598, -0.466799021, -0.562366128
1203iweight = getUnifRand(1, 10, size(sample, dim, IK))
1204iweight
1205+3, +7, +6, +1, +7, +7, +9, +3, +4, +8
1206var(:,0) = getVar(sample, 2_IK, iweight)
1207var(:,0) ! reference
1208+0.230087429, +0.267927825, +0.308207422
1209do isam = 1, nsam
1210 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1211 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1212end do
1213varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1214varMerged
1215+0.230087459, +0.267927796, +0.308207422
1216var(:,0) ! reference
1217+0.230087429, +0.267927825, +0.308207422
1218
1219
1220dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1221do isam = 2, nsam
1222 lb(isam) = ub(isam - 1) + 1
1223 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1224end do
1225lb
1226+1, +6
1227ub
1228+5, +9
1229ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1230call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1231call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1232call setResized(varMerged, ndim)
1233sample = getUnifRand(-1., +1., ndim, ub(nsam))
1234sample
1235-0.364988446, -0.695202947, -0.571645856, +0.316403866, +0.837548256, +0.992599964, +0.859503269, -0.722584367, -0.967232704
1236+0.982866287E-1, +0.546662807E-1, -0.425197959, -0.230354786, +0.822355866, -0.206112385, +0.741434336, +0.470315456, +0.338667989
1237+0.499692798, -0.415104985, +0.867888212, -0.120125413, +0.691876888, -0.898971677, -0.173735499, +0.317501664, -0.335092545
1238-0.564300776, -0.911728859, +0.945667863, +0.306703329, -0.615019441, +0.860059619, -0.890277743, +0.620156407, +0.948145866
1239iweight = getUnifRand(1, 10, size(sample, dim, IK))
1240iweight
1241+6, +3, +2, +1, +9, +10, +8, +5, +3
1242var(:,0) = getVar(sample, 2_IK, iweight)
1243var(:,0) ! reference
1244+0.575573444, +0.180478156, +0.361855954, +0.594911993
1245do isam = 1, nsam
1246 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1247 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1248end do
1249varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1250varMerged
1251+0.575573385, +0.180478185, +0.361855924, +0.594912052
1252var(:,0) ! reference
1253+0.575573444, +0.180478156, +0.361855954, +0.594911993
1254
1255
1256dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1257do isam = 2, nsam
1258 lb(isam) = ub(isam - 1) + 1
1259 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1260end do
1261lb
1262+1, +4
1263ub
1264+3, +10
1265ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1266call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1267call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1268call setResized(varMerged, ndim)
1269sample = getUnifRand(-1., +1., ndim, ub(nsam))
1270sample
1271-0.834553480, -0.112825394, +0.312838554, -0.444030285, -0.221915126, +0.203998089, -0.675656676, +0.891355395, -0.653972030, +0.994844794
1272iweight = getUnifRand(1, 10, size(sample, dim, IK))
1273iweight
1274+8, +4, +7, +2, +4, +4, +10, +1, +3, +5
1275var(:,0) = getVar(sample, 2_IK, iweight)
1276var(:,0) ! reference
1277+0.355450481
1278do isam = 1, nsam
1279 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1280 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1281end do
1282varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1283varMerged
1284+0.355450481
1285var(:,0) ! reference
1286+0.355450481
1287
1288
1289dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1290do isam = 2, nsam
1291 lb(isam) = ub(isam - 1) + 1
1292 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1293end do
1294lb
1295+1, +8
1296ub
1297+7, +11
1298ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1299call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1300call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1301call setResized(varMerged, ndim)
1302sample = getUnifRand(-1., +1., ndim, ub(nsam))
1303sample
1304+0.599640965, +0.914766788, +0.553340673, -0.407084346, +0.382392287, -0.240664363, +0.835379362, +0.691901684, -0.490499258, +0.229575992, +0.282954097
1305-0.730383754, +0.761649966, -0.897007227, -0.584507227, +0.985212445, -0.366370082, -0.473970532, -0.701237798, +0.197130084, +0.151191950E-1, -0.742160916
1306iweight = getUnifRand(1, 10, size(sample, dim, IK))
1307iweight
1308+5, +4, +7, +10, +9, +8, +7, +5, +4, +7, +2
1309var(:,0) = getVar(sample, 2_IK, iweight)
1310var(:,0) ! reference
1311+0.220504418, +0.384818345
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.220504403, +0.384818345
1319var(:,0) ! reference
1320+0.220504418, +0.384818345
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, +8
1330ub
1331+7, +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.593076110, -0.224693775, -0.752820730, +0.406044602, -0.478237748, +0.389571428, +0.429470539, -0.838398933, +0.555443406
1339+0.752788782E-1, +0.540673018, -0.902753472, -0.569481015, +0.483242273, +0.699916840, -0.899466991, +0.652142644, +0.440341115
1340iweight = getUnifRand(1, 10, size(sample, dim, IK))
1341iweight
1342+6, +8, +9, +3, +8, +3, +7, +1, +2
1343var(:,0) = getVar(sample, 2_IK, iweight)
1344var(:,0) ! reference
1345+0.228767425, +0.429328024
1346do isam = 1, nsam
1347 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1348 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1349end do
1350varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1351varMerged
1352+0.228767455, +0.429327995
1353var(:,0) ! reference
1354+0.228767425, +0.429328024
1355
1356
1357dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1358do isam = 2, nsam
1359 lb(isam) = ub(isam - 1) + 1
1360 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1361end do
1362lb
1363+1, +7
1364ub
1365+6, +13
1366ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1367call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1368call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1369call setResized(varMerged, ndim)
1370sample = getUnifRand(-1., +1., ndim, ub(nsam))
1371sample
1372-0.300537109, -0.915670276, +0.433374166, -0.645064950, -0.329493046, -0.383832216, +0.317302942, +0.683754563, -0.249289155, -0.275474906, +0.662525296, +0.689314604E-1, -0.695547223
1373+0.756975412, -0.315649390, +0.219997048, -0.488423824, +0.728310943, +0.436139464, -0.194307208, +0.844591141, +0.953723550, +0.715446115, +0.369025111, +0.775544405, +0.337637067
1374iweight = getUnifRand(1, 10, size(sample, dim, IK))
1375iweight
1376+9, +6, +3, +5, +8, +4, +9, +4, +7, +2, +5, +1, +8
1377var(:,0) = getVar(sample, 2_IK, iweight)
1378var(:,0) ! reference
1379+0.238454387, +0.218661875
1380do isam = 1, nsam
1381 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1382 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1383end do
1384varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1385varMerged
1386+0.238454401, +0.218661919
1387var(:,0) ! reference
1388+0.238454387, +0.218661875
1389
1390
1391dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1392do isam = 2, nsam
1393 lb(isam) = ub(isam - 1) + 1
1394 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1395end do
1396lb
1397+1, +4
1398ub
1399+3, +9
1400ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1401call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1402call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1403call setResized(varMerged, ndim)
1404sample = getUnifRand(-1., +1., ndim, ub(nsam))
1405sample
1406-0.126947641, +0.327284575, +0.940511703, -0.457067013, +0.445704699, -0.581622720, -0.629649401, +0.321346045, +0.249206424
1407-0.872612953, -0.181372762, -0.407406449, -0.441894531, -0.414707661, +0.157415867E-1, -0.902213812, -0.207803607, +0.482803822
1408-0.339929581, -0.505793095, -0.473564029, -0.337715268, -0.118489385, -0.358592868, +0.183469772, +0.552163482, +0.173247218
1409iweight = getUnifRand(1, 10, size(sample, dim, IK))
1410iweight
1411+8, +8, +7, +5, +8, +7, +4, +2, +7
1412var(:,0) = getVar(sample, 2_IK, iweight)
1413var(:,0) ! reference
1414+0.248426214, +0.169142932, +0.791158006E-1
1415do isam = 1, nsam
1416 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1417 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1418end do
1419varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1420varMerged
1421+0.248426184, +0.169142962, +0.791158006E-1
1422var(:,0) ! reference
1423+0.248426214, +0.169142932, +0.791158006E-1
1424
1425
1426dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1427do isam = 2, nsam
1428 lb(isam) = ub(isam - 1) + 1
1429 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1430end do
1431lb
1432+1, +4
1433ub
1434+3, +6
1435ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1436call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1437call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1438call setResized(varMerged, ndim)
1439sample = getUnifRand(-1., +1., ndim, ub(nsam))
1440sample
1441-0.727156997, +0.806167483, -0.911975384, -0.981216073, -0.797147632, +0.644112945
1442iweight = getUnifRand(1, 10, size(sample, dim, IK))
1443iweight
1444+3, +7, +10, +3, +6, +1
1445var(:,0) = getVar(sample, 2_IK, iweight)
1446var(:,0) ! reference
1447+0.538595080
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.538595140
1455var(:,0) ! reference
1456+0.538595080
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, +8
1466ub
1467+7, +9
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.840939999, -0.697881937, -0.572943211, -0.411066890, +0.607863069, -0.319620252, -0.233905554, -0.460294843, +0.637327194
1475+0.718485475, +0.567568064, +0.552161217, -0.870687604, +0.862360001E-1, +0.706187725, +0.417284131, -0.536578059, +0.197861195
1476iweight = getUnifRand(1, 10, size(sample, dim, IK))
1477iweight
1478+5, +2, +2, +3, +7, +9, +10, +1, +5
1479var(:,0) = getVar(sample, 2_IK, iweight)
1480var(:,0) ! reference
1481+0.252084523, +0.179394305
1482do isam = 1, nsam
1483 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1484 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1485end do
1486varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1487varMerged
1488+0.252084523, +0.179394305
1489var(:,0) ! reference
1490+0.252084523, +0.179394305
1491
1492
1493dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1494do isam = 2, nsam
1495 lb(isam) = ub(isam - 1) + 1
1496 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1497end do
1498lb
1499+1, +3
1500ub
1501+2, +9
1502ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1503call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1504call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1505call setResized(varMerged, ndim)
1506sample = getUnifRand(-1., +1., ndim, ub(nsam))
1507sample
1508+0.923921466, -0.557095408, +0.791247368, +0.520151734, -0.917649984, -0.367976785, +0.628040910, +0.643777370, +0.214007258
1509iweight = getUnifRand(1, 10, size(sample, dim, IK))
1510iweight
1511+2, +7, +3, +8, +10, +1, +8, +6, +5
1512var(:,0) = getVar(sample, 2_IK, iweight)
1513var(:,0) ! reference
1514+0.437409401
1515do isam = 1, nsam
1516 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1517 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, iweight(lb(isam):ub(isam)))
1518end do
1519varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(iweight(:ub(1))), TKG) / real(sum(iweight), TKG))
1520varMerged
1521+0.437409371
1522var(:,0) ! reference
1523+0.437409401
1524
1525
1526!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1527!Compute the biased merged variance of a reliability weighted multivariate sample.
1528!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1529
1530
1531dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1532do isam = 2, nsam
1533 lb(isam) = ub(isam - 1) + 1
1534 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1535end do
1536lb
1537+1, +3
1538ub
1539+2, +6
1540ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1541call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1542call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1543call setResized(varMerged, ndim)
1544sample = getUnifRand(-1., +1., ndim, ub(nsam))
1545sample
1546+0.108418465, +0.557432055, -0.341427088, -0.156926632, +0.703215599E-2, -0.641479850
1547-0.227712274, +0.132582307, -0.651784062, -0.678043365E-1, +0.791256189, +0.114814043E-1
1548rweight = getUnifRand(1., 2., size(sample, dim, IK))
1549rweight
1550+1.20050931, +1.15229368, +1.03104258, +1.37830389, +1.03597510, +1.16690803
1551var(:,0) = getVar(sample, 2_IK, rweight)
1552var(:,0) ! reference
1553+0.138564974, +0.168730438
1554do isam = 1, nsam
1555 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1556 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1557end do
1558varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1559varMerged
1560+0.138564974, +0.168730408
1561var(:,0) ! reference
1562+0.138564974, +0.168730438
1563
1564
1565dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1566do isam = 2, nsam
1567 lb(isam) = ub(isam - 1) + 1
1568 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1569end do
1570lb
1571+1, +7
1572ub
1573+6, +10
1574ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1575call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1576call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1577call setResized(varMerged, ndim)
1578sample = getUnifRand(-1., +1., ndim, ub(nsam))
1579sample
1580-0.831903458, -0.408597469, +0.807691097, -0.111122966, -0.981210709, -0.265749574, +0.917384386, -0.813920379, -0.295091152, +0.679105520
1581-0.727265120, +0.607688069, +0.997622848, -0.417827725, +0.198194742, +0.347738743, +0.375608921, +0.709079504, -0.587905169, -0.173005462
1582rweight = getUnifRand(1., 2., size(sample, dim, IK))
1583rweight
1584+1.36689425, +1.76444876, +1.62718856, +1.23154950, +1.66899157, +1.81451440, +1.29845774, +1.43807197, +1.21557570, +1.05012870
1585var(:,0) = getVar(sample, 2_IK, rweight)
1586var(:,0) ! reference
1587+0.433933228, +0.298820943
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.433933258, +0.298820972
1595var(:,0) ! reference
1596+0.433933228, +0.298820943
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, +6
1606ub
1607+5, +9
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.230902314, -0.586290598, -0.950057030, +0.671836853, +0.258047223, +0.656273961, -0.152616262, -0.978499293, -0.724219084
1615rweight = getUnifRand(1., 2., size(sample, dim, IK))
1616rweight
1617+1.12620211, +1.72288322, +1.01386023, +1.45159888, +1.09577131, +1.43417037, +1.31755626, +1.96311498, +1.36664391
1618var(:,0) = getVar(sample, 2_IK, rweight)
1619var(:,0) ! reference
1620+0.399331570
1621do isam = 1, nsam
1622 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1623 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1624end do
1625varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1626varMerged
1627+0.399331540
1628var(:,0) ! reference
1629+0.399331570
1630
1631
1632dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1633do isam = 2, nsam
1634 lb(isam) = ub(isam - 1) + 1
1635 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1636end do
1637lb
1638+1, +7
1639ub
1640+6, +13
1641ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1642call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1643call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1644call setResized(varMerged, ndim)
1645sample = getUnifRand(-1., +1., ndim, ub(nsam))
1646sample
1647+0.305202484, +0.221270800, +0.441861272, +0.791151643, +0.368236661, +0.126445293E-2, -0.260604739, -0.540953279, -0.654340982E-1, -0.604499459, +0.435373902, +0.262983918, -0.919871807
1648-0.422076941, +0.508449316, +0.680533767, +0.632709742, +0.494766951, -0.325023770, -0.927593589, -0.254701495, +0.583116889, -0.381958961, -0.134697318, -0.431962371, -0.611769319
1649-0.211918354E-1, +0.806247950, -0.577645302, -0.960505009E-1, +0.178529739, +0.648702502, +0.305981517, -0.106323481, -0.333750248, -0.458820462, -0.811444640, +0.788638353, +0.688429475
1650+0.523206472, +0.447744489, -0.807787180, -0.215451956, -0.964011431, +0.161890030, -0.820845723, +0.548269272, +0.172195435, -0.310192108E-1, +0.246601820, -0.849164009, +0.978685141
1651-0.130366206, -0.446164727, +0.732116222, -0.311047792, +0.792078137, +0.430537939, -0.572217345, -0.912149668, +0.786180377, +0.831089139, -0.723126769, +0.399649143E-1, +0.452742457
1652+0.955878615, +0.752452135, -0.192199945, -0.128252864, +0.117296934, +0.726583004, +0.289023399, +0.659664869, +0.681568384, -0.311053276, -0.636535645, +0.733543873, +0.453280687
1653rweight = getUnifRand(1., 2., size(sample, dim, IK))
1654rweight
1655+1.66249919, +1.44177449, +1.95732808, +1.99458766, +1.21362066, +1.13846445, +1.53054166, +1.90435398, +1.98907340, +1.65349710, +1.47442412, +1.10379791, +1.48680925
1656var(:,0) = getVar(sample, 2_IK, rweight)
1657var(:,0) ! reference
1658+0.237607181, +0.288937032, +0.253969580, +0.351927221, +0.387903333, +0.232930467
1659do isam = 1, nsam
1660 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1661 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1662end do
1663varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1664varMerged
1665+0.237607166, +0.288937032, +0.253969580, +0.351927221, +0.387903303, +0.232930526
1666var(:,0) ! reference
1667+0.237607181, +0.288937032, +0.253969580, +0.351927221, +0.387903333, +0.232930467
1668
1669
1670dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1671do isam = 2, nsam
1672 lb(isam) = ub(isam - 1) + 1
1673 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1674end do
1675lb
1676+1, +8
1677ub
1678+7, +14
1679ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1680call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1681call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1682call setResized(varMerged, ndim)
1683sample = getUnifRand(-1., +1., ndim, ub(nsam))
1684sample
1685-0.604978204, +0.829981208, +0.604548454, -0.189864874, +0.826513410, -0.422761202, -0.845444441, +0.624823570E-2, +0.660953045, +0.642962456E-1, +0.588692665, +0.532411695, -0.731010199, +0.182853341
1686-0.576755881, -0.977202773, +0.306051373, +0.442964077, -0.725817680E-2, -0.469801545, -0.530154586, -0.661346674, -0.274902582, -0.353498697, -0.887763619, +0.999828696, -0.401625633, -0.347845316
1687+0.700215101, +0.878605723, -0.916869760, +0.690203071, +0.851308107, +0.311012268, +0.585712671, -0.617403984, +0.652478218, -0.716643214, -0.967325091, -0.416823387, +0.479739189, -0.496324778
1688-0.892720342, -0.116622567, +0.225742579, -0.279406905, +0.324344397, +0.892170310, +0.773890734, +0.822920084, +0.118595362E-1, +0.778440952, +0.777423978, -0.678605318, +0.909200549, +0.542327523
1689rweight = getUnifRand(1., 2., size(sample, dim, IK))
1690rweight
1691+1.92393351, +1.78573275, +1.40165651, +1.98616219, +1.12638950, +1.65035534, +1.93980813, +1.85130453, +1.32789898, +1.45584297, +1.46635342, +1.46058857, +1.38262308, +1.80618143
1692var(:,0) = getVar(sample, 2_IK, rweight)
1693var(:,0) ! reference
1694+0.319033861, +0.268571675, +0.457029790, +0.355667263
1695do isam = 1, nsam
1696 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1697 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1698end do
1699varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1700varMerged
1701+0.319033891, +0.268571734, +0.457029760, +0.355667353
1702var(:,0) ! reference
1703+0.319033861, +0.268571675, +0.457029790, +0.355667263
1704
1705
1706dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1707do isam = 2, nsam
1708 lb(isam) = ub(isam - 1) + 1
1709 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1710end do
1711lb
1712+1, +6
1713ub
1714+5, +10
1715ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1716call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1717call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1718call setResized(varMerged, ndim)
1719sample = getUnifRand(-1., +1., ndim, ub(nsam))
1720sample
1721+0.447585344, +0.542187214, -0.265754461E-1, +0.631773353, +0.120387912, +0.289741755, -0.638183475, +0.940888047, -0.659635425, -0.613753200
1722-0.680372238, +0.373692632, +0.919190288, +0.562561274, +0.423740506, -0.353000760, -0.504692674, +0.287579060, -0.287696123, -0.806661248
1723-0.980811715, -0.678256154, +0.975248814E-1, -0.508245587, +0.246967316, -0.150053024, -0.924747348, +0.937178493, -0.793041348, +0.513612628
1724+0.539119244E-1, -0.289262533, +0.560281396, -0.164695501, -0.915645838, -0.689194679, -0.970067024, -0.988279462, -0.485206842, -0.829582453
1725rweight = getUnifRand(1., 2., size(sample, dim, IK))
1726rweight
1727+1.58361697, +1.02271938, +1.96927762, +1.13326859, +1.76910329, +1.25541592, +1.47339439, +1.74129701, +1.85051155, +1.55939686
1728var(:,0) = getVar(sample, 2_IK, rweight)
1729var(:,0) ! reference
1730+0.303983688, +0.329445124, +0.410408944, +0.267830968
1731do isam = 1, nsam
1732 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1733 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1734end do
1735varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1736varMerged
1737+0.303983659, +0.329445153, +0.410408884, +0.267830938
1738var(:,0) ! reference
1739+0.303983688, +0.329445124, +0.410408944, +0.267830968
1740
1741
1742dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1743do isam = 2, nsam
1744 lb(isam) = ub(isam - 1) + 1
1745 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1746end do
1747lb
1748+1, +4
1749ub
1750+3, +10
1751ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1752call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1753call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1754call setResized(varMerged, ndim)
1755sample = getUnifRand(-1., +1., ndim, ub(nsam))
1756sample
1757+0.844898820, -0.882154703, -0.450753808, -0.987123013, +0.630481005, +0.109736323, -0.312234759, -0.345012546, -0.501729488, -0.422157168
1758-0.204635859, +0.314243078, +0.801234603, -0.285274506, -0.546265721, -0.881843567, -0.733032346, -0.196581006, +0.369398117, +0.478545666
1759-0.501222372, +0.459436417, +0.860345125, +0.800992608, -0.761404037E-1, +0.100179315, +0.633508801, -0.897867680, -0.432014704, -0.755670667
1760rweight = getUnifRand(1., 2., size(sample, dim, IK))
1761rweight
1762+1.95697498, +1.06754279, +1.04023850, +1.28969204, +1.26436388, +1.78190327, +1.73568726, +1.92578578, +1.10389078, +1.31019592
1763var(:,0) = getVar(sample, 2_IK, rweight)
1764var(:,0) ! reference
1765+0.327978164, +0.259516001, +0.381309479
1766do isam = 1, nsam
1767 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1768 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1769end do
1770varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1771varMerged
1772+0.327978134, +0.259515971, +0.381309420
1773var(:,0) ! reference
1774+0.327978164, +0.259516001, +0.381309479
1775
1776
1777dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1778do isam = 2, nsam
1779 lb(isam) = ub(isam - 1) + 1
1780 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1781end do
1782lb
1783+1, +6
1784ub
1785+5, +12
1786ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1787call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1788call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1789call setResized(varMerged, ndim)
1790sample = getUnifRand(-1., +1., ndim, ub(nsam))
1791sample
1792+0.547124624, -0.661491394, +0.198820710, +0.108356714, +0.159952998, -0.527102351, +0.235408306, -0.676220059, +0.953540802, +0.482830524, -0.161389589, -0.975759625
1793-0.822450399, -0.386915684, -0.669561267, +0.794861078, +0.193977952, -0.873519063, +0.490686536, +0.677172184, +0.890610218E-1, +0.202978730, +0.805750489, -0.181002855
1794-0.416460395, -0.427120566, -0.810765147, +0.751908302, +0.988397241, +0.532778144, +0.760418773, +0.337809324, +0.611689448, -0.533927679, +0.250633717, -0.106473207
1795rweight = getUnifRand(1., 2., size(sample, dim, IK))
1796rweight
1797+1.50964487, +1.42495382, +1.37579465, +1.21515846, +1.91255164, +1.58006275, +1.86334443, +1.50628161, +1.98477948, +1.49301589, +1.11538315, +1.94485760
1798var(:,0) = getVar(sample, 2_IK, rweight)
1799var(:,0) ! reference
1800+0.340978324, +0.311686039, +0.328294188
1801do isam = 1, nsam
1802 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1803 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1804end do
1805varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1806varMerged
1807+0.340978265, +0.311686099, +0.328294158
1808var(:,0) ! reference
1809+0.340978324, +0.311686039, +0.328294188
1810
1811
1812dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1813do isam = 2, nsam
1814 lb(isam) = ub(isam - 1) + 1
1815 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1816end do
1817lb
1818+1, +7
1819ub
1820+6, +10
1821ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1822call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1823call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1824call setResized(varMerged, ndim)
1825sample = getUnifRand(-1., +1., ndim, ub(nsam))
1826sample
1827+0.137107968, -0.110239744, -0.677486181, -0.791233778, +0.498516083, +0.329489350, +0.777540922, -0.195709944, -0.438021183, +0.102730989E-1
1828+0.138830900, -0.283355713E-1, +0.818534851, +0.935712934, +0.218527436, +0.675492525, -0.451065421, -0.861213803, +0.555681229, +0.789325476
1829+0.301957965, -0.385333419, +0.426511288, -0.642350793, -0.525622010, +0.707622766E-1, +0.449155569, -0.357685685, -0.238656759, +0.731737852
1830rweight = getUnifRand(1., 2., size(sample, dim, IK))
1831rweight
1832+1.75112891, +1.97851634, +1.87098145, +1.02326298, +1.61264396, +1.69801664, +1.84469962, +1.19335580, +1.92873931, +1.31500995
1833var(:,0) = getVar(sample, 2_IK, rweight)
1834var(:,0) ! reference
1835+0.226079807, +0.277760595, +0.185517177
1836do isam = 1, nsam
1837 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1838 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1839end do
1840varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1841varMerged
1842+0.226079822, +0.277760595, +0.185517192
1843var(:,0) ! reference
1844+0.226079807, +0.277760595, +0.185517177
1845
1846
1847dim = 2; lb(1) = 1; ub(1) = getUnifRand(2, 7)
1848do isam = 2, nsam
1849 lb(isam) = ub(isam - 1) + 1
1850 ub(isam) = ub(isam - 1) + getUnifRand(2, 7)
1851end do
1852lb
1853+1, +5
1854ub
1855+4, +8
1856ndim = getUnifRand(1, minval(ub - lb + 1, 1))
1857call setRebound(var, [1_IK, 0_IK], [ndim, nsam])
1858call setRebound(mean, [1_IK, 1_IK], [ndim, nsam])
1859call setResized(varMerged, ndim)
1860sample = getUnifRand(-1., +1., ndim, ub(nsam))
1861sample
1862+0.542527795, +0.822124839, +0.603487492E-1, -0.866395831, +0.156890392, -0.703260541, -0.871532083, +0.908595324E-1
1863rweight = getUnifRand(1., 2., size(sample, dim, IK))
1864rweight
1865+1.28777575, +1.54730058, +1.18472433, +1.43090558, +1.59356046, +1.50136828, +1.73173809, +1.00481391
1866var(:,0) = getVar(sample, 2_IK, rweight)
1867var(:,0) ! reference
1868+0.392621845
1869do isam = 1, nsam
1870 var(:,isam) = getVar(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1871 mean(:,isam) = getMean(sample(:,lb(isam):ub(isam)), 2_IK, rweight(lb(isam):ub(isam)))
1872end do
1873varMerged = getVarMerged(var(:,2), var(:,1), mean(:,1) - mean(:,2), real(sum(rweight(:ub(1))), TKG) / real(sum(rweight), TKG))
1874varMerged
1875+0.392621875
1876var(:,0) ! reference
1877+0.392621845
1878
1879
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: