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.724493146,
+0.862805367,
+0.280618668E-1,
+0.369733095,
-0.501728892,
+0.328645229,
+0.795634508
13-0.548898220,
+0.118338346,
-0.560021996,
+0.920188427,
-0.690604806,
+0.213442564,
-0.856673717E-1
14+0.574165225,
+0.832754016,
+0.238830686,
+0.662994981,
-0.692979097E-1,
-0.516011596,
-0.466838717
15+0.452611089,
+0.561205149E-1,
+0.840897679,
+0.115975618,
-0.819746137,
+0.600364923,
+0.875329733
18+0.315400332,
+0.182511583,
-0.228406377E-1,
+0.105837122
19+0.182511583,
+0.278316408,
+0.501574650E-1,
+0.293136500E-1
20-0.228406377E-1,
+0.501574650E-1,
+0.254739910,
-0.654489994E-1
21+0.105837122,
+0.293136500E-1,
-0.654489994E-1,
+0.297741622
24+0.165522575,
-0.904604420E-1,
+0.179513842,
+0.303079069
25sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
27+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
28+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
29+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
30+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
33+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000
34sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
36-0.724493146,
+0.862805367,
+0.280618668E-1,
+0.369733095,
-0.501728892,
+0.328645229,
+0.795634508,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
37-0.548898220,
+0.118338346,
-0.560021996,
+0.920188427,
-0.690604806,
+0.213442564,
-0.856673717E-1,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
38+0.574165225,
+0.832754016,
+0.238830686,
+0.662994981,
-0.692979097E-1,
-0.516011596,
-0.466838717,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
39+0.452611089,
+0.561205149E-1,
+0.840897679,
+0.115975618,
-0.819746137,
+0.600364923,
+0.875329733,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
42+0.361849010,
+0.519816339,
+0.530107141,
+0.781234443
43+0.519816339,
+1.18835557,
+1.39630854,
+1.80701363
44+0.530107141,
+1.39630854,
+2.00296640,
+2.37123680
45+0.781234443,
+1.80701363,
+2.37123680,
+3.35213614
48+0.468968928,
+0.669707000,
+1.20514512,
+1.64741397
49call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
51+0.468968928,
+0.669707000,
+1.20514524,
+1.64741397
53+0.468968928,
+0.669707000,
+1.20514512,
+1.64741397
55+0.361848742,
+0.519816279,
+0.530107141,
+0.781234503
56+0.182511583,
+1.18835592,
+1.39630866,
+1.80701351
57-0.228406377E-1,
+0.501574650E-1,
+2.00296640,
+2.37123632
58+0.105837122,
+0.293136500E-1,
-0.654489994E-1,
+3.35213542
60+0.361849010,
+0.519816339,
+0.530107141,
+0.781234443
61+0.519816339,
+1.18835557,
+1.39630854,
+1.80701363
62+0.530107141,
+1.39630854,
+2.00296640,
+2.37123680
63+0.781234443,
+1.80701363,
+2.37123680,
+3.35213614
71-0.541354060,
+0.419566035,
+0.680793524,
+0.926667452,
-0.500715017,
+0.970036745,
-0.584456444,
+0.700276732
72+0.809617043E-1,
+0.380273581,
-0.224937916,
-0.539620876,
+0.715513945,
+0.691724300,
+0.996623039,
+0.377838850
73-0.858645558,
-0.212482333,
-0.801915646,
-0.115464687,
+0.744967818,
+0.422034860,
+0.965401173,
+0.711405754
74+0.522912860,
+0.355256915,
+0.801435471,
+0.963045359,
+0.592142463,
-0.715792298,
-0.446122050,
+0.828020573E-1
75-0.460367441,
+0.607446074,
-0.645457745,
+0.789445281,
-0.641710758,
-0.351844549,
-0.921537280,
+0.131766796
78+0.409865320,
-0.148019806,
-0.660416484E-1,
+0.923618674E-2,
+0.224171653
79-0.148019806,
+0.231452376,
+0.235413015,
-0.209389985,
-0.149495393
80-0.660416484E-1,
+0.235413015,
+0.439820886,
-0.217697114,
-0.712807775E-1
81+0.923618674E-2,
-0.209389985,
-0.217697114,
+0.307175368,
+0.114255361
82+0.224171653,
-0.149495393,
-0.712807775E-1,
+0.114255361,
+0.343074262
85+0.258851886,
+0.309797078,
+0.106912673,
+0.269460112,
-0.186532453
86sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
88+1.00000000,
+1.00000000,
+1.00000000
89+2.00000000,
+2.00000000,
+2.00000000
90+3.00000000,
+3.00000000,
+3.00000000
91+4.00000000,
+4.00000000,
+4.00000000
92+5.00000000,
+5.00000000,
+5.00000000
95+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
96sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
98-0.541354060,
+0.419566035,
+0.680793524,
+0.926667452,
-0.500715017,
+0.970036745,
-0.584456444,
+0.700276732,
+1.00000000,
+1.00000000,
+1.00000000
99+0.809617043E-1,
+0.380273581,
-0.224937916,
-0.539620876,
+0.715513945,
+0.691724300,
+0.996623039,
+0.377838850,
+2.00000000,
+2.00000000,
+2.00000000
100-0.858645558,
-0.212482333,
-0.801915646,
-0.115464687,
+0.744967818,
+0.422034860,
+0.965401173,
+0.711405754,
+3.00000000,
+3.00000000,
+3.00000000
101+0.522912860,
+0.355256915,
+0.801435471,
+0.963045359,
+0.592142463,
-0.715792298,
-0.446122050,
+0.828020573E-1,
+4.00000000,
+4.00000000,
+4.00000000
102-0.460367441,
+0.607446074,
-0.645457745,
+0.789445281,
-0.641710758,
-0.351844549,
-0.921537280,
+0.131766796,
+5.00000000,
+5.00000000,
+5.00000000
105+0.407035917,
+0.140816733,
+0.377266467,
+0.555123508,
+0.925477862
106+0.140816733,
+0.734964192,
+1.14110792,
+1.09836817,
+1.63004482
107+0.377266467,
+1.14110792,
+1.98002601,
+1.98239088,
+2.92437553
108+0.555123508,
+1.09836817,
+1.98239088,
+2.98378277,
+3.92082667
109+0.925477862,
+1.63004482,
+2.92437553,
+3.92082667,
+5.58506918
112+0.460983217,
+0.770761490,
+0.895936489,
+1.28688014,
+1.22797644
113call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
115+0.460983157,
+0.770761490,
+0.895936430,
+1.28688002,
+1.22797632
117+0.460983217,
+0.770761490,
+0.895936489,
+1.28688014,
+1.22797644
119+0.407036036,
+0.140816793,
+0.377266794,
+0.555123627,
+0.925477982
120-0.148019806,
+0.734964192,
+1.14110792,
+1.09836793,
+1.63004470
121-0.660416484E-1,
+0.235413015,
+1.98002601,
+1.98239088,
+2.92437577
122+0.923618674E-2,
-0.209389985,
-0.217697114,
+2.98378253,
+3.92082667
123+0.224171653,
-0.149495393,
-0.712807775E-1,
+0.114255361,
+5.58506870
125+0.407035917,
+0.140816733,
+0.377266467,
+0.555123508,
+0.925477862
126+0.140816733,
+0.734964192,
+1.14110792,
+1.09836817,
+1.63004482
127+0.377266467,
+1.14110792,
+1.98002601,
+1.98239088,
+2.92437553
128+0.555123508,
+1.09836817,
+1.98239088,
+2.98378277,
+3.92082667
129+0.925477862,
+1.63004482,
+2.92437553,
+3.92082667,
+5.58506918
137-0.184733868E-1,
+0.307175398,
+0.402213335,
+0.220773578
138-0.233609915,
+0.995969057,
-0.790747404,
-0.717688680
139+0.841259956E-2,
+0.153938770,
-0.875600576E-1,
+0.368371487
140covA
= getCov(sampleA, dim)
142+0.243550949E-1,
+0.951104797E-3,
-0.194174796E-2
143+0.951104797E-3,
+0.511932194,
+0.971830264E-2
144-0.194174796E-2,
+0.971830264E-2,
+0.295084789E-1
147+0.227922231,
-0.186519235,
+0.110790700
148sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
150+1.00000000,
+1.00000000
151+2.00000000,
+2.00000000
152+3.00000000,
+3.00000000
155+1.00000000,
+2.00000000,
+3.00000000
156sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
158-0.184733868E-1,
+0.307175398,
+0.402213335,
+0.220773578,
+1.00000000,
+1.00000000
159-0.233609915,
+0.995969057,
-0.790747404,
-0.717688680,
+2.00000000,
+2.00000000
160+0.841259956E-2,
+0.153938770,
-0.875600576E-1,
+0.368371487,
+3.00000000,
+3.00000000
163+0.148704290,
+0.375781387,
+0.494415283
164+0.375781387,
+1.40370309,
+1.41032600
165+0.494415283,
+1.41032600,
+1.87467945
168+0.485281467,
+0.542320490,
+1.07386053
169call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
171+0.485281467,
+0.542320490,
+1.07386041
173+0.485281467,
+0.542320490,
+1.07386053
175+0.148704320,
+0.375781357,
+0.494415343
176+0.951104797E-3,
+1.40370274,
+1.41032577
177-0.194174796E-2,
+0.971830264E-2,
+1.87467897
179+0.148704290,
+0.375781387,
+0.494415283
180+0.375781387,
+1.40370309,
+1.41032600
181+0.494415283,
+1.41032600,
+1.87467945
189+0.178900599,
-0.138574839
190covA
= getCov(sampleA, dim)
196sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
198+1.00000000,
+1.00000000
202sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
204+0.178900599,
-0.138574839,
+1.00000000,
+1.00000000
211call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
227-0.242768884,
-0.332967758
228covA
= getCov(sampleA, dim)
234sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
236+1.00000000,
+1.00000000
240sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
242-0.242768884,
-0.332967758,
+1.00000000,
+1.00000000
249call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
265-0.985509992,
+0.418117881,
+0.898956418,
-0.158331871,
-0.125674844,
-0.941638589
266-0.135289431E-1,
-0.975535393,
+0.110741377,
-0.305778027,
+0.788400888,
+0.811418533
267-0.274427295,
+0.295702815,
+0.839575291,
-0.233001947,
-0.254423618,
-0.376750946
268+0.581861615,
+0.278476119,
+0.826095939,
+0.642797232,
-0.434192777,
+0.879514217
269covA
= getCov(sampleA, dim)
271+0.458081901,
-0.174631238,
+0.261994123,
-0.293862130E-1
272-0.174631238,
+0.384798110,
-0.104432218,
-0.342513546E-1
273+0.261994123,
-0.104432218,
+0.188099623,
+0.411855355E-1
274-0.293862130E-1,
-0.342513546E-1,
+0.411855355E-1,
+0.198463306
277-0.149013504,
+0.692864060E-1,
-0.554283499E-3,
+0.462425411
278sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
280+1.00000000,
+1.00000000
281+2.00000000,
+2.00000000
282+3.00000000,
+3.00000000
283+4.00000000,
+4.00000000
286+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000
287sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
289-0.985509992,
+0.418117881,
+0.898956418,
-0.158331871,
-0.125674844,
-0.941638589,
+1.00000000,
+1.00000000
290-0.135289431E-1,
-0.975535393,
+0.110741377,
-0.305778027,
+0.788400888,
+0.811418533,
+2.00000000,
+2.00000000
291-0.274427295,
+0.295702815,
+0.839575291,
-0.233001947,
-0.254423618,
-0.376750946,
+3.00000000,
+3.00000000
292+0.581861615,
+0.278476119,
+0.826095939,
+0.642797232,
-0.434192777,
+0.879514217,
+4.00000000,
+4.00000000
295+0.591105103,
+0.284979582,
+0.842935205,
+0.740095496
296+0.284979582,
+0.987533927,
+1.00790286,
+1.25494456
297+0.842935205,
+1.00790286,
+1.82919848,
+2.02114296
298+0.740095496,
+1.25494456,
+2.02114296,
+2.49530411
301+0.138239875,
+0.551964819,
+0.749584317,
+1.34681904
302call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
304+0.138239875,
+0.551964819,
+0.749584258,
+1.34681904
306+0.138239875,
+0.551964819,
+0.749584317,
+1.34681904
308+0.591104925,
+0.284979582,
+0.842935145,
+0.740095556
309-0.174631238,
+0.987533927,
+1.00790286,
+1.25494456
310+0.261994123,
-0.104432218,
+1.82919836,
+2.02114248
311-0.293862130E-1,
-0.342513546E-1,
+0.411855355E-1,
+2.49530387
313+0.591105103,
+0.284979582,
+0.842935205,
+0.740095496
314+0.284979582,
+0.987533927,
+1.00790286,
+1.25494456
315+0.842935205,
+1.00790286,
+1.82919848,
+2.02114296
316+0.740095496,
+1.25494456,
+2.02114296,
+2.49530411
324-0.553773165,
-0.192247510
325covA
= getCov(sampleA, dim)
331sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
337sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
339-0.553773165,
-0.192247510,
+1.00000000
346call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
362+0.995398641,
+0.349297881,
+0.108977675
363-0.540418625,
-0.535397530,
-0.226763487E-1
364covA
= getCov(sampleA, dim)
366+0.140104651,
-0.650443360E-1
367-0.650443360E-1,
+0.589961484E-1
370+0.484558076,
-0.366164178
371sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
373+1.00000000,
+1.00000000
374+2.00000000,
+2.00000000
377+1.00000000,
+2.00000000
378sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
380+0.995398641,
+0.349297881,
+0.108977675,
+1.00000000,
+1.00000000
381-0.540418625,
-0.535397530,
-0.226763487E-1,
+2.00000000,
+2.00000000
384+0.147826120,
+0.253682226
385+0.253682226,
+1.37909341
388+0.690734863,
+0.580301464
389call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
391+0.690734863,
+0.580301404
393+0.690734863,
+0.580301464
395+0.147826076,
+0.253682196
396-0.650443360E-1,
+1.37909353
398+0.147826120,
+0.253682226
399+0.253682226,
+1.37909341
407-0.386622190,
-0.219056726,
-0.277997851,
+0.398256302,
-0.695959330E-1,
-0.429108620,
-0.244629979,
+0.299552083,
+0.569471359,
-0.212445974
408+0.581753969,
-0.300965667,
-0.131580114,
-0.969779491E-2,
+0.959468484,
-0.142873168,
+0.926055193,
+0.746746063E-1,
-0.585629821,
+0.263986111
409-0.561352372,
-0.569215298,
+0.965556860,
+0.999942899,
+0.131845474E-3,
-0.823703647,
+0.388041854,
+0.790804863,
+0.562757969,
+0.683697701
410-0.625701904,
-0.511930585,
-0.749570489,
-0.787944913,
-0.747785211,
+0.928250551,
+0.204727173,
+0.281444788E-1,
-0.268698573,
+0.819108486
411+0.105562210E-1,
+0.352396727,
+0.780585408,
-0.182500601,
+0.202603698,
-0.715684056,
-0.835976243,
+0.744940758,
+0.966921568,
+0.204016805
412covA
= getCov(sampleA, dim)
414+0.110859863,
-0.631932840E-1,
+0.128158838,
-0.564257018E-1,
+0.944412276E-1
415-0.631932840E-1,
+0.239583775,
-0.303308964E-1,
-0.108631132E-1,
-0.138498098
416+0.128158838,
-0.303308964E-1,
+0.421615213,
-0.706196055E-1,
+0.153028190
417-0.564257018E-1,
-0.108631132E-1,
-0.706196055E-1,
+0.375007421,
-0.142555088
418+0.944412276E-1,
-0.138498098,
+0.153028190,
-0.142555088,
+0.331708431
421-0.572177544E-1,
+0.163519189,
+0.243666276,
-0.171140105,
+0.152786031
422sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
424+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
425+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
426+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
427+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
428+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
431+1.00000000,
+2.00000000,
+3.00000024,
+4.00000000,
+5.00000000
432sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
434-0.386622190,
-0.219056726,
-0.277997851,
+0.398256302,
-0.695959330E-1,
-0.429108620,
-0.244629979,
+0.299552083,
+0.569471359,
-0.212445974,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
435+0.581753969,
-0.300965667,
-0.131580114,
-0.969779491E-2,
+0.959468484,
-0.142873168,
+0.926055193,
+0.746746063E-1,
-0.585629821,
+0.263986111,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
436-0.561352372,
-0.569215298,
+0.965556860,
+0.999942899,
+0.131845474E-3,
-0.823703647,
+0.388041854,
+0.790804863,
+0.562757969,
+0.683697701,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
437-0.625701904,
-0.511930585,
-0.749570489,
-0.787944913,
-0.747785211,
+0.928250551,
+0.204727173,
+0.281444788E-1,
-0.268698573,
+0.819108486,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
438+0.105562210E-1,
+0.352396727,
+0.780585408,
-0.182500601,
+0.202603698,
-0.715684056,
-0.835976243,
+0.744940758,
+0.966921568,
+0.204016805,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
441+0.335937053,
+0.433101594,
+0.781211734,
+1.03492677,
+1.29679608
442+0.433101594,
+0.957839429,
+1.20823705,
+1.84902620,
+2.07467961
443+0.781211734,
+1.20823705,
+2.08820391,
+2.74321342,
+3.32613277
444+1.03492677,
+1.84902620,
+2.74321342,
+4.43474054,
+4.81333637
445+1.29679608,
+2.07467961,
+3.32613277,
+4.81333637,
+5.88606834
448+0.378107220,
+0.919717193,
+1.37862718,
+1.54638815,
+2.14869785
449call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
451+0.378107190,
+0.919717133,
+1.37862718,
+1.54638803,
+2.14869738
453+0.378107220,
+0.919717193,
+1.37862718,
+1.54638815,
+2.14869785
455+0.335937113,
+0.433101565,
+0.781211674,
+1.03492689,
+1.29679668
456-0.631932840E-1,
+0.957839370,
+1.20823729,
+1.84902620,
+2.07467937
457+0.128158838,
-0.303308964E-1,
+2.08820415,
+2.74321318,
+3.32613373
458-0.564257018E-1,
-0.108631132E-1,
-0.706196055E-1,
+4.43474054,
+4.81333637
459+0.944412276E-1,
-0.138498098,
+0.153028190,
-0.142555088,
+5.88606977
461+0.335937053,
+0.433101594,
+0.781211734,
+1.03492677,
+1.29679608
462+0.433101594,
+0.957839429,
+1.20823705,
+1.84902620,
+2.07467961
463+0.781211734,
+1.20823705,
+2.08820391,
+2.74321342,
+3.32613277
464+1.03492677,
+1.84902620,
+2.74321342,
+4.43474054,
+4.81333637
465+1.29679608,
+2.07467961,
+3.32613277,
+4.81333637,
+5.88606834
473-0.416366339,
-0.981516719,
+0.352468729,
+0.313314080
474-0.747122169,
+0.351686478,
+0.366575718,
+0.905455470
475covA
= getCov(sampleA, dim)
477+0.306285799,
+0.134806946
478+0.134806946,
+0.360999346
481-0.183025062,
+0.219148874
482sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
488+1.00000000,
+2.00000000
489sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
491-0.416366339,
-0.981516719,
+0.352468729,
+0.313314080,
+1.00000000
492-0.747122169,
+0.351686478,
+0.366575718,
+0.905455470,
+2.00000000
495+0.468956381,
+0.444932222
496+0.444932222,
+0.796228409
499+0.535799526E-1,
+0.575319111
500call setCovMeanUpdated(covA, meanA, meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
502+0.535799414E-1,
+0.575319052
504+0.535799526E-1,
+0.575319111
506+0.468956381,
+0.444932222
507+0.134806946,
+0.796228409
509+0.468956381,
+0.444932222
510+0.444932222,
+0.796228409
- 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 at Austin
Definition at line 8922 of file pm_sampleCov.F90.