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.965767741,
+0.864598632
19sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
25sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
27-0.965767741,
+0.864598632,
+1.00000000
34call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
50-0.319911480,
-0.233755350,
+0.423461914,
+0.720913172,
-0.296670675,
+0.547161460
51-0.564549923,
-0.269218802,
+0.259472370,
-0.358684421,
-0.551665902,
+0.854834557
52+0.880737185,
-0.316439033,
+0.958654523,
-0.393489838,
-0.397066355,
-0.740029812E-1
55+0.187580675,
+0.135754824,
-0.167512111E-1
56+0.135754824,
+0.259357095,
+0.337921008E-1
57-0.167512111E-1,
+0.337921008E-1,
+0.340095937
60+0.140199840,
-0.104968689,
+0.109732255
61sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
63+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
64+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
65+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
68+1.00000000,
+2.00000000,
+3.00000000
69sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
71-0.319911480,
-0.233755350,
+0.423461914,
+0.720913172,
-0.296670675,
+0.547161460,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
72-0.564549923,
-0.269218802,
+0.259472370,
-0.358684421,
-0.551665902,
+0.854834557,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
73+0.880737185,
-0.316439033,
+0.958654523,
-0.393489838,
-0.397066355,
-0.740029812E-1,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
76+0.278604358,
+0.520340323,
+0.612887561
77+0.520340323,
+1.23740101,
+1.53787696
78+0.612887561,
+1.53787696,
+2.25845957
81+0.570099950,
+0.947515666,
+1.55486619
82call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
84+0.570099950,
+0.947515666,
+1.55486608
86+0.570099950,
+0.947515666,
+1.55486619
88+0.278604418,
+0.520340562,
+0.612887621
89+0.135754824,
+1.23740196,
+1.53787696
90-0.167512111E-1,
+0.337921008E-1,
+2.25846004
92+0.278604358,
+0.520340323,
+0.612887561
93+0.520340323,
+1.23740101,
+1.53787696
94+0.612887561,
+1.53787696,
+2.25845957
102+0.949618220,
+0.713539124E-1,
+0.430992842E-1,
+0.748700500
103-0.435576558,
-0.163419247,
+0.718210340,
+0.287227869
104covA
= getCov(sampleA, dim)
106+0.161935151,
-0.908717215E-1
107-0.908717215E-1,
+0.193364978
110+0.453192979,
+0.101610601
111sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
117+1.00000000,
+2.00000000
118sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
120+0.949618220,
+0.713539124E-1,
+0.430992842E-1,
+0.748700500,
+1.00000000
121-0.435576558,
-0.163419247,
+0.718210340,
+0.287227869,
+2.00000000
124+0.177387804,
+0.933910385E-1
125+0.933910385E-1,
+0.731313169
128+0.562554359,
+0.481288493
129call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
131+0.562554359,
+0.481288463
133+0.562554359,
+0.481288493
135+0.177387789,
+0.933910534E-1
136-0.908717215E-1,
+0.731313109
138+0.177387804,
+0.933910385E-1
139+0.933910385E-1,
+0.731313169
147-0.509128571,
-0.747652173,
+0.496444225,
-0.287279725,
-0.475912571,
+0.308162808,
-0.814969063,
-0.350263119
148+0.206487060,
-0.923146367,
+0.682579160,
-0.521739125,
+0.113336325,
+0.477493882,
-0.828923702,
+0.765937567E-1
149+0.464736223,
-0.451376081,
-0.820968509,
+0.496510863,
-0.529063344,
+0.280249834,
-0.751173735,
+0.517570019
150-0.369887114,
+0.203079224,
-0.343624473,
+0.631778836,
+0.892307401,
+0.221240401,
+0.296439767,
-0.743499517
151+0.903321385,
-0.482751608,
-0.296665430E-1,
-0.298870564,
-0.477373242,
+0.822102547,
+0.997208357,
+0.548257828
152covA
= getCov(sampleA, dim)
154+0.193386510,
+0.200285286,
+0.104472041E-1,
-0.523514375E-1,
+0.472715497E-2
155+0.200285286,
+0.312808782,
+0.447795391E-1,
-0.106660515,
+0.624278039E-1
156+0.104472041E-1,
+0.447795391E-1,
+0.306514084,
-0.759007037E-1,
+0.909909308E-1
157-0.523514375E-1,
-0.106660515,
-0.759007037E-1,
+0.262940288,
-0.145262122
158+0.472715497E-2,
+0.624278039E-1,
+0.909909308E-1,
-0.145262122,
+0.355854839
161-0.297574759,
-0.896648765E-1,
-0.991893411E-1,
+0.984793156E-1,
+0.247778520
162sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
164+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
165+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
166+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
167+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
168+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
171+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
172sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
174-0.509128571,
-0.747652173,
+0.496444225,
-0.287279725,
-0.475912571,
+0.308162808,
-0.814969063,
-0.350263119,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
175+0.206487060,
-0.923146367,
+0.682579160,
-0.521739125,
+0.113336325,
+0.477493882,
-0.828923702,
+0.765937567E-1,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
176+0.464736223,
-0.451376081,
-0.820968509,
+0.496510863,
-0.529063344,
+0.280249834,
-0.751173735,
+0.517570019,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
177-0.369887114,
+0.203079224,
-0.343624473,
+0.631778836,
+0.892307401,
+0.221240401,
+0.296439767,
-0.743499517,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
178+0.903321385,
-0.482751608,
-0.296665430E-1,
-0.298870564,
-0.477373242,
+0.822102547,
+0.997208357,
+0.548257828,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
181+0.503080010,
+0.736078441,
+0.900616050,
+1.09010243,
+1.37345433
182+0.736078441,
+1.17891669,
+1.46902359,
+1.74064231,
+2.24840736
183+0.900616050,
+1.46902359,
+2.33878160,
+2.63641119,
+3.33355713
184+1.09010243,
+1.74064231,
+2.63641119,
+3.55792975,
+4.02335691
185+1.37345433,
+2.24840736,
+3.33355713,
+4.02335691,
+5.25581646
188+0.134950161,
+0.606890082,
+0.933873832,
+1.39898622,
+1.83185232
189call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
191+0.134950131,
+0.606890023,
+0.933873713,
+1.39898610,
+1.83185220
193+0.134950161,
+0.606890082,
+0.933873832,
+1.39898622,
+1.83185232
195+0.503079891,
+0.736078262,
+0.900615811,
+1.09010231,
+1.37345421
196+0.200285286,
+1.17891681,
+1.46902335,
+1.74064195,
+2.24840760
197+0.104472041E-1,
+0.447795391E-1,
+2.33878136,
+2.63641071,
+3.33355689
198-0.523514375E-1,
-0.106660515,
-0.759007037E-1,
+3.55792952,
+4.02335644
199+0.472715497E-2,
+0.624278039E-1,
+0.909909308E-1,
-0.145262122,
+5.25581646
201+0.503080010,
+0.736078441,
+0.900616050,
+1.09010243,
+1.37345433
202+0.736078441,
+1.17891669,
+1.46902359,
+1.74064231,
+2.24840736
203+0.900616050,
+1.46902359,
+2.33878160,
+2.63641119,
+3.33355713
204+1.09010243,
+1.74064231,
+2.63641119,
+3.55792975,
+4.02335691
205+1.37345433,
+2.24840736,
+3.33355713,
+4.02335691,
+5.25581646
213-0.895466089,
-0.585698366
214covA
= getCov(sampleA, dim)
220sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
226sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
228-0.895466089,
-0.585698366,
+1.00000000
235call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
251+0.979927897,
+0.283501267,
+0.497959137,
-0.546624541,
-0.591901541E-1,
-0.400028229,
+0.163236856,
+0.222964168,
+0.827435732
252+0.123116016,
-0.681290150,
-0.156124592,
-0.766030550E-1,
-0.948868513,
+0.144181252E-1,
-0.998933077,
-0.860987067,
-0.818501711
253-0.416078806,
-0.438356876,
+0.764709115,
+0.631886482,
+0.285053134,
-0.360353112,
-0.218836069,
+0.426542997,
+0.726936698
254-0.378825545,
-0.898909450,
-0.519246697,
+0.351663351,
-0.632739544,
-0.649318814,
-0.386340261,
-0.304379463,
-0.717479825
255+0.553564310,
+0.673207641,
-0.997451305,
-0.957208037,
-0.840828657,
-0.579313517,
-0.912598610,
-0.819215775E-1,
-0.675380230E-1
256covA
= getCov(sampleA, dim)
258+0.231230691,
-0.140808951E-1,
-0.167828135E-2,
-0.666000620E-1,
+0.168956071
259-0.140808951E-1,
+0.184936121,
-0.282136872E-1,
+0.469570942E-1,
+0.105281938E-1
260-0.167828135E-2,
-0.282136872E-1,
+0.233385295,
+0.563974865E-1,
-0.145378649
261-0.666000620E-1,
+0.469570942E-1,
+0.563974865E-1,
+0.113684021,
-0.860511661E-1
262+0.168956071,
+0.105281938E-1,
-0.145378649,
-0.860511661E-1,
+0.379171163
265+0.218798012,
-0.489308268,
+0.155722618,
-0.459508419,
-0.356676430
266sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
268+1.00000000,
+1.00000000
269+2.00000000,
+2.00000000
270+3.00000000,
+3.00000000
271+4.00000000,
+4.00000000
272+5.00000000,
+5.00000000
275+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
276sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
278+0.979927897,
+0.283501267,
+0.497959137,
-0.546624541,
-0.591901541E-1,
-0.400028229,
+0.163236856,
+0.222964168,
+0.827435732,
+1.00000000,
+1.00000000
279+0.123116016,
-0.681290150,
-0.156124592,
-0.766030550E-1,
-0.948868513,
+0.144181252E-1,
-0.998933077,
-0.860987067,
-0.818501711,
+2.00000000,
+2.00000000
280-0.416078806,
-0.438356876,
+0.764709115,
+0.631886482,
+0.285053134,
-0.360353112,
-0.218836069,
+0.426542997,
+0.726936698,
+3.00000000,
+3.00000000
281-0.378825545,
-0.898909450,
-0.519246697,
+0.351663351,
-0.632739544,
-0.649318814,
-0.386340261,
-0.304379463,
-0.717479825,
+4.00000000,
+4.00000000
282+0.553564310,
+0.673207641,
-0.997451305,
-0.957208037,
-0.840828657,
-0.579313517,
-0.912598610,
-0.819215775E-1,
-0.675380230E-1,
+5.00000000,
+5.00000000
285+0.279973596,
+0.277766377,
+0.329165667,
+0.463756919,
+0.760746121
286+0.277766377,
+1.07312787,
+1.03018141,
+1.68982160,
+1.99224651
287+0.329165667,
+1.03018141,
+1.39440978,
+1.93303132,
+2.14754748
288+0.463756919,
+1.68982160,
+1.93303132,
+3.05144310,
+3.48320293
289+0.760746121,
+1.99224651,
+2.14754748,
+3.48320293,
+4.57875729
292+0.360834748,
-0.367067531E-1,
+0.672863960,
+0.351311296,
+0.617264748
293call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
295+0.360834748,
-0.367067456E-1,
+0.672863960,
+0.351311326,
+0.617264748
297+0.360834748,
-0.367067531E-1,
+0.672863960,
+0.351311296,
+0.617264748
299+0.279973686,
+0.277766407,
+0.329165637,
+0.463756830,
+0.760746121
300-0.140808951E-1,
+1.07312799,
+1.03018141,
+1.68982160,
+1.99224663
301-0.167828135E-2,
-0.282136872E-1,
+1.39440978,
+1.93303120,
+2.14754748
302-0.666000620E-1,
+0.469570942E-1,
+0.563974865E-1,
+3.05144286,
+3.48320293
303+0.168956071,
+0.105281938E-1,
-0.145378649,
-0.860511661E-1,
+4.57875729
305+0.279973596,
+0.277766377,
+0.329165667,
+0.463756919,
+0.760746121
306+0.277766377,
+1.07312787,
+1.03018141,
+1.68982160,
+1.99224651
307+0.329165667,
+1.03018141,
+1.39440978,
+1.93303132,
+2.14754748
308+0.463756919,
+1.68982160,
+1.93303132,
+3.05144310,
+3.48320293
309+0.760746121,
+1.99224651,
+2.14754748,
+3.48320293,
+4.57875729
317+0.346621633,
+0.425858498
318covA
= getCov(sampleA, dim)
324sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
326+1.00000000,
+1.00000000
330sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
332+0.346621633,
+0.425858498,
+1.00000000,
+1.00000000
339call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
355-0.418892860,
-0.513078928,
-0.505785584,
+0.624679327
356-0.665685654,
-0.413586497,
+0.922899842,
-0.498944044
357+0.708398581,
+0.652399898,
-0.466067791,
-0.518586874
358covA
= getCov(sampleA, dim)
360+0.229872629,
-0.105155453,
-0.160809323
361-0.105155453,
+0.401880145,
-0.212789893
362-0.160809323,
-0.212789893,
+0.344558716
365-0.203269511,
-0.163829088,
+0.940359533E-1
366sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
368+1.00000000,
+1.00000000
369+2.00000000,
+2.00000000
370+3.00000000,
+3.00000000
373+1.00000000,
+2.00000000,
+3.00000000
374sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
376-0.418892860,
-0.513078928,
-0.505785584,
+0.624679327,
+1.00000000,
+1.00000000
377-0.665685654,
-0.413586497,
+0.922899842,
-0.498944044,
+2.00000000,
+2.00000000
378+0.708398581,
+0.652399898,
-0.466067791,
-0.518586874,
+3.00000000,
+3.00000000
381+0.474994481,
+0.508489549,
+0.669828832
382+0.508489549,
+1.30839920,
+1.25547552
383+0.669828832,
+1.25547552,
+2.10628963
386+0.197820336,
+0.557447314,
+1.06269073
387call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
389+0.197820306,
+0.557447255,
+1.06269062
391+0.197820336,
+0.557447314,
+1.06269073
393+0.474994510,
+0.508489549,
+0.669828832
394-0.105155453,
+1.30839920,
+1.25547552
395-0.160809323,
-0.212789893,
+2.10628963
397+0.474994481,
+0.508489549,
+0.669828832
398+0.508489549,
+1.30839920,
+1.25547552
399+0.669828832,
+1.25547552,
+2.10628963
407-0.410322309,
+0.839595914,
-0.880304337,
-0.461480856,
+0.671586394
408+0.377738237,
+0.386040211E-1,
+0.127860427,
+0.904667497,
+0.604162335
409-0.929768085E-1,
+0.773385763E-1,
+0.898555636,
-0.960139155,
-0.444846392
410covA
= getCov(sampleA, dim)
412+0.460121006,
-0.295905620E-1,
-0.113748327
413-0.295905620E-1,
+0.100194328,
-0.168049440
414-0.113748327,
-0.168049440,
+0.377454549
417-0.481850393E-1,
+0.410606474,
-0.104413629
418sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
420+1.00000000,
+1.00000000,
+1.00000000
421+2.00000000,
+2.00000000,
+2.00000000
422+3.00000000,
+3.00000000,
+3.00000000
425+1.00000000,
+2.00000000,
+3.00000000
426sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
428-0.410322309,
+0.839595914,
-0.880304337,
-0.461480856,
+0.671586394,
+1.00000000,
+1.00000000,
+1.00000000
429+0.377738237,
+0.386040211E-1,
+0.127860427,
+0.904667497,
+0.604162335,
+2.00000000,
+2.00000000,
+2.00000000
430-0.929768085E-1,
+0.773385763E-1,
+0.898555636,
-0.960139155,
-0.444846392,
+3.00000000,
+3.00000000,
+3.00000000
433+0.545081615,
+0.371969521,
+0.691563725
434+0.371969521,
+0.654692769,
+1.05140686
435+0.691563725,
+1.05140686,
+2.49467087
438+0.344884336,
+1.00662899,
+1.05974150
439call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
441+0.344884336,
+1.00662899,
+1.05974150
443+0.344884336,
+1.00662899,
+1.05974150
445+0.545081496,
+0.371969581,
+0.691563427
446-0.295905620E-1,
+0.654692948,
+1.05140686
447-0.113748327,
-0.168049440,
+2.49467063
449+0.545081615,
+0.371969521,
+0.691563725
450+0.371969521,
+0.654692769,
+1.05140686
451+0.691563725,
+1.05140686,
+2.49467087
459-0.728370547,
+0.108977556E-1,
+0.728019714,
+0.721251965,
+0.212120652,
+0.491022468,
+0.179573536,
-0.440232038,
+0.874706626
460-0.589933395E-1,
-0.297904015,
+0.314074039,
-0.530974507,
-0.536887407,
-0.798511028,
+0.127491117,
-0.228580236,
-0.686249256
461-0.645056844,
+0.801773071,
-0.812340856,
-0.691423297,
-0.755631924E-1,
-0.541021347,
-0.407658458,
+0.210855246,
-0.156015754
462+0.860636592,
-0.251900673,
-0.803233862,
-0.698131442,
-0.508985639,
-0.494815946,
+0.937446237,
+0.514274955,
-0.785672307
463+0.492285609,
-0.933930874,
+0.495355010,
+0.557664156,
+0.527600646,
+0.816598058,
-0.192715168,
-0.514416575,
+0.239274621
464covA
= getCov(sampleA, dim)
466+0.265737325,
-0.537110455E-1,
-0.742574036E-1,
-0.281557202,
+0.107714802
467-0.537110455E-1,
+0.125576705,
-0.337079950E-1,
+0.109284297,
-0.502351150E-1
468-0.742574036E-1,
-0.337079950E-1,
+0.237120688,
+0.240466855E-1,
-0.224479869
469-0.281557202,
+0.109284297,
+0.240466855E-1,
+0.448110253,
-0.136744186
470+0.107714802,
-0.502351150E-1,
-0.224479869,
-0.136744186,
+0.303247452
473+0.227665588,
-0.299614966,
-0.257383496,
-0.136709124,
+0.165301725
474sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
476+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
477+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
478+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
479+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
480+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
483+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
484sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
486-0.728370547,
+0.108977556E-1,
+0.728019714,
+0.721251965,
+0.212120652,
+0.491022468,
+0.179573536,
-0.440232038,
+0.874706626,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
487-0.589933395E-1,
-0.297904015,
+0.314074039,
-0.530974507,
-0.536887407,
-0.798511028,
+0.127491117,
-0.228580236,
-0.686249256,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
488-0.645056844,
+0.801773071,
-0.812340856,
-0.691423297,
-0.755631924E-1,
-0.541021347,
-0.407658458,
+0.210855246,
-0.156015754,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
489+0.860636592,
-0.251900673,
-0.803233862,
-0.698131442,
-0.508985639,
-0.494815946,
+0.937446237,
+0.514274955,
-0.785672307,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
490+0.492285609,
-0.933930874,
+0.495355010,
+0.557664156,
+0.527600646,
+0.816598058,
-0.192715168,
-0.514416575,
+0.239274621,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
493+0.307782590,
+0.373243004,
+0.529867768,
+0.552526951,
+0.926541805
494+0.373243004,
+1.29486227,
+1.69814062,
+2.25432444,
+2.52029538
495+0.529867768,
+1.69814062,
+2.58852911,
+3.10917354,
+3.47141004
496+0.552526951,
+2.25432444,
+3.10917354,
+4.21692944,
+4.50387001
497+0.926541805,
+2.52029538,
+3.47141004,
+4.50387001,
+5.56149530
500+0.503499329,
+0.521676123,
+0.905967772,
+1.34068716,
+1.89197981
501call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
503+0.503499329,
+0.521676123,
+0.905967712,
+1.34068704,
+1.89197981
505+0.503499329,
+0.521676123,
+0.905967772,
+1.34068716,
+1.89197981
507+0.307782769,
+0.373243064,
+0.529867887,
+0.552527189,
+0.926542044
508-0.537110455E-1,
+1.29486203,
+1.69814062,
+2.25432420,
+2.52029514
509-0.742574036E-1,
-0.337079950E-1,
+2.58853006,
+3.10917401,
+3.47141099
510-0.281557202,
+0.109284297,
+0.240466855E-1,
+4.21692991,
+4.50387049
511+0.107714802,
-0.502351150E-1,
-0.224479869,
-0.136744186,
+5.56149530
513+0.307782590,
+0.373243004,
+0.529867768,
+0.552526951,
+0.926541805
514+0.373243004,
+1.29486227,
+1.69814062,
+2.25432444,
+2.52029538
515+0.529867768,
+1.69814062,
+2.58852911,
+3.10917354,
+3.47141004
516+0.552526951,
+2.25432444,
+3.10917354,
+4.21692944,
+4.50387001
517+0.926541805,
+2.52029538,
+3.47141004,
+4.50387001,
+5.56149530
- 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.