Return the covAariance resulting from the merger of two separate (potentially weighted) non-singular and singular samples \(A\) and \(B\).
More...
Return the covAariance resulting from the merger of two separate (potentially weighted) non-singular and singular samples \(A\) and \(B\).
See the documentation of pm_sampleCov for more information and definition online updating of sample covAariance.
- Note
- The input and output variances of this generic interface are all biased variances.
A biased covAariance can be readily unbiased by multiplying it with the appropriate bias-correction factors detailed in the documentation of pm_sampleCov.
- Parameters
-
[in] | covA | : The input/output contiguous matrix of shape (1 : ndim, 1 : ndim) of,
-
type
complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128),
-
type
real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
|
On input, it must contain the biased covAariance of the initial non-singular sample \(A\) that must be merged with the second singular sample \(B\).
- Parameters
-
[in] | meanDiff | : The input object of the same type and kind as the input argument covA of size size(covA, 1) , containing the difference of mean of the two non-singular and singular samples meanDiff = meanA - meanB .
The subtraction order is immaterial.
|
[in] | fracA | : The input scalar of type real of the same kind as covA , containing the ratio of the sum of the weights of all points in sample \(A\) to sum of weights of all points in the merged sample.
If the sample is unweighted, then fracA is simply size(sampleA) / (size(sampleA) + size(sampleB)) .
|
[in] | subset | : The input scalar constant that can be:
-
The constant lowDia, implying that only the lower-diagonal subset of the input
covA , and covA matrices must be accessed and/or manipulated.
-
The constant uppDia, implying that only the upper-diagonal subset of the input
covA , and covA matrices must be accessed and/or manipulated.
This input argument is merely serves to resolve the different procedures of this generic interface from each other at compile-time.
|
Possible calling interfaces ⛓
call setCovUpdated(covA(
1:ndim,
1:ndim), meanDiff(
1:ndim), fracA, subset)
Return the covAariance resulting from the merger of two separate (potentially weighted) non-singular ...
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 all(size(meanDiff) == shape(covA))
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
setCovUpdated
setCovMeanMerged
getVarCorrection
getMeanMerged
setMeanMerged
getVarMerged
setVarMerged
Example usage ⛓
17 integer(IK) :: isam, ndim
18 integer(IK) ,
allocatable :: iweight(:)
19 integer(IK) :: dim, idim, nsamA, nsamB, itry, ntry
= 10
20 type(display_type) :: disp
24 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
25 call disp%show(
"!Compute the biased merged covariance of a multivariate sample.")
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
30 real(TKG),
allocatable :: cov(:,:), covA(:,:)
31 real(TKG),
allocatable :: mean(:), meanA(:), meanB(:)
32 real(TKG),
allocatable :: sample(:,:), sampleA(:,:), sampleB(:,:)
35 call disp%show(
"dim = 2; ndim = getUnifRand(1, 5); nsamA = getUnifRand(ndim + 1_IK, ndim * 2_IK); nsamB = getUnifRand(1_IK, nsamA)")
39 call disp%show(
"sampleA = getUnifRand(-1., +1., ndim, nsamA) ! Generate a non-singular sample.")
43 call disp%show(
"covA = getCov(sampleA, dim)")
44 covA
= getCov(sampleA, dim)
47 call disp%show(
"meanA = getMean(sampleA, dim)")
51 call disp%show(
"sampleB = spread([(idim, idim = 1, ndim)], dim, nsamB) ! Generate a singular sample.")
52 sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
55 call disp%show(
"meanB = getMean(sampleB, dim)")
59 call disp%show(
"sample = reshape([sampleA, sampleB], [ndim, nsamA + nsamB])")
60 sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
63 call disp%show(
"cov = getCov(sample, dim)")
67 call disp%show(
"mean = getMean(sample, dim)")
71 call disp%show(
"call setCovUpdated(covA, meanA - meanB, real(nsamA, TKG) / real(nsamA + nsamB, TKG), uppDia)")
72 call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
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.
This is a generic method of the derived type display_type with pass attribute.
Generate and return the (optionally unbiased) covariance matrix of a pair of (potentially weighted) t...
Generate and return the (weighted) mean of an input sample of nsam observations with ndim = 1 or 2 at...
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...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
integer, parameter RKS
The single-precision real kind in Fortran mode. On most platforms, this is an 32-bit real kind.
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.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
12+0.227079630,
-0.358364940,
+0.789673924,
+0.797860861,
+0.388282537,
+0.301279783
13-0.750372410E-1,
+0.538735032,
+0.316716909,
-0.273296356,
+0.489778996,
+0.966706753
14-0.936355352,
+0.597420931E-1,
-0.788232565,
-0.860334039,
-0.197447538E-1,
-0.193882942
15-0.278710365,
-0.743827224,
+0.195447206,
-0.794361830,
-0.711205482,
-0.751644015
16-0.618216872,
-0.917478800,
-0.903860807,
+0.219692230,
+0.309239864,
+0.118686557
19+0.152378723,
-0.664808154E-1,
-0.104915939,
+0.540454686E-1,
+0.744377971E-1
20-0.664808154E-1,
+0.167108089,
+0.131191656,
-0.277293436E-1,
+0.973986648E-2
21-0.104915939,
+0.131191656,
+0.171603024,
-0.837030634E-1,
+0.334038362E-1
22+0.540454686E-1,
-0.277293436E-1,
-0.837030634E-1,
+0.130910754,
-0.121118724
23+0.744377971E-1,
+0.973986648E-2,
+0.334038362E-1,
-0.121118724,
+0.277288437
26+0.357635319,
+0.327267349,
-0.456467956,
-0.514050364,
-0.298656344
27sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
29+1.00000000,
+1.00000000
30+2.00000000,
+2.00000000
31+3.00000000,
+3.00000000
32+4.00000000,
+4.00000000
33+5.00000000,
+5.00000000
36+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
37sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
39+0.227079630,
-0.358364940,
+0.789673924,
+0.797860861,
+0.388282537,
+0.301279783,
+1.00000000,
+1.00000000
40-0.750372410E-1,
+0.538735032,
+0.316716909,
-0.273296356,
+0.489778996,
+0.966706753,
+2.00000000,
+2.00000000
41-0.936355352,
+0.597420931E-1,
-0.788232565,
-0.860334039,
-0.197447538E-1,
-0.193882942,
+3.00000000,
+3.00000000
42-0.278710365,
-0.743827224,
+0.195447206,
-0.794361830,
-0.711205482,
-0.751644015,
+4.00000000,
+4.00000000
43-0.618216872,
-0.917478800,
-0.903860807,
+0.219692230,
+0.309239864,
+0.118686557,
+5.00000000,
+5.00000000
46+0.191652626,
+0.151608974,
+0.337621748,
+0.584221601,
+0.694016516
47+0.151608974,
+0.649962544,
+1.18247151,
+1.39497805,
+1.66916168
48+0.337621748,
+1.18247151,
+2.36879683,
+2.86272335,
+3.45904779
49+0.584221601,
+1.39497805,
+2.86272335,
+3.91880488,
+4.39386129
50+0.694016516,
+1.66916168,
+3.45904779,
+4.39386129,
+5.47217083
53+0.518226504,
+0.745450497,
+0.407649040,
+0.614462256,
+1.02600777
54call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
56+0.191652611,
+0.151608959,
+0.337621689,
+0.584221542,
+0.694016457
57-0.664808154E-1,
+0.649962544,
+1.18247128,
+1.39497781,
+1.66916156
58-0.104915939,
+0.131191656,
+2.36879659,
+2.86272359,
+3.45904708
59+0.540454686E-1,
-0.277293436E-1,
-0.837030634E-1,
+3.91880536,
+4.39386177
60+0.744377971E-1,
+0.973986648E-2,
+0.334038362E-1,
-0.121118724,
+5.47217131
62+0.191652626,
+0.151608974,
+0.337621748,
+0.584221601,
+0.694016516
63+0.151608974,
+0.649962544,
+1.18247151,
+1.39497805,
+1.66916168
64+0.337621748,
+1.18247151,
+2.36879683,
+2.86272335,
+3.45904779
65+0.584221601,
+1.39497805,
+2.86272335,
+3.91880488,
+4.39386129
66+0.694016516,
+1.66916168,
+3.45904779,
+4.39386129,
+5.47217083
74-0.551310301,
-0.157277822,
+0.971014261,
-0.359738827,
-0.760928988,
+0.714867830,
+0.142235994,
-0.425757647
75+0.422372818,
+0.403740168,
-0.962555528,
+0.580954790,
+0.990534782,
-0.869223356,
+0.600096345,
-0.418910384
76+0.248300433,
+0.688983202E-1,
+0.905438781,
+0.222827792,
+0.267294407,
+0.703831315,
-0.539461970,
+0.679833889E-1
77+0.317070603,
+0.545669913,
-0.792849898,
+0.106190443,
+0.837319851,
-0.982849717,
+0.589144230E-1,
-0.542137980
80+0.333716184,
-0.313942522,
+0.118647680,
-0.274175018
81-0.313942522,
+0.475997984,
-0.186280936,
+0.395940721
82+0.118647680,
-0.186280936,
+0.165675566,
-0.125552014
83-0.274175018,
+0.395940721,
-0.125552014,
+0.372130692
86-0.533619374E-1,
+0.933762044E-1,
+0.243139073,
-0.565840453E-1
87sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
89+1.00000000,
+1.00000000
90+2.00000000,
+2.00000000
91+3.00000000,
+3.00000000
92+4.00000000,
+4.00000000
95+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000
96sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
98-0.551310301,
-0.157277822,
+0.971014261,
-0.359738827,
-0.760928988,
+0.714867830,
+0.142235994,
-0.425757647,
+1.00000000,
+1.00000000
99+0.422372818,
+0.403740168,
-0.962555528,
+0.580954790,
+0.990534782,
-0.869223356,
+0.600096345,
-0.418910384,
+2.00000000,
+2.00000000
100+0.248300433,
+0.688983202E-1,
+0.905438781,
+0.222827792,
+0.267294407,
+0.703831315,
-0.539461970,
+0.679833889E-1,
+3.00000000,
+3.00000000
101+0.317070603,
+0.545669913,
-0.792849898,
+0.106190443,
+0.837319851,
-0.982849717,
+0.589144230E-1,
-0.542137980,
+4.00000000,
+4.00000000
104+0.444504410,
+0.701843947E-1,
+0.559553802,
+0.464348227
105+0.701843947E-1,
+0.962432802,
+0.691982746,
+1.55425346
106+0.559553802,
+0.691982746,
+1.34858572,
+1.68890858
107+0.464348227,
+1.55425346,
+1.68890858,
+2.93064475
110+0.157310456,
+0.474700987,
+0.794511259,
+0.754732788
111call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
113+0.444504350,
+0.701843500E-1,
+0.559553742,
+0.464348078
114-0.313942522,
+0.962432742,
+0.691982746,
+1.55425334
115+0.118647680,
-0.186280936,
+1.34858561,
+1.68890834
116-0.274175018,
+0.395940721,
-0.125552014,
+2.93064427
118+0.444504410,
+0.701843947E-1,
+0.559553802,
+0.464348227
119+0.701843947E-1,
+0.962432802,
+0.691982746,
+1.55425346
120+0.559553802,
+0.691982746,
+1.34858572,
+1.68890858
121+0.464348227,
+1.55425346,
+1.68890858,
+2.93064475
129+0.424278975,
+0.693579197,
-0.698462248,
+0.275450349,
-0.436026931,
-0.519645572
130-0.736969709E-1,
-0.282396674,
+0.293629289,
+0.707378626,
-0.465216875,
-0.768611312
131-0.575455427,
-0.202430487,
-0.670269847,
-0.527434707,
-0.659009218,
-0.370522380
132covA
= getCov(sampleA, dim)
134+0.278933316,
+0.565463416E-1,
+0.479285382E-1
135+0.565463416E-1,
+0.236861438,
-0.289869495E-1
136+0.479285382E-1,
-0.289869495E-1,
+0.276716053E-1
139-0.434710383E-1,
-0.981523246E-1,
-0.500853717
140sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
142+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
143+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
144+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
147+1.00000000,
+2.00000000,
+3.00000000
148sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
150+0.424278975,
+0.693579197,
-0.698462248,
+0.275450349,
-0.436026931,
-0.519645572,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
151-0.736969709E-1,
-0.282396674,
+0.293629289,
+0.707378626,
-0.465216875,
-0.768611312,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
152-0.575455427,
-0.202430487,
-0.670269847,
-0.527434707,
-0.659009218,
-0.370522380,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
155+0.422103763,
+0.573660374,
+0.931855083
156+0.573660374,
+1.22066236,
+1.80534399
157+0.931855083,
+1.80534399,
+3.05376482
160+0.430833995,
+0.855553329,
+1.09044349
161call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
163+0.422103763,
+0.573660314,
+0.931855142
164+0.565463416E-1,
+1.22066247,
+1.80534375
165+0.479285382E-1,
-0.289869495E-1,
+3.05376554
167+0.422103763,
+0.573660374,
+0.931855083
168+0.573660374,
+1.22066236,
+1.80534399
169+0.931855083,
+1.80534399,
+3.05376482
177-0.218133211,
+0.466121435,
+0.564431906,
+0.246266127E-1,
+0.267198682
178-0.586136103,
-0.261651635,
-0.317171335,
-0.344371319,
+0.193525434
179-0.834189653,
+0.647089720,
-0.540572762,
+0.988125563,
+0.634246111
180covA
= getCov(sampleA, dim)
182+0.823129192E-1,
+0.321392082E-1,
+0.349361412E-1
183+0.321392082E-1,
+0.644779801E-1,
+0.101800203
184+0.349361412E-1,
+0.101800203,
+0.525075912
187+0.220849082,
-0.263161004,
+0.178939804
188sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
190+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
191+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
192+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
195+1.00000000,
+2.00000000,
+3.00000000
196sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
198-0.218133211,
+0.466121435,
+0.564431906,
+0.246266127E-1,
+0.267198682,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
199-0.586136103,
-0.261651635,
-0.317171335,
-0.344371319,
+0.193525434,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
200-0.834189653,
+0.647089720,
-0.540572762,
+0.988125563,
+0.634246111,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
203+0.192925647,
+0.456905842,
+0.566975594
204+0.456905842,
+1.31271327,
+1.64702833
205+0.566975594,
+1.64702833,
+2.25213218
208+0.610424519,
+0.868419468,
+1.58946991
209call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
211+0.192925483,
+0.456905574,
+0.566976011
212+0.321392082E-1,
+1.31271327,
+1.64702845
213+0.349361412E-1,
+0.101800203,
+2.25213313
215+0.192925647,
+0.456905842,
+0.566975594
216+0.456905842,
+1.31271327,
+1.64702833
217+0.566975594,
+1.64702833,
+2.25213218
225+0.888277292,
-0.361251354,
-0.188400030,
-0.375225544
226+0.958487272,
+0.275824308,
+0.871028781,
+0.552324891
227covA
= getCov(sampleA, dim)
229+0.273873210,
+0.101182431
230+0.101182431,
+0.731836706E-1
233-0.914990902E-2,
+0.664416313
234sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
236+1.00000000,
+1.00000000
237+2.00000000,
+2.00000000
240+1.00000000,
+2.00000000
241sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
243+0.888277292,
-0.361251354,
-0.188400030,
-0.375225544,
+1.00000000,
+1.00000000
244+0.958487272,
+0.275824308,
+0.871028781,
+0.552324891,
+2.00000000,
+2.00000000
247+0.408889621,
+0.366967022
248+0.366967022,
+0.445185512
251+0.327233404,
+1.10961092
252call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
254+0.408889592,
+0.366966993
255+0.101182431,
+0.445185483
257+0.408889621,
+0.366967022
258+0.366967022,
+0.445185512
266-0.408805728,
+0.775907993,
-0.636894703,
+0.961431861
267-0.776486754,
-0.453179479,
+0.420433640,
-0.506294012
268+0.529035807,
-0.821887493,
-0.978537679,
+0.838428497
269covA
= getCov(sampleA, dim)
271+0.494887531,
-0.140316248,
+0.162549645
272-0.140316248,
+0.202187195,
-0.254155278
273+0.162549645,
-0.254155278,
+0.642253160
276+0.172909856,
-0.328881651,
-0.108240217
277sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
279+1.00000000,
+1.00000000
280+2.00000000,
+2.00000000
281+3.00000000,
+3.00000000
284+1.00000000,
+2.00000000,
+3.00000000
285sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
287-0.408805728,
+0.775907993,
-0.636894703,
+0.961431861,
+1.00000000,
+1.00000000
288-0.776486754,
-0.453179479,
+0.420433640,
-0.506294012,
+2.00000000,
+2.00000000
289+0.529035807,
-0.821887493,
-0.978537679,
+0.838428497,
+3.00000000,
+3.00000000
292+0.481942356,
+0.334498972,
+0.679654121
293+0.334498972,
+1.34005570,
+1.43916845
294+0.679654121,
+1.43916845,
+2.57509255
297+0.448606580,
+0.447412252,
+0.927839875
298call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
300+0.481942356,
+0.334499180,
+0.679654121
301-0.140316248,
+1.34005594,
+1.43916833
302+0.162549645,
-0.254155278,
+2.57509232
304+0.481942356,
+0.334498972,
+0.679654121
305+0.334498972,
+1.34005570,
+1.43916845
306+0.679654121,
+1.43916845,
+2.57509255
314-0.569231153,
-0.451639652,
+0.982924342,
+0.521308780,
-0.397634029
315-0.688037276,
-0.937248707,
-0.525768638,
+0.735185862,
+0.772388220
316-0.726474762,
-0.429679394,
-0.178660154E-1,
+0.574117064,
-0.804270387
317covA
= getCov(sampleA, dim)
319+0.384509772,
+0.770648494E-1,
+0.246640906
320+0.770648494E-1,
+0.536506355,
+0.106422737
321+0.246640906,
+0.106422737,
+0.258965939
324+0.171456579E-1,
-0.128696114,
-0.280834705
325sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
327+1.00000000,
+1.00000000,
+1.00000000
328+2.00000000,
+2.00000000,
+2.00000000
329+3.00000000,
+3.00000000,
+3.00000000
332+1.00000000,
+2.00000000,
+3.00000000
333sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
335-0.569231153,
-0.451639652,
+0.982924342,
+0.521308780,
-0.397634029,
+1.00000000,
+1.00000000,
+1.00000000
336-0.688037276,
-0.937248707,
-0.525768638,
+0.735185862,
+0.772388220,
+2.00000000,
+2.00000000,
+2.00000000
337-0.726474762,
-0.429679394,
-0.178660154E-1,
+0.574117064,
-0.804270387,
+3.00000000,
+3.00000000,
+3.00000000
340+0.466725588,
+0.538524508,
+0.909912229
341+0.538524508,
+1.39735043,
+1.70336556
342+0.909912229,
+1.70336556,
+2.68463683
345+0.385716021,
+0.669564962,
+0.949478328
346call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
348+0.466725498,
+0.538524508,
+0.909912109
349+0.770648494E-1,
+1.39735103,
+1.70336592
350+0.246640906,
+0.106422737,
+2.68463731
352+0.466725588,
+0.538524508,
+0.909912229
353+0.538524508,
+1.39735043,
+1.70336556
354+0.909912229,
+1.70336556,
+2.68463683
362-0.798716068,
+0.687268138,
+0.721641660,
+0.103300452,
+0.665781736,
-0.926086307
363-0.204496264,
-0.612563252,
+0.985654831,
+0.551976085,
-0.908548117,
-0.813949108
364-0.478522778,
+0.620089173,
+0.222396135,
+0.836520076,
-0.194923520,
-0.198452473
365covA
= getCov(sampleA, dim)
367+0.484732240,
+0.122536272,
+0.174719974
368+0.122536272,
+0.502318203,
+0.145393625
369+0.174719974,
+0.145393625,
+0.221921489
372+0.755316019E-1,
-0.166987643,
+0.134517774
373sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
375+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
376+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
377+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
380+1.00000000,
+2.00000000,
+3.00000000
381sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
383-0.798716068,
+0.687268138,
+0.721641660,
+0.103300452,
+0.665781736,
-0.926086307,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
384-0.204496264,
-0.612563252,
+0.985654831,
+0.551976085,
-0.908548117,
-0.813949108,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
385-0.478522778,
+0.620089173,
+0.222396135,
+0.836520076,
-0.194923520,
-0.198452473,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
388+0.476294279,
+0.563526750,
+0.752090454
389+0.563526750,
+1.43824840,
+1.61884189
390+0.752090454,
+1.61884189,
+2.15682983
393+0.495744556,
+0.818006694,
+1.43700969
394call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
396+0.476294070,
+0.563526750,
+0.752090514
397+0.122536272,
+1.43824840,
+1.61884236
398+0.174719974,
+0.145393625,
+2.15683031
400+0.476294279,
+0.563526750,
+0.752090454
401+0.563526750,
+1.43824840,
+1.61884189
402+0.752090454,
+1.61884189,
+2.15682983
410-0.965526342,
-0.860236168,
+0.942549229,
-0.912460089,
+0.439404368,
+0.771071434,
-0.612631798,
-0.877833009,
-0.394182920,
+0.343142152
411+0.788126230,
+0.312078595,
-0.690233588,
-0.141911268,
-0.470047116,
+0.203009129,
+0.932999730,
+0.401859879,
+0.223711848,
-0.686202168
412-0.363577724,
-0.230214119,
+0.158134699E-1,
-0.870528579,
+0.861331940,
-0.982983112,
-0.297505498,
-0.282592535,
+0.752684712,
-0.494356394
413-0.679321527,
-0.381837010,
-0.272285342,
-0.469141126,
-0.599793077,
+0.273284912,
-0.844006062,
-0.455271244,
+0.839556217,
+0.444440126
414-0.553802729,
+0.634016395,
+0.451936364,
-0.398380399,
-0.130800009,
-0.390780568,
+0.650177121,
+0.666118860,
-0.560217023,
+0.421813250
415covA
= getCov(sampleA, dim)
417+0.514760613,
-0.266277045,
+0.540476441E-1,
+0.138521343,
-0.294718752E-2
418-0.266277045,
+0.295387268,
-0.568471216E-1,
-0.962909013E-1,
-0.121340277E-1
419+0.540476441E-1,
-0.568471216E-1,
+0.327275723,
+0.339992009E-1,
-0.181579292E-1
420+0.138521343,
-0.962909013E-1,
+0.339992009E-1,
+0.269811213,
-0.795839578E-1
421-0.294718752E-2,
-0.121340277E-1,
-0.181579292E-1,
-0.795839578E-1,
+0.253723711
424-0.212670326,
+0.873391256E-1,
-0.189192787,
-0.214437410,
+0.790081248E-1
425sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
427+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
428+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
429+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
430+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
431+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
434+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
435sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
437-0.965526342,
-0.860236168,
+0.942549229,
-0.912460089,
+0.439404368,
+0.771071434,
-0.612631798,
-0.877833009,
-0.394182920,
+0.343142152,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
438+0.788126230,
+0.312078595,
-0.690233588,
-0.141911268,
-0.470047116,
+0.203009129,
+0.932999730,
+0.401859879,
+0.223711848,
-0.686202168,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
439-0.363577724,
-0.230214119,
+0.158134699E-1,
-0.870528579,
+0.861331940,
-0.982983112,
-0.297505498,
-0.282592535,
+0.752684712,
-0.494356394,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
440-0.679321527,
-0.381837010,
-0.272285342,
-0.469141126,
-0.599793077,
+0.273284912,
-0.844006062,
-0.455271244,
+0.839556217,
+0.444440126,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
441-0.553802729,
+0.634016395,
+0.451936364,
-0.398380399,
-0.130800009,
-0.390780568,
+0.650177121,
+0.666118860,
-0.560217023,
+0.421813250,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
444+0.669967175,
+0.337910295,
+0.895462871,
+1.22806406,
+1.32415521
445+0.337910295,
+1.00987422,
+1.31762314,
+1.72709262,
+2.08350801
446+0.895462871,
+1.31762314,
+2.47839570,
+3.00947809,
+3.47544885
447+1.22806406,
+1.72709262,
+3.00947809,
+4.12687016,
+4.55565596
448+1.32415521,
+2.08350801,
+3.47544885,
+4.55565596,
+5.55051756
451+0.191553131,
+0.724892795,
+0.873871505,
+1.19037509,
+1.71933877
452call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
454+0.669966936,
+0.337910146,
+0.895462751,
+1.22806382,
+1.32415533
455-0.266277045,
+1.00987399,
+1.31762278,
+1.72709239,
+2.08350801
456+0.540476441E-1,
-0.568471216E-1,
+2.47839499,
+3.00947809,
+3.47544837
457+0.138521343,
-0.962909013E-1,
+0.339992009E-1,
+4.12687016,
+4.55565786
458-0.294718752E-2,
-0.121340277E-1,
-0.181579292E-1,
-0.795839578E-1,
+5.55051804
460+0.669967175,
+0.337910295,
+0.895462871,
+1.22806406,
+1.32415521
461+0.337910295,
+1.00987422,
+1.31762314,
+1.72709262,
+2.08350801
462+0.895462871,
+1.31762314,
+2.47839570,
+3.00947809,
+3.47544885
463+1.22806406,
+1.72709262,
+3.00947809,
+4.12687016,
+4.55565596
464+1.32415521,
+2.08350801,
+3.47544885,
+4.55565596,
+5.55051756
472-0.465553045,
-0.720241547,
-0.776401401,
+0.695394039,
+0.742467761,
-0.963065147
473+0.277769089,
-0.458490849E-2,
-0.519737720,
+0.939446449,
-0.262204885,
+0.586462021E-2
474+0.497704744E-1,
-0.568358302,
+0.536094904E-1,
+0.556563258,
-0.251256227E-1,
-0.264130235
475covA
= getCov(sampleA, dim)
477+0.488647699,
+0.139781877,
+0.153051645
478+0.139781877,
+0.211147711,
+0.884750634E-1
479+0.153051645,
+0.884750634E-1,
+0.117004782
482-0.247899890,
+0.727587789E-1,
-0.329451561E-1
483sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
485+1.00000000,
+1.00000000
486+2.00000000,
+2.00000000
487+3.00000000,
+3.00000000
490+1.00000000,
+2.00000000,
+3.00000000
491sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
493-0.465553045,
-0.720241547,
-0.776401401,
+0.695394039,
+0.742467761,
-0.963065147,
+1.00000000,
+1.00000000
494+0.277769089,
-0.458490849E-2,
-0.519737720,
+0.939446449,
-0.262204885,
+0.586462021E-2,
+2.00000000,
+2.00000000
495+0.497704744E-1,
-0.568358302,
+0.536094904E-1,
+0.556563258,
-0.251256227E-1,
-0.264130235,
+3.00000000,
+3.00000000
498+0.658470869,
+0.555774629,
+0.824440956
499+0.555774629,
+0.854784250,
+1.16233444
500+0.824440956,
+1.16233444,
+1.81252050
503+0.640750825E-1,
+0.554569066,
+0.725291133
504call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
506+0.658470929,
+0.555774689,
+0.824440956
507+0.139781877,
+0.854784310,
+1.16233444
508+0.153051645,
+0.884750634E-1,
+1.81252027
510+0.658470869,
+0.555774629,
+0.824440956
511+0.555774629,
+0.854784250,
+1.16233444
512+0.824440956,
+1.16233444,
+1.81252050
- Test:
- test_pm_sampleCov
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.
-
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.
-
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.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, April 21, 2017, 1:54 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin
Definition at line 8553 of file pm_sampleCov.F90.