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.678403735,
-0.435983777,
-0.610186219,
+0.178292394,
-0.249370694,
-0.437976122
13-0.828455687E-1,
+0.666078925,
-0.291938543,
-0.534110427,
-0.837818384E-1,
-0.969791412
14-0.149039149,
+0.745225430,
+0.421300530,
+0.795945764,
+0.681076050E-1,
-0.217056155
15+0.201816082,
-0.331631660,
+0.930408120,
+0.959064007,
-0.384520054,
-0.317964673
16+0.230368733,
-0.358304739,
-0.400052905,
-0.398969650E-1,
-0.135749340,
+0.697605252
19+0.794869959E-1,
-0.313763395E-1,
+0.597938225E-1,
+0.399414301E-1,
-0.616697967E-2
20-0.313763395E-1,
+0.248072907,
+0.875064731E-1,
-0.754146203E-1,
-0.131017536
21+0.597938225E-1,
+0.875064731E-1,
+0.163099676,
+0.104613125,
-0.110107049
22+0.399414301E-1,
-0.754146203E-1,
+0.104613125,
+0.333143502,
-0.689519942E-1
23-0.616697967E-2,
-0.131017536,
-0.110107049,
-0.689519942E-1,
+0.141360179
26-0.372271389,
-0.216064811,
+0.277414024,
+0.176195309,
-0.100499392E-2
27sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
29+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
30+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
31+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
32+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
33+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
36+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
37sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
39-0.678403735,
-0.435983777,
-0.610186219,
+0.178292394,
-0.249370694,
-0.437976122,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
40-0.828455687E-1,
+0.666078925,
-0.291938543,
-0.534110427,
-0.837818384E-1,
-0.969791412,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
41-0.149039149,
+0.745225430,
+0.421300530,
+0.795945764,
+0.681076050E-1,
-0.217056155,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
42+0.201816082,
-0.331631660,
+0.930408120,
+0.959064007,
-0.384520054,
-0.317964673,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
43+0.230368733,
-0.358304739,
-0.400052905,
-0.398969650E-1,
-0.135749340,
+0.697605252,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
46+0.510247946,
+0.736863077,
+0.958927035,
+1.32276881,
+1.69814098
47+0.736863077,
+1.35290182,
+1.54362178,
+2.05980635,
+2.67627597
48+0.958927035,
+1.54362178,
+1.92676675,
+2.63821149,
+3.31572604
49+1.32276881,
+2.05980635,
+2.63821149,
+3.80687547,
+4.70359612
50+1.69814098,
+2.67627597,
+3.31572604,
+4.70359612,
+6.27794456
53+0.251488358,
+0.791237414,
+1.51495314,
+1.91428828,
+2.27217913
54call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
56+0.510248005,
+0.736863136,
+0.958927274,
+1.32276905,
+1.69814098
57-0.313763395E-1,
+1.35290194,
+1.54362178,
+2.05980682,
+2.67627597
58+0.597938225E-1,
+0.875064731E-1,
+1.92676699,
+2.63821125,
+3.31572652
59+0.399414301E-1,
-0.754146203E-1,
+0.104613125,
+3.80687523,
+4.70359659
60-0.616697967E-2,
-0.131017536,
-0.110107049,
-0.689519942E-1,
+6.27794504
62+0.510247946,
+0.736863077,
+0.958927035,
+1.32276881,
+1.69814098
63+0.736863077,
+1.35290182,
+1.54362178,
+2.05980635,
+2.67627597
64+0.958927035,
+1.54362178,
+1.92676675,
+2.63821149,
+3.31572604
65+1.32276881,
+2.05980635,
+2.63821149,
+3.80687547,
+4.70359612
66+1.69814098,
+2.67627597,
+3.31572604,
+4.70359612,
+6.27794456
74+0.368643761,
+0.192456126,
-0.798490286,
-0.401340246,
-0.397512913E-1,
+0.830801725E-1,
+0.118317723
75-0.654027939,
-0.658138275,
-0.410542607,
+0.242659688,
-0.160286427,
+0.781846762,
-0.493915081E-1
76-0.269494534,
+0.569403529,
+0.402458549,
+0.794622183,
-0.794650793,
+0.460416913,
-0.607789993
77+0.707683206,
+0.285599470,
-0.443557262,
+0.765340328E-1,
+0.797566533,
-0.259109735E-1,
+0.397417545
80+0.137366295,
-0.191047713E-1,
-0.848977268E-1,
+0.110690445
81-0.191047713E-1,
+0.229999080,
+0.597787425E-1,
-0.550020449E-1
82-0.848977268E-1,
+0.597787425E-1,
+0.337015539,
-0.167913094
83+0.110690445,
-0.550020449E-1,
-0.167913094,
+0.159892499
86-0.681548640E-1,
-0.129697189,
+0.792808384E-1,
+0.256476104
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.368643761,
+0.192456126,
-0.798490286,
-0.401340246,
-0.397512913E-1,
+0.830801725E-1,
+0.118317723,
+1.00000000,
+1.00000000
99-0.654027939,
-0.658138275,
-0.410542607,
+0.242659688,
-0.160286427,
+0.781846762,
-0.493915081E-1,
+2.00000000,
+2.00000000
100-0.269494534,
+0.569403529,
+0.402458549,
+0.794622183,
-0.794650793,
+0.460416913,
-0.607789993,
+3.00000000,
+3.00000000
101+0.707683206,
+0.285599470,
-0.443557262,
+0.765340328E-1,
+0.797566533,
-0.259109735E-1,
+0.397417545,
+4.00000000,
+4.00000000
104+0.304042548,
+0.378324062,
+0.473189741,
+0.777219594
105+0.378324062,
+0.962820828,
+1.12159908,
+1.33519614
106+0.473189741,
+1.12159908,
+1.73654795,
+1.75919056
107+0.777219594,
+1.33519614,
+1.75919056,
+2.54652905
110+0.169212893,
+0.343568861,
+0.728329539,
+1.08837020
111call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
113+0.304042488,
+0.378323972,
+0.473189652,
+0.777219474
114-0.191047713E-1,
+0.962820649,
+1.12159896,
+1.33519590
115-0.848977268E-1,
+0.597787425E-1,
+1.73654795,
+1.75919008
116+0.110690445,
-0.550020449E-1,
-0.167913094,
+2.54652834
118+0.304042548,
+0.378324062,
+0.473189741,
+0.777219594
119+0.378324062,
+0.962820828,
+1.12159908,
+1.33519614
120+0.473189741,
+1.12159908,
+1.73654795,
+1.75919056
121+0.777219594,
+1.33519614,
+1.75919056,
+2.54652905
129-0.148767114,
-0.908918262,
-0.767965078,
+0.877235532,
+0.564850569E-1,
-0.938119769,
-0.231353998
130-0.875314116,
-0.197059751,
+0.250890970,
-0.371153355E-1,
+0.764985919,
+0.892132521,
-0.494159222
131+0.906487942,
+0.112674117,
-0.912119269,
-0.408276320,
-0.518396378,
+0.231902361,
-0.724831939
132+0.154561877,
-0.514539719,
-0.104609251,
+0.887235761,
+0.657966971,
-0.255117416E-1,
+0.427653313
133+0.254720211,
-0.483943462,
+0.927181125,
+0.269582748,
-0.283031702,
-0.156413913,
-0.975247145
134covA
= getCov(sampleA, dim)
136+0.362472266,
-0.722380280E-1,
-0.515168346E-1,
+0.243163228,
+0.215872880E-1
137-0.722380280E-1,
+0.354484916,
-0.114825733,
+0.159579441E-1,
+0.343334191E-1
138-0.515168346E-1,
-0.114825733,
+0.347835004,
-0.805198848E-1,
-0.655661337E-2
139+0.243163228,
+0.159579441E-1,
-0.805198848E-1,
+0.198449776,
-0.105737178E-1
140+0.215872880E-1,
+0.343334191E-1,
-0.655661337E-2,
-0.105737178E-1,
+0.322648436
143-0.294486254,
+0.434801430E-1,
-0.187508509,
+0.211822465,
-0.638788790E-1
144sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
146+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
147+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
148+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
149+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
150+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
153+1.00000000,
+2.00000000,
+3.00000024,
+4.00000000,
+5.00000000
154sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
156-0.148767114,
-0.908918262,
-0.767965078,
+0.877235532,
+0.564850569E-1,
-0.938119769,
-0.231353998,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
157-0.875314116,
-0.197059751,
+0.250890970,
-0.371153355E-1,
+0.764985919,
+0.892132521,
-0.494159222,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
158+0.906487942,
+0.112674117,
-0.912119269,
-0.408276320,
-0.518396378,
+0.231902361,
-0.724831939,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
159+0.154561877,
-0.514539719,
-0.104609251,
+0.887235761,
+0.657966971,
-0.255117416E-1,
+0.427653313,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
160+0.254720211,
-0.483943462,
+0.927181125,
+0.269582748,
-0.283031702,
-0.156413913,
-0.975247145,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
163+0.600159883,
+0.597052932,
+1.00578809,
+1.34751749,
+1.64957440
164+0.597052932,
+1.13423491,
+1.50169301,
+1.86089003,
+2.49406219
165+1.00578809,
+1.50169301,
+2.71397066,
+2.97845244,
+4.03201103
166+1.34751749,
+1.86089003,
+2.97845244,
+3.68679667,
+4.79043150
167+1.64957440,
+2.49406219,
+4.03201103,
+4.79043150,
+6.57204390
170+0.352756888,
+1.02174020,
+1.40624583,
+2.10591125,
+2.46806073
171call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
173+0.600159824,
+0.597053051,
+1.00578821,
+1.34751749,
+1.64957416
174-0.722380280E-1,
+1.13423491,
+1.50169325,
+1.86089003,
+2.49406147
175-0.515168346E-1,
-0.114825733,
+2.71397066,
+2.97845244,
+4.03201151
176+0.243163228,
+0.159579441E-1,
-0.805198848E-1,
+3.68679690,
+4.79043150
177+0.215872880E-1,
+0.343334191E-1,
-0.655661337E-2,
-0.105737178E-1,
+6.57204151
179+0.600159883,
+0.597052932,
+1.00578809,
+1.34751749,
+1.64957440
180+0.597052932,
+1.13423491,
+1.50169301,
+1.86089003,
+2.49406219
181+1.00578809,
+1.50169301,
+2.71397066,
+2.97845244,
+4.03201103
182+1.34751749,
+1.86089003,
+2.97845244,
+3.68679667,
+4.79043150
183+1.64957440,
+2.49406219,
+4.03201103,
+4.79043150,
+6.57204390
191-0.977409482,
+0.149205327,
-0.850092649,
+0.654974461,
-0.896157503,
+0.508450985
192+0.959184885,
-0.663272858,
+0.692103386,
+0.123913288E-1,
-0.932570219,
+0.468411088
193-0.560616016,
+0.898816586E-1,
+0.624711752,
-0.228697896,
-0.742463827,
-0.309799910E-1
194covA
= getCov(sampleA, dim)
196+0.476504564,
-0.694521293E-1,
+0.551094636E-1
197-0.694521293E-1,
+0.480049372,
+0.976455808E-1
198+0.551094636E-1,
+0.976455808E-1,
+0.199541897
201-0.235171482,
+0.893746018E-1,
-0.141360730
202sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
204+1.00000000,
+1.00000000,
+1.00000000
205+2.00000000,
+2.00000000,
+2.00000000
206+3.00000000,
+3.00000000,
+3.00000000
209+1.00000000,
+2.00000000,
+3.00000000
210sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
212-0.977409482,
+0.149205327,
-0.850092649,
+0.654974461,
-0.896157503,
+0.508450985,
+1.00000000,
+1.00000000,
+1.00000000
213+0.959184885,
-0.663272858,
+0.692103386,
+0.123913288E-1,
-0.932570219,
+0.468411088,
+2.00000000,
+2.00000000,
+2.00000000
214-0.560616016,
+0.898816586E-1,
+0.624711752,
-0.228697896,
-0.742463827,
-0.309799910E-1,
+3.00000000,
+3.00000000,
+3.00000000
217+0.656702876,
+0.478131920,
+0.898988307
218+0.478131920,
+1.13125277,
+1.39886665
219+0.898988307,
+1.39886665,
+2.32594919
222+0.176552355,
+0.726249754,
+0.905759513
223call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
225+0.656702697,
+0.478131890,
+0.898988307
226-0.694521293E-1,
+1.13125277,
+1.39886665
227+0.551094636E-1,
+0.976455808E-1,
+2.32594967
229+0.656702876,
+0.478131920,
+0.898988307
230+0.478131920,
+1.13125277,
+1.39886665
231+0.898988307,
+1.39886665,
+2.32594919
239+0.989915133E-1,
+0.492268920
240covA
= getCov(sampleA, dim)
246sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
248+1.00000000,
+1.00000000
252sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
254+0.989915133E-1,
+0.492268920,
+1.00000000,
+1.00000000
261call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
273+0.242099404,
-0.812963367,
-0.910529971,
+0.989816546,
-0.113401413E-1,
-0.980651736,
+0.998832822,
-0.259596705,
+0.375204921,
+0.836794019
274-0.737822294,
+0.188988805,
-0.430051088,
+0.675435185,
+0.879404545,
+0.226621270,
-0.194710135,
-0.499482870,
-0.113875866,
+0.503795505
275+0.213539124,
+0.156482100,
+0.290858984,
-0.960152507,
-0.389784694,
+0.554591060,
+0.600591063,
+0.854776263,
+0.639061928E-1,
-0.653483868E-1
276+0.807485938,
+0.845973253,
-0.737810373,
-0.411867023,
-0.998105884,
+0.528955460E-1,
-0.759599566,
-0.557564497,
-0.217288256,
+0.266754031
277+0.534258485,
-0.294958711,
-0.324164629E-1,
-0.608785033,
-0.474806666,
-0.626298904,
+0.311079502,
+0.144816995,
-0.394211888,
-0.271849036
278covA
= getCov(sampleA, dim)
280+0.537431896,
+0.786378756E-1,
-0.154458657,
-0.661031976E-1,
+0.393480174E-1
281+0.786378756E-1,
+0.257530600,
-0.176851779,
-0.591849796E-1,
-0.154626653
282-0.154458657,
-0.176851779,
+0.246169001,
+0.165440142E-1,
+0.100999571
283-0.661031976E-1,
-0.591849796E-1,
+0.165440142E-1,
+0.379484385,
+0.300609600E-1
284+0.393480174E-1,
-0.154626653,
+0.100999571,
+0.300609600E-1,
+0.141534612
287+0.467665792E-1,
+0.498303063E-1,
+0.131945923,
-0.170912683,
-0.171317175
288sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
290+1.00000000,
+1.00000000
291+2.00000000,
+2.00000000
292+3.00000000,
+3.00000000
293+4.00000000,
+4.00000000
294+5.00000000,
+5.00000000
297+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
298sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
300+0.242099404,
-0.812963367,
-0.910529971,
+0.989816546,
-0.113401413E-1,
-0.980651736,
+0.998832822,
-0.259596705,
+0.375204921,
+0.836794019,
+1.00000000,
+1.00000000
301-0.737822294,
+0.188988805,
-0.430051088,
+0.675435185,
+0.879404545,
+0.226621270,
-0.194710135,
-0.499482870,
-0.113875866,
+0.503795505,
+2.00000000,
+2.00000000
302+0.213539124,
+0.156482100,
+0.290858984,
-0.960152507,
-0.389784694,
+0.554591060,
+0.600591063,
+0.854776263,
+0.639061928E-1,
-0.653483868E-1,
+3.00000000,
+3.00000000
303+0.807485938,
+0.845973253,
-0.737810373,
-0.411867023,
-0.998105884,
+0.528955460E-1,
-0.759599566,
-0.557564497,
-0.217288256,
+0.266754031,
+4.00000000,
+4.00000000
304+0.534258485,
-0.294958711,
-0.324164629E-1,
-0.608785033,
-0.474806666,
-0.626298904,
+0.311079502,
+0.144816995,
-0.394211888,
-0.271849036,
+5.00000000,
+5.00000000
307+0.574061871,
+0.323721409,
+0.250996262,
+0.497115850,
+0.717438936
308+0.323721409,
+0.742825747,
+0.629455745,
+1.08039951,
+1.27183139
309+0.250996262,
+0.629455745,
+1.34760404,
+1.67523146,
+2.14411306
310+0.497115850,
+1.08039951,
+1.67523146,
+2.73241949,
+3.02076101
311+0.717438936,
+1.27183139,
+2.14411306,
+3.02076101,
+3.83218455
314+0.205638811,
+0.374858588,
+0.609954953,
+0.524239421,
+0.690569043
315call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
317+0.574061871,
+0.323721409,
+0.250996292,
+0.497115880,
+0.717438996
318+0.786378756E-1,
+0.742825806,
+0.629455805,
+1.08039975,
+1.27183139
319-0.154458657,
-0.176851779,
+1.34760404,
+1.67523170,
+2.14411330
320-0.661031976E-1,
-0.591849796E-1,
+0.165440142E-1,
+2.73241949,
+3.02076101
321+0.393480174E-1,
-0.154626653,
+0.100999571,
+0.300609600E-1,
+3.83218479
323+0.574061871,
+0.323721409,
+0.250996262,
+0.497115850,
+0.717438936
324+0.323721409,
+0.742825747,
+0.629455745,
+1.08039951,
+1.27183139
325+0.250996262,
+0.629455745,
+1.34760404,
+1.67523146,
+2.14411306
326+0.497115850,
+1.08039951,
+1.67523146,
+2.73241949,
+3.02076101
327+0.717438936,
+1.27183139,
+2.14411306,
+3.02076101,
+3.83218455
335-0.646743774E-1,
-0.895692229,
+0.928888083,
-0.936853051,
+0.883156657,
+0.473411322
336-0.341555595,
+0.536874771,
+0.981539130,
-0.429799914,
-0.968770623,
-0.545197606
337+0.222136736,
-0.429530144E-1,
+0.373711228,
+0.489082098,
-0.306901455,
+0.389834285
338-0.284952283,
+0.328786612,
-0.259376764,
+0.342698097,
+0.746292830,
-0.184359074
339covA
= getCov(sampleA, dim)
341+0.587656140,
-0.347400978E-1,
-0.410391018E-1,
-0.518041179E-1
342-0.347400978E-1,
+0.448462248,
+0.477061346E-1,
-0.110405348
343-0.410391018E-1,
+0.477061346E-1,
+0.775511041E-1,
-0.728078410E-1
344-0.518041179E-1,
-0.110405348,
-0.728078410E-1,
+0.147636205
347+0.647060722E-1,
-0.127818316,
+0.187484980,
+0.114848241
348sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
350+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
351+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
352+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
353+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
356+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000
357sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
359-0.646743774E-1,
-0.895692229,
+0.928888083,
-0.936853051,
+0.883156657,
+0.473411322,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
360-0.341555595,
+0.536874771,
+0.981539130,
-0.429799914,
-0.968770623,
-0.545197606,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
361+0.222136736,
-0.429530144E-1,
+0.373711228,
+0.489082098,
-0.306901455,
+0.389834285,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
362-0.284952283,
+0.328786612,
-0.259376764,
+0.342698097,
+0.746292830,
-0.184359074,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
365+0.562539577,
+0.456788450,
+0.606703222,
+0.841019630
366+0.456788450,
+1.35570371,
+1.46490860,
+1.91781235
367+0.606703222,
+1.46490860,
+1.94498825,
+2.57880640
368+0.841019630,
+1.91781235,
+2.57880640,
+3.71123862
371+0.438823670,
+0.723309040,
+1.31249106,
+1.66890895
372call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
374+0.562539577,
+0.456788450,
+0.606703281,
+0.841019630
375-0.347400978E-1,
+1.35570383,
+1.46490872,
+1.91781211
376-0.410391018E-1,
+0.477061346E-1,
+1.94498849,
+2.57880664
377-0.518041179E-1,
-0.110405348,
-0.728078410E-1,
+3.71123886
379+0.562539577,
+0.456788450,
+0.606703222,
+0.841019630
380+0.456788450,
+1.35570371,
+1.46490860,
+1.91781235
381+0.606703222,
+1.46490860,
+1.94498825,
+2.57880640
382+0.841019630,
+1.91781235,
+2.57880640,
+3.71123862
390+0.546100616,
+0.815762639,
+0.808750272,
-0.674964428,
+0.480329394,
+0.375563502,
+0.455841899,
+0.695978999,
-0.864295959,
-0.494003773
391+0.209347248,
-0.438059688,
+0.698264718,
+0.219759226,
-0.790010929,
+0.675023437,
+0.748577476,
+0.186113477,
+0.433472991,
+0.826915622
392-0.715224147,
-0.872349977,
+0.711754441,
-0.973014832E-1,
+0.393944860,
-0.741891026,
+0.255285025,
-0.643513203,
-0.433871269,
-0.868891239
393+0.134205818E-1,
+0.246544838,
+0.623852015,
-0.773234963,
+0.454962730,
-0.779368043,
-0.861263871,
-0.580057502,
+0.254970789,
-0.392792344
394+0.112079859,
-0.631906033,
+0.981932878,
+0.250630140,
-0.478811264,
-0.816925526,
-0.329329491,
+0.443502426,
+0.442672968,
-0.200255394
395covA
= getCov(sampleA, dim)
397+0.366820902,
-0.859026238E-1,
+0.568520129E-1,
+0.722692460E-1,
-0.442662053E-1
398-0.859026238E-1,
+0.255109966,
-0.105070015E-1,
-0.119543865,
+0.792833343E-1
399+0.568520129E-1,
-0.105070015E-1,
+0.300944299,
+0.896055251E-1,
+0.110730253
400+0.722692460E-1,
-0.119543865,
+0.896055251E-1,
+0.283851922,
+0.860655904E-1
401-0.442662053E-1,
+0.792833343E-1,
+0.110730253,
+0.860655904E-1,
+0.287159026
404+0.214506343,
+0.276940346,
-0.301205814,
-0.179296583,
-0.226409435E-1
405sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
407+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
408+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
409+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
410+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
411+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
414+1.00000000,
+2.00000000,
+3.00000000,
+4.00000000,
+5.00000000
415sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
417+0.546100616,
+0.815762639,
+0.808750272,
-0.674964428,
+0.480329394,
+0.375563502,
+0.455841899,
+0.695978999,
-0.864295959,
-0.494003773,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000,
+1.00000000
418+0.209347248,
-0.438059688,
+0.698264718,
+0.219759226,
-0.790010929,
+0.675023437,
+0.748577476,
+0.186113477,
+0.433472991,
+0.826915622,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000,
+2.00000000
419-0.715224147,
-0.872349977,
+0.711754441,
-0.973014832E-1,
+0.393944860,
-0.741891026,
+0.255285025,
-0.643513203,
-0.433871269,
-0.868891239,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000,
+3.00000000
420+0.134205818E-1,
+0.246544838,
+0.623852015,
-0.773234963,
+0.454962730,
-0.779368043,
-0.861263871,
-0.580057502,
+0.254970789,
-0.392792344,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000,
+4.00000000
421+0.112079859,
-0.631906033,
+0.981932878,
+0.250630140,
-0.478811264,
-0.816925526,
-0.329329491,
+0.443502426,
+0.442672968,
-0.200255394,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000,
+5.00000000
424+0.346886426,
+0.292213887,
+0.676395476,
+0.856465697,
+0.960283101
425+0.292213887,
+0.874446094,
+1.41257393,
+1.73238933,
+2.19931221
426+0.676395476,
+1.41257393,
+2.87533450,
+3.48678470,
+4.19198942
427+0.856465697,
+1.73238933,
+3.48678470,
+4.50393057,
+5.27853823
428+0.960283101,
+2.19931221,
+4.19198942,
+5.27853823,
+6.44039917
431+0.586582303,
+1.09312654,
+1.26252329,
+1.80037034,
+2.35650468
432call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
434+0.346886456,
+0.292213917,
+0.676395416,
+0.856465816,
+0.960283041
435-0.859026238E-1,
+0.874445975,
+1.41257453,
+1.73238957,
+2.19931221
436+0.568520129E-1,
-0.105070015E-1,
+2.87533498,
+3.48678613,
+4.19198990
437+0.722692460E-1,
-0.119543865,
+0.896055251E-1,
+4.50392962,
+5.27853727
438-0.442662053E-1,
+0.792833343E-1,
+0.110730253,
+0.860655904E-1,
+6.44039774
440+0.346886426,
+0.292213887,
+0.676395476,
+0.856465697,
+0.960283101
441+0.292213887,
+0.874446094,
+1.41257393,
+1.73238933,
+2.19931221
442+0.676395476,
+1.41257393,
+2.87533450,
+3.48678470,
+4.19198942
443+0.856465697,
+1.73238933,
+3.48678470,
+4.50393057,
+5.27853823
444+0.960283101,
+2.19931221,
+4.19198942,
+5.27853823,
+6.44039917
452-0.864516497,
+0.310994983,
-0.682423353
453-0.979835033,
-0.349213600,
+0.151518583
454covA
= getCov(sampleA, dim)
456+0.266873926,
+0.499864444E-1
457+0.499864444E-1,
+0.214264080
460-0.411981642,
-0.392510027
461sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
463+1.00000000,
+1.00000000,
+1.00000000
464+2.00000000,
+2.00000000,
+2.00000000
467+1.00000000,
+2.00000000
468sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
470-0.864516497,
+0.310994983,
-0.682423353,
+1.00000000,
+1.00000000,
+1.00000000
471-0.979835033,
-0.349213600,
+0.151518583,
+2.00000000,
+2.00000000,
+2.00000000
474+0.631859779,
+0.869538307
475+0.869538307,
+1.53815818
478+0.294009209,
+0.803744972
479call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
481+0.631859958,
+0.869538248
482+0.499864444E-1,
+1.53815806
484+0.631859779,
+0.869538307
485+0.869538307,
+1.53815818
493+0.857347250E-1,
-0.264907002
494covA
= getCov(sampleA, dim)
500sampleB
= spread([(idim, idim
= 1, ndim)], dim, nsamB)
506sample
= reshape([sampleA, sampleB], [ndim, nsamA
+ nsamB])
508+0.857347250E-1,
-0.264907002,
+1.00000000
515call setCovUpdated(covA, meanA
- meanB,
real(nsamA, TKG)
/ real(nsamA
+ nsamB, TKG), uppDia)
- 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.