Return the covariance and mean of a sample that results from the merger of two separate (potentially weighted) non-singular \(A\) and singular \(B\) samples.
More...
Return the covariance and mean of a sample that results from the merger of two separate (potentially weighted) non-singular \(A\) and singular \(B\) samples.
See the documentation of pm_sampleCov for more information and definition online updating of sample covariance.
- Note
- The input and output variances of this generic interface are all biased variances.
A biased covariance 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 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),
containing the biased covariance of the first sample that must be merged with the second sample.
|
[in] | meanA | : The input object of the same type and kind as the input argument covA of size size(covA, 1) , containing the mean of the first sample that must be merged with the mean of the second sample meanB .
|
[in] | meanB | : The input or input/output object of the same type and kind and rank as the input argument covA of size size(covA, 1) , containing the mean of the second sample that must be merged with the mean of the first sample meanA .
If the input argument mean is missing, then meanB contains the updated mean of the merged sample on return.
Otherwise, the contents of meanB remain intact upon return.
|
[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
cov , and covA matrices must be accessed and/or manipulated.
-
The constant uppDia, implying that only the upper-diagonal subset of the input
cov , 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 setCovMeanUpdated(covA(
1:ndim,
1:ndim), meanA(
1:ndim), meanB(
1:ndim), fracA, subset)
Return the covariance and mean of a sample that results from the merger of two separate (potentially ...
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(meanB) == shape(covA))
must hold for the corresponding input arguments.
The condition all(size(meanA) == 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
setCovMerged
setCovMeanUpdated
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 setCovMeanUpdated(covA, meanA, meanB, real(nsamA, TKG) / real(nsamA + nsamB, TKG), uppDia)")
72 call setCovMeanUpdated(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.684280396E-1,
+0.365089059
19sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
21+1.00000000,
+1.00000000
25sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
27-0.684280396E-1,
+0.365089059,
+1.00000000,
+1.00000000
34call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
50-0.268353105,
+0.902813435,
-0.625329852,
+0.964020491
51+0.403311968,
-0.914786935,
-0.815971375,
-0.252722144
54+0.492675632,
-0.707636178E-1
55-0.707636178E-1,
+0.276235223
58+0.243287742,
-0.395042121
59sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
61+1.00000000,
+1.00000000
62+2.00000000,
+2.00000000
65+1.00000000,
+2.00000000
66sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
68-0.268353105,
+0.902813435,
-0.625329852,
+0.964020491,
+1.00000000,
+1.00000000
69+0.403311968,
-0.914786935,
-0.815971375,
-0.252722144,
+2.00000000,
+2.00000000
72+0.455697894,
+0.355570376
73+0.355570376,
+1.45887375
76+0.495525181,
+0.403305262
77call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
79+0.495525151,
+0.403305203
81+0.495525181,
+0.403305262
83+0.455697864,
+0.355570406
84-0.707636178E-1,
+1.45887387
86+0.455697894,
+0.355570376
87+0.355570376,
+1.45887375
95-0.593934536,
+0.207599401E-1,
-0.655868173,
-0.779442549,
+0.526072621,
-0.365898728,
+0.445330501,
-0.331532955E-1
96+0.291546583,
+0.634677649,
-0.604514360,
+0.530744076,
-0.817532420,
-0.223498583,
-0.764541626E-1,
+0.511463046
97+0.456022978,
-0.978993177,
+0.421995759,
-0.601902843,
-0.836045980,
+0.292365432,
-0.753318071E-1,
+0.341084838
98-0.860185385,
-0.399177313,
+0.940710902,
-0.976643085,
+0.709389567,
-0.834399819,
-0.340094209,
-0.886177421
101+0.217890665,
-0.665319413E-1,
-0.108314961,
+0.910222828E-1
102-0.665319413E-1,
+0.264137685,
-0.292970389E-1,
-0.291291952
103-0.108314961,
-0.292970389E-1,
+0.311621130,
-0.568497479E-1
104+0.910222828E-1,
-0.291291952,
-0.568497479E-1,
+0.495364457
107-0.179516777,
+0.308039784E-1,
-0.122600600,
-0.330822110
108sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
110+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
111+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
112+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
113+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
116+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000
117sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
119-0.593934536,
+0.207599401E-1,
-0.655868173,
-0.779442549,
+0.526072621,
-0.365898728,
+0.445330501,
-0.331532955E-1,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
120+0.291546583,
+0.634677649,
-0.604514360,
+0.530744076,
-0.817532420,
-0.223498583,
-0.764541626E-1,
+0.511463046,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
121+0.456022978,
-0.978993177,
+0.421995759,
-0.601902843,
-0.836045980,
+0.292365432,
-0.753318071E-1,
+0.341084838,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
122-0.860185385,
-0.399177313,
+0.940710902,
-0.976643085,
+0.709389567,
-0.834399819,
-0.340094209,
-0.886177421,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
125+0.456760049,
+0.547408938,
+0.866632640,
+1.32258058
126+0.547408938,
+1.10150218,
+1.52260447,
+1.98641431
127+0.866632640,
+1.52260447,
+2.59346914,
+3.35243177
128+1.32258058,
+1.98641431,
+3.35243177,
+4.93668890
131+0.410241604,
+1.01540196,
+1.43869972,
+1.83458900
132call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
134+0.410241604,
+1.01540196,
+1.43869972,
+1.83458900
136+0.410241604,
+1.01540196,
+1.43869972,
+1.83458900
138+0.456760317,
+0.547408998,
+0.866632462,
+1.32258046
139-0.665319413E-1,
+1.10150218,
+1.52260458,
+1.98641336
140-0.108314961,
-0.292970389E-1,
+2.59346914,
+3.35243177
141+0.910222828E-1,
-0.291291952,
-0.568497479E-1,
+4.93668699
143+0.456760049,
+0.547408938,
+0.866632640,
+1.32258058
144+0.547408938,
+1.10150218,
+1.52260447,
+1.98641431
145+0.866632640,
+1.52260447,
+2.59346914,
+3.35243177
146+1.32258058,
+1.98641431,
+3.35243177,
+4.93668890
154+0.733378291,
+0.400316954,
+0.992570400,
-0.277933598,
+0.209508896,
-0.289315581,
-0.711770058,
+0.365519166
155-0.243218303,
-0.125657320E-1,
-0.540019751,
+0.618052006,
-0.371950865E-1,
+0.283687711,
+0.845891237E-1,
+0.953742743
156+0.403027534E-1,
-0.379487276,
-0.893040180,
-0.537527919,
+0.737740278,
-0.866895914E-1,
+0.905394912,
-0.542064905
157+0.802765369,
+0.744126678,
+0.351109266,
+0.857968211,
+0.307981968,
-0.266614795,
+0.751134157E-1,
+0.377030611
158-0.834305286,
+0.440862179,
+0.113449216,
+0.123936653,
+0.819953203,
+0.361718059,
+0.250027895,
-0.148756504E-1
159covA
= getCov(sampleA, dim)
161+0.284437597,
-0.111183897,
-0.173499659,
+0.806202888E-1,
-0.872029662E-1
162-0.111183897,
+0.197295502,
-0.303625278E-1,
-0.434471667E-2,
+0.146652460E-1
163-0.173499659,
-0.303625278E-1,
+0.353264838,
-0.754991397E-1,
+0.697719678E-1
164+0.806202888E-1,
-0.434471667E-2,
-0.754991397E-1,
+0.131422937,
-0.672960281E-1
165-0.872029662E-1,
+0.146652460E-1,
+0.697719678E-1,
-0.672960281E-1,
+0.198232889
168+0.177784294,
+0.138384089,
-0.944214910E-1,
+0.406185061,
+0.157595783
169sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
171+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
172+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
173+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
174+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
175+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
178+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
179sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
181+0.733378291,
+0.400316954,
+0.992570400,
-0.277933598,
+0.209508896,
-0.289315581,
-0.711770058,
+0.365519166,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
182-0.243218303,
-0.125657320E-1,
-0.540019751,
+0.618052006,
-0.371950865E-1,
+0.283687711,
+0.845891237E-1,
+0.953742743,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
183+0.403027534E-1,
-0.379487276,
-0.893040180,
-0.537527919,
+0.737740278,
-0.866895914E-1,
+0.905394912,
-0.542064905,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
184+0.802765369,
+0.744126678,
+0.351109266,
+0.857968211,
+0.307981968,
-0.266614795,
+0.751134157E-1,
+0.377030611,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
185-0.834305286,
+0.440862179,
+0.113449216,
+0.123936653,
+0.819953203,
+0.361718059,
+0.250027895,
-0.148756504E-1,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
188+0.339855909,
+0.266021907,
+0.449729562,
+0.710389495,
+0.826642752
189+0.266021907,
+0.901666641,
+1.25989723,
+1.48383760,
+2.01304269
190+0.449729562,
+1.25989723,
+2.36338663,
+2.42095137,
+3.37639022
191+0.710389495,
+1.48383760,
+2.42095137,
+2.95772743,
+3.82240295
192+0.826642752,
+2.01304269,
+3.37639022,
+3.82240295,
+5.34301949
195+0.451856226,
+0.758922756,
+0.937052369,
+1.60412347,
+1.77173042
196call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
198+0.451856196,
+0.758922696,
+0.937052250,
+1.60412335,
+1.77173042
200+0.451856226,
+0.758922756,
+0.937052369,
+1.60412347,
+1.77173042
202+0.339855850,
+0.266021758,
+0.449729443,
+0.710389256,
+0.826642573
203-0.111183897,
+0.901666701,
+1.25989687,
+1.48383737,
+2.01304269
204-0.173499659,
-0.303625278E-1,
+2.36338592,
+2.42095089,
+3.37638998
205+0.806202888E-1,
-0.434471667E-2,
-0.754991397E-1,
+2.95772743,
+3.82240343
206-0.872029662E-1,
+0.146652460E-1,
+0.697719678E-1,
-0.672960281E-1,
+5.34301710
208+0.339855909,
+0.266021907,
+0.449729562,
+0.710389495,
+0.826642752
209+0.266021907,
+0.901666641,
+1.25989723,
+1.48383760,
+2.01304269
210+0.449729562,
+1.25989723,
+2.36338663,
+2.42095137,
+3.37639022
211+0.710389495,
+1.48383760,
+2.42095137,
+2.95772743,
+3.82240295
212+0.826642752,
+2.01304269,
+3.37639022,
+3.82240295,
+5.34301949
220-0.455495119,
-0.212714911,
+0.366974711,
-0.638763785,
+0.787898183,
-0.872093558,
-0.490419269,
+0.613118291
221-0.332322359,
+0.420439005,
-0.197796822,
-0.253468513,
-0.140622854E-1,
-0.280755877,
-0.934448242E-1,
+0.466843963
222-0.440102935,
-0.767717004,
-0.297649980,
+0.910135508E-1,
+0.422972202,
-0.851113081,
-0.766758442,
-0.621585846
223+0.469906926,
-0.927305579,
-0.865140438,
-0.820937157,
+0.264079213,
-0.153295875,
+0.923818588,
+0.461553335E-1
224-0.102893710,
+0.685007453,
-0.170946002,
-0.937471271,
+0.172721624,
+0.166361809,
+0.262119770,
-0.244860768
225covA
= getCov(sampleA, dim)
227+0.336447775,
+0.856267437E-1,
+0.112844408,
-0.158086419E-2,
+0.163025688E-1
228+0.856267437E-1,
+0.857689455E-1,
-0.301464554E-1,
-0.287609845E-1,
+0.499553308E-1
229+0.112844408,
-0.301464554E-1,
+0.181584075,
-0.295211729E-1,
-0.876259059E-1
230-0.158086419E-2,
-0.287609845E-1,
-0.295211729E-1,
+0.413843930,
+0.577896200E-1
231+0.163025688E-1,
+0.499553308E-1,
-0.876259059E-1,
+0.577896200E-1,
+0.196307361
234-0.112686932,
-0.355709642E-1,
-0.403867692,
-0.132839873,
-0.212451369E-1
235sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
237+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
238+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
239+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
240+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
241+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
244+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
245sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
247-0.455495119,
-0.212714911,
+0.366974711,
-0.638763785,
+0.787898183,
-0.872093558,
-0.490419269,
+0.613118291,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
248-0.332322359,
+0.420439005,
-0.197796822,
-0.253468513,
-0.140622854E-1,
-0.280755877,
-0.934448242E-1,
+0.466843963,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
249-0.440102935,
-0.767717004,
-0.297649980,
+0.910135508E-1,
+0.422972202,
-0.851113081,
-0.766758442,
-0.621585846,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
250+0.469906926,
-0.927305579,
-0.865140438,
-0.820937157,
+0.264079213,
-0.153295875,
+0.923818588,
+0.461553335E-1,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
251-0.102893710,
+0.685007453,
-0.170946002,
-0.937471271,
+0.172721624,
+0.166361809,
+0.262119770,
-0.244860768,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
254+0.500079811,
+0.588777065,
+0.965878010,
+1.08744299,
+1.33241689
255+0.588777065,
+1.03350282,
+1.62140429,
+1.97346997,
+2.44993711
256+0.965878010,
+1.62140429,
+2.85406685,
+3.31145191,
+3.99143839
257+1.08744299,
+1.97346997,
+3.31145191,
+4.29736328,
+4.94727993
258+1.33241689,
+2.44993711,
+3.99143839,
+4.94727993,
+6.08835697
261+0.315269589,
+0.747340977,
+0.905312181,
+1.45671391,
+1.91000319
262call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
264+0.315269560,
+0.747340918,
+0.905312061,
+1.45671380,
+1.91000295
266+0.315269589,
+0.747340977,
+0.905312181,
+1.45671391,
+1.91000319
268+0.500079572,
+0.588776886,
+0.965877891,
+1.08744276,
+1.33241642
269+0.856267437E-1,
+1.03350234,
+1.62140417,
+1.97346950,
+2.44993687
270+0.112844408,
-0.301464554E-1,
+2.85406709,
+3.31145191,
+3.99143791
271-0.158086419E-2,
-0.287609845E-1,
-0.295211729E-1,
+4.29736233,
+4.94727898
272+0.163025688E-1,
+0.499553308E-1,
-0.876259059E-1,
+0.577896200E-1,
+6.08835459
274+0.500079811,
+0.588777065,
+0.965878010,
+1.08744299,
+1.33241689
275+0.588777065,
+1.03350282,
+1.62140429,
+1.97346997,
+2.44993711
276+0.965878010,
+1.62140429,
+2.85406685,
+3.31145191,
+3.99143839
277+1.08744299,
+1.97346997,
+3.31145191,
+4.29736328,
+4.94727993
278+1.33241689,
+2.44993711,
+3.99143839,
+4.94727993,
+6.08835697
286+0.828679800,
+0.744160414E-1,
-0.927911043,
+0.700528622E-1
287+0.508560896,
+0.399140000,
-0.462279916,
+0.668952584
288covA
= getCov(sampleA, dim)
290+0.389415622,
+0.228587538
291+0.228587538,
+0.192172512
294+0.113094151E-1,
+0.278593391
295sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
297+1.00000000,
+1.00000000
298+2.00000000,
+2.00000000
301+1.00000000,
+2.00000000
302sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
304+0.828679800,
+0.744160414E-1,
-0.927911043,
+0.700528622E-1,
+1.00000000,
+1.00000000
305+0.508560896,
+0.399140000,
-0.462279916,
+0.668952584,
+2.00000000,
+2.00000000
308+0.476834714,
+0.530600309
309+0.530600309,
+0.786612928
312+0.340872943,
+0.852395654
313call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
315+0.340872914,
+0.852395535
317+0.340872943,
+0.852395654
319+0.476834655,
+0.530600250
320+0.228587538,
+0.786612868
322+0.476834714,
+0.530600309
323+0.530600309,
+0.786612928
331+0.287277341,
+0.794893503E-1,
+0.801655412,
-0.965929627,
-0.381404519,
-0.828216672,
-0.221018553,
-0.155552030,
-0.803939700,
+0.885947347
332-0.303014159,
-0.804553628,
+0.277642965,
+0.855230093,
-0.699876666,
+0.391191125,
-0.355965853,
+0.128044605,
+0.169337988,
+0.272277951
333+0.427664280,
-0.627458572,
+0.705642462,
+0.360101581,
+0.808489203,
-0.322374701,
+0.445165873,
+0.394420028,
+0.174618483,
+0.323376656E-1
334+0.555742264,
+0.232821226,
-0.314476013,
-0.157380819,
-0.738346696,
+0.928263068,
+0.828882337,
+0.651695967,
+0.877295494,
-0.625211120
335+0.237431645,
+0.377485633,
-0.627346039,
+0.826566100,
+0.673902035,
-0.985977411,
+0.241273165,
-0.916727066,
-0.110224962,
+0.321837664
336covA
= getCov(sampleA, dim)
338+0.383075744,
-0.656802580E-1,
+0.290214475E-1,
-0.166139960,
-0.175538305E-1
339-0.656802580E-1,
+0.243591830,
+0.134298000E-1,
+0.845811982E-2,
-0.834316984E-1
340+0.290214475E-1,
+0.134298000E-1,
+0.177173138,
-0.861299261E-1,
+0.310170483E-1
341-0.166139960,
+0.845811982E-2,
-0.861299261E-1,
+0.366439730,
-0.182969794
342-0.175538305E-1,
-0.834316984E-1,
+0.310170483E-1,
-0.182969794,
+0.371612370
345-0.130169168,
-0.696855783E-2,
+0.239860639,
+0.223928556,
+0.382207637E-2
346sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
348+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
349+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
350+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
351+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
352+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
355+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
356sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
358+0.287277341,
+0.794893503E-1,
+0.801655412,
-0.965929627,
-0.381404519,
-0.828216672,
-0.221018553,
-0.155552030,
-0.803939700,
+0.885947347,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
359-0.303014159,
-0.804553628,
+0.277642965,
+0.855230093,
-0.699876666,
+0.391191125,
-0.355965853,
+0.128044605,
+0.169337988,
+0.272277951,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
360+0.427664280,
-0.627458572,
+0.705642462,
+0.360101581,
+0.808489203,
-0.322374701,
+0.445165873,
+0.394420028,
+0.174618483,
+0.323376656E-1,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
361+0.555742264,
+0.232821226,
-0.314476013,
-0.157380819,
-0.738346696,
+0.928263068,
+0.828882337,
+0.651695967,
+0.877295494,
-0.625211120,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
362+0.237431645,
+0.377485633,
-0.627346039,
+0.826566100,
+0.673902035,
-0.985977411,
+0.241273165,
-0.916727066,
-0.110224962,
+0.321837664,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
365+0.534295440,
+0.415986359,
+0.657346904,
+0.752267301,
+1.13981390
366+0.415986359,
+0.996019125,
+1.14010549,
+1.55266523,
+1.98676753
367+0.657346904,
+1.14010549,
+1.68132150,
+2.06551623,
+2.83647060
368+0.752267301,
+1.55266523,
+2.06551623,
+3.17168450,
+3.71949601
369+1.13981390,
+1.98676753,
+2.83647060,
+3.71949601,
+5.35968161
372+0.192736328,
+0.566451073,
+1.02847195,
+1.30280614,
+1.43130159
373call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
375+0.192736298,
+0.566451013,
+1.02847183,
+1.30280602,
+1.43130136
377+0.192736328,
+0.566451073,
+1.02847195,
+1.30280614,
+1.43130159
379+0.534295440,
+0.415986329,
+0.657346845,
+0.752267241,
+1.13981390
380-0.656802580E-1,
+0.996019185,
+1.14010561,
+1.55266523,
+1.98676741
381+0.290214475E-1,
+0.134298000E-1,
+1.68132162,
+2.06551623,
+2.83647108
382-0.166139960,
+0.845811982E-2,
-0.861299261E-1,
+3.17168474,
+3.71949625
383-0.175538305E-1,
-0.834316984E-1,
+0.310170483E-1,
-0.182969794,
+5.35968161
385+0.534295440,
+0.415986359,
+0.657346904,
+0.752267301,
+1.13981390
386+0.415986359,
+0.996019125,
+1.14010549,
+1.55266523,
+1.98676753
387+0.657346904,
+1.14010549,
+1.68132150,
+2.06551623,
+2.83647060
388+0.752267301,
+1.55266523,
+2.06551623,
+3.17168450,
+3.71949601
389+1.13981390,
+1.98676753,
+2.83647060,
+3.71949601,
+5.35968161
397-0.783626199,
+0.600347757,
-0.125415206
398-0.989058852,
-0.353696346,
+0.567558169
399covA
= getCov(sampleA, dim)
401+0.319484204,
+0.137254998
402+0.137254998,
+0.408383608
405-0.102897882,
-0.258399010
406sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
408+1.00000000,
+1.00000000,
+1.00000000
409+2.00000000,
+2.00000000,
+2.00000000
412+1.00000000,
+2.00000000
413sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
415-0.783626199,
+0.600347757,
-0.125415206,
+1.00000000,
+1.00000000,
+1.00000000
416-0.989058852,
-0.353696346,
+0.567558169,
+2.00000000,
+2.00000000,
+2.00000000
419+0.463837951,
+0.691323280
420+0.691323280,
+1.47928369
423+0.448551059,
+0.870800495
424call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
426+0.448551059,
+0.870800495
428+0.448551059,
+0.870800495
430+0.463838041,
+0.691323340
431+0.137254998,
+1.47928333
433+0.463837951,
+0.691323280
434+0.691323280,
+1.47928369
442-0.720906854,
+0.675368071,
+0.571119785E-1,
-0.160129070E-1,
-0.181246638
443+0.969111085,
+0.543625951,
+0.440006852,
+0.736594915,
-0.383182168
444-0.935801268,
-0.906371474,
-0.433654904,
-0.458913803,
-0.395189404
445covA
= getCov(sampleA, dim)
447+0.201060250,
-0.326123498E-1,
+0.924825654E-4
448-0.326123498E-1,
+0.210808143,
-0.666830912E-1
449+0.924825654E-4,
-0.666830912E-1,
+0.585545860E-1
452-0.371372700E-1,
+0.461231321,
-0.625986218
453sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
460+1.00000000,
+2.00000000,
+3.00000000
461sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
463-0.720906854,
+0.675368071,
+0.571119785E-1,
-0.160129070E-1,
-0.181246638,
+1.00000000
464+0.969111085,
+0.543625951,
+0.440006852,
+0.736594915,
-0.383182168,
+2.00000000
465-0.935801268,
-0.906371474,
-0.433654904,
-0.458913803,
-0.395189404,
+3.00000000
468+0.316946596,
+0.194477826,
+0.522388935
469+0.194477826,
+0.504535794,
+0.719368815
470+0.522388935,
+0.719368815,
+1.87487543
473+0.135718942,
+0.717692792,
-0.216551628E-1
474call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
476+0.135718957,
+0.717692792,
-0.216550827E-1
478+0.135718942,
+0.717692792,
-0.216551628E-1
480+0.316946566,
+0.194477811,
+0.522388935
481-0.326123498E-1,
+0.504535854,
+0.719368815
482+0.924825654E-4,
-0.666830912E-1,
+1.87487555
484+0.316946596,
+0.194477826,
+0.522388935
485+0.194477826,
+0.504535794,
+0.719368815
486+0.522388935,
+0.719368815,
+1.87487543
494-0.353447318,
+0.484949231,
+0.924181700,
+0.323956966,
+0.424858689
495-0.727890015,
+0.208188891,
+0.737259984,
+0.793293953,
+0.927120209
496+0.217493773E-1,
+0.223648548,
-0.792405128,
-0.385578394,
-0.196278811
497covA
= getCov(sampleA, dim)
499+0.169684410,
+0.198213622,
-0.864899978E-1
500+0.198213622,
+0.370887756,
-0.120757557
501-0.864899978E-1,
-0.120757557,
+0.122145347
504+0.360899866,
+0.387594610,
-0.225772887
505sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
507+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
508+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
509+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
512+1.00000000,
+2.00000000,
+3.00000000
513sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
515-0.353447318,
+0.484949231,
+0.924181700,
+0.323956966,
+0.424858689,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
516-0.727890015,
+0.208188891,
+0.737259984,
+0.793293953,
+0.927120209,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
517+0.217493773E-1,
+0.223648548,
-0.792405128,
-0.385578394,
-0.196278811,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
520+0.195120707,
+0.364560246,
+0.460985094
521+0.364560246,
+0.847987294,
+1.21717262
522+0.460985094,
+1.21717262,
+2.63714480
525+0.644944370,
+1.10421920,
+1.20790398
526call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
528+0.644944370,
+1.10421920,
+1.20790386
530+0.644944370,
+1.10421920,
+1.20790398
532+0.195120722,
+0.364560306,
+0.460985065
533+0.198213622,
+0.847987294,
+1.21717262
534-0.864899978E-1,
-0.120757557,
+2.63714480
536+0.195120707,
+0.364560246,
+0.460985094
537+0.364560246,
+0.847987294,
+1.21717262
538+0.460985094,
+1.21717262,
+2.63714480
- 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 8922 of file pm_sampleCov.F90.