20 integer(IK) :: itry, ntry
= 10
21 type(display_type) :: disp
22 character(:),
allocatable :: format
26 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
28 call disp%show(
"!Convert correlation matrix and standard deviation to covariance matrix.")
29 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
30 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
38 real(TKG),
allocatable :: cov(:,:), cor(:,:), std(:)
39 format = getFormat(mold
= [
0._TKG], ed
= SK_
"es", signed
= .true._LK)
42 call disp%show(
"ndim = getUnifRand(1, 7)")
46 call disp%show(
"std = getUnifRand(1, 10, ndim)")
49 call disp%show( std ,
format = format )
50 call disp%show(
"call setResized(cov, [ndim, ndim])")
52 call disp%show(
"cor = getCovRand(1., ndim)")
55 call disp%show( cor ,
format = format )
56 call disp%show(
"cov = getCov(cor, uppDia, std) ! convert upper correlation matrix to full covariance matrix.")
57 cov
= getCov(cor, uppDia, std)
59 call disp%show( cov ,
format = format )
60 call disp%show(
"cov = getCov(cor, lowDia, std) ! convert upper correlation matrix to full covariance matrix.")
61 cov
= getCov(cor, lowDia, std)
63 call disp%show( cov ,
format = format )
64 call disp%show(
"getCor(getCov(cor, lowDia, std), lowDia) ! reconstruct the original correlation matrix.")
71 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
72 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
73 call disp%show(
"!Compute the covariance matrix of a 2-D sample.")
74 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
75 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
80 real(TKG),
allocatable :: sample(:,:), cov(:,:), mean(:)
81 integer(IK) :: ndim, nsam
82 call disp%show(
"ndim = 2; nsam = 10")
84 call disp%show(
"sample = reshape(getUnifRand(1, 20, ndim * nsam), shape = [ndim, nsam], order = [2, 1])")
85 sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
89 call disp%show(
"Compute the sample covariance along the second dimension.", deliml
= SK_
'''')
91 call disp%show(
"cov = getCov(sample, dim = 2_IK)")
92 cov
= getCov(sample,
dim = 2_IK)
96 call disp%show(
"Compute the sample covariance along the first dimension.", deliml
= SK_
'''')
98 call disp%show(
"cov = getCov(transpose(sample), dim = 1_IK)")
99 cov
= getCov(
transpose(sample),
dim = 1_IK)
103 call disp%show(
"Compute the full sample covariance for a pair of time series.", deliml
= SK_
'''')
105 call disp%show(
"cov = getCov(sample(1,:), sample(2,:))")
106 cov
= getCov(sample(
1,:), sample(
2,:))
114 complex(TKG),
allocatable :: sample(:,:), cov(:,:), mean(:)
115 integer(IK) :: ndim, nsam
116 call disp%show(
"ndim = 2; nsam = 10")
118 call disp%show(
"sample = reshape(cmplx(getUnifRand(1, 20, ndim * nsam), -getUnifRand(1, 20, ndim * nsam), TKG), shape = [ndim, nsam], order = [2, 1])")
119 sample
= reshape(
cmplx(
getUnifRand(
1,
20, ndim
* nsam),
-getUnifRand(
1,
20, ndim
* nsam), TKG), shape
= [ndim, nsam], order
= [
2,
1])
123 call disp%show(
"Compute the sample covariance along the second dimension.", deliml
= SK_
'''')
125 call disp%show(
"cov = getCov(sample, dim = 2_IK)")
126 cov
= getCov(sample,
dim = 2_IK)
130 call disp%show(
"Compute the sample covariance along the first dimension.", deliml
= SK_
'''')
132 call disp%show(
"cov = getCov(transpose(sample), dim = 1_IK)")
133 cov
= getCov(
transpose(sample),
dim = 1_IK)
137 call disp%show(
"Compute the full sample covariance for a pair of time series.", deliml
= SK_
'''')
139 call disp%show(
"cov = getCov(sample(1,:), sample(2,:))")
140 cov
= getCov(sample(
1,:), sample(
2,:))
147 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
148 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
149 call disp%show(
"!Compute the biased covariance matrix of a weighted 2-D sample.")
150 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
151 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
157 integer(IK) :: iweisum
158 real(TKG),
allocatable :: rweight(:)
159 integer(IK),
allocatable :: iweight(:)
160 real(TKG),
allocatable :: sample(:,:), cov(:,:), mean(:)
161 integer(IK) :: ndim, nsam
162 call disp%show(
"ndim = 2; nsam = 10")
164 call disp%show(
"sample = reshape(getUnifRand(1, 20, ndim * nsam), shape = [ndim, nsam], order = [2, 1])")
165 sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
168 call disp%show(
"call setResized(mean, ndim)")
170 call disp%show(
"iweight = getUnifRand(1, 10, nsam) ! integer-valued weights.")
174 call disp%show(
"call setMean(mean, sample, 2_IK, iweight, iweisum)")
175 call setMean(mean, sample,
2_IK, iweight, iweisum)
180 call disp%show(
"rweight = iweight ! or real-valued weights.")
184 call disp%show(
"call setMean(mean, sample, 2_IK, rweight, rweisum)")
185 call setMean(mean, sample,
2_IK, rweight, rweisum)
192 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
193 call disp%show(
"!Compute the covariance matrix with integer weights.")
194 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
197 call disp%show(
"cov = getCov(sample, 2_IK, iweight)")
198 cov
= getCov(sample,
2_IK, iweight)
202 call disp%show(
"Compute the sample covariance along the first dimension.", deliml
= SK_
'''')
204 call disp%show(
"cov = getCov(transpose(sample), 1_IK, iweight)")
205 cov
= getCov(
transpose(sample),
1_IK, iweight)
209 call disp%show(
"Compute the full sample covariance for a pair of time series.", deliml
= SK_
'''')
211 call disp%show(
"cov = getCov(sample(1,:), sample(2,:), weight = iweight)")
212 cov
= getCov(sample(
1,:), sample(
2,:), weight
= iweight)
218 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
219 call disp%show(
"!Compute the covariance matrix with real weights.")
220 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
223 call disp%show(
"cov = getCov(sample, 2_IK, rweight)")
224 cov
= getCov(sample,
2_IK, rweight)
228 call disp%show(
"Compute the sample covariance along the first dimension.", deliml
= SK_
'''')
230 call disp%show(
"cov = getCov(transpose(sample), 1_IK, rweight)")
231 cov
= getCov(
transpose(sample),
1_IK, rweight)
235 call disp%show(
"Compute the full sample covariance for a pair of time series.", deliml
= SK_
'''')
237 call disp%show(
"cov = getCov(sample(1,:), sample(2,:), weight = rweight)")
238 cov
= getCov(sample(
1,:), sample(
2,:), weight
= rweight)
247 integer(IK) :: iweisum
248 real(TKG),
allocatable :: rweight(:)
249 integer(IK),
allocatable :: iweight(:)
250 complex(TKG),
allocatable :: sample(:,:), cov(:,:), mean(:)
251 integer(IK) :: ndim, nsam
252 call disp%show(
"ndim = 2; nsam = 10")
254 call disp%show(
"sample = reshape(cmplx(getUnifRand(1, 20, ndim * nsam), -getUnifRand(1, 20, ndim * nsam), TKG), shape = [ndim, nsam], order = [2, 1])")
255 sample
= reshape(
cmplx(
getUnifRand(
1,
20, ndim
* nsam),
-getUnifRand(
1,
20, ndim
* nsam), TKG), shape
= [ndim, nsam], order
= [
2,
1])
258 call disp%show(
"call setResized(mean, ndim)")
260 call disp%show(
"iweight = getUnifRand(1, 10, nsam) ! integer-valued weights.")
264 call disp%show(
"call setMean(mean, sample, 2_IK, iweight, iweisum)")
265 call setMean(mean, sample,
2_IK, iweight, iweisum)
270 call disp%show(
"rweight = iweight ! or real-valued weights.")
274 call disp%show(
"call setMean(mean, sample, 2_IK, rweight, rweisum)")
275 call setMean(mean, sample,
2_IK, rweight, rweisum)
282 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
283 call disp%show(
"!Compute the covariance matrix with integer weights.")
284 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
287 call disp%show(
"cov = getCov(sample, 2_IK, iweight)")
288 cov
= getCov(sample,
2_IK, iweight)
292 call disp%show(
"Compute the sample covariance along the first dimension.", deliml
= SK_
'''')
294 call disp%show(
"cov = getCov(transpose(sample), 1_IK, iweight)")
295 cov
= getCov(
transpose(sample),
1_IK, iweight)
299 call disp%show(
"Compute the full sample covariance for a pair of time series.", deliml
= SK_
'''')
301 call disp%show(
"cov = getCov(sample(1,:), sample(2,:), weight = iweight)")
302 cov
= getCov(sample(
1,:), sample(
2,:), weight
= iweight)
308 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
309 call disp%show(
"!Compute the covariance matrix with real weights.")
310 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
313 call disp%show(
"cov = getCov(sample, 2_IK, rweight)")
314 cov
= getCov(sample,
2_IK, rweight)
318 call disp%show(
"Compute the sample covariance along the first dimension.", deliml
= SK_
'''')
320 call disp%show(
"cov = getCov(transpose(sample), 1_IK, rweight)")
321 cov
= getCov(
transpose(sample),
1_IK, rweight)
325 call disp%show(
"Compute the full sample covariance for a pair of time series.", deliml
= SK_
'''')
327 call disp%show(
"cov = getCov(sample(1,:), sample(2,:), weight = rweight)")
328 cov
= getCov(sample(
1,:), sample(
2,:), weight
= rweight)
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
Allocate or resize (shrink or expand) an input allocatable scalar string or array of rank 1....
Generate count evenly spaced points over the interval [x1, x2] if x1 < x2, or [x2,...
Generate and return a random positive-definite (correlation or covariance) matrix using the Gram meth...
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.
Copy a desired subset of the input source matrix of arbitrary shape (:) or (:,:) to the target subset...
Generate and return the (Pearson) correlation coefficient or matrix of a pair of (weighted) time seri...
Generate and return the (weighted) mean of an input sample of nsam observations with ndim = 1 or 2 at...
Return the (weighted) mean of a pair of time series or of an input sample of nsam observations with n...
Generate a sample of shape (nsam), or (ndim, nsam) or (nsam, ndim) that is shifted by the specified i...
This module contains procedures and generic interfaces for convenient allocation and filling of array...
This module contains procedures and generic interfaces for resizing allocatable arrays of various typ...
This module contains procedures and generic interfaces for generating arrays with linear or logarithm...
This module contains classes and procedures for generating random matrices distributed on the space o...
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 LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
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 procedures and generic interfaces relevant to copying (diagonal or upper/lower t...
This module contains classes and procedures for computing properties related to the correlation matri...
This module contains classes and procedures for computing the first moment (i.e., the statistical mea...
This module contains classes and procedures for shifting univariate or multivariate samples by arbitr...
Generate and return an object of type display_type.
19cov
= getCov(cor, uppDia, std)
22cov
= getCov(cor, lowDia, std)
34+8.000000E+00,
+5.000000E+00,
+8.000000E+00,
+8.000000E+00,
+7.000000E+00
38+1.000000E+00,
-9.370748E-01,
+8.963406E-01,
+2.980443E-01,
+5.642448E-01
39-9.370748E-01,
+1.000000E+00,
-9.789037E-01,
-5.025175E-01,
-3.917778E-01
40+8.963406E-01,
-9.789037E-01,
+1.000000E+00,
+6.118757E-01,
+3.180515E-01
41+2.980443E-01,
-5.025175E-01,
+6.118757E-01,
+1.000000E+00,
+4.018869E-02
42+5.642448E-01,
-3.917778E-01,
+3.180515E-01,
+4.018869E-02,
+1.000000E+00
43cov
= getCov(cor, uppDia, std)
45+6.400000E+01,
-3.748299E+01,
+5.736580E+01,
+1.907484E+01,
+3.159771E+01
46-3.748299E+01,
+2.500000E+01,
-3.915615E+01,
-2.010070E+01,
-1.371222E+01
47+5.736580E+01,
-3.915615E+01,
+6.400000E+01,
+3.916005E+01,
+1.781088E+01
48+1.907484E+01,
-2.010070E+01,
+3.916005E+01,
+6.400000E+01,
+2.250566E+00
49+3.159771E+01,
-1.371222E+01,
+1.781088E+01,
+2.250566E+00,
+4.900000E+01
50cov
= getCov(cor, lowDia, std)
52+6.400000E+01,
-3.748299E+01,
+5.736580E+01,
+1.907484E+01,
+3.159771E+01
53-3.748299E+01,
+2.500000E+01,
-3.915615E+01,
-2.010070E+01,
-1.371222E+01
54+5.736580E+01,
-3.915615E+01,
+6.400000E+01,
+3.916005E+01,
+1.781088E+01
55+1.907484E+01,
-2.010070E+01,
+3.916005E+01,
+6.400000E+01,
+2.250566E+00
56+3.159771E+01,
-1.371222E+01,
+1.781088E+01,
+2.250566E+00,
+4.900000E+01
58+1.000000E+00,
-9.370748E-01,
+8.963406E-01,
+2.980443E-01,
+5.642449E-01
59-9.370748E-01,
+1.000000E+00,
-9.789037E-01,
-5.025175E-01,
-3.917778E-01
60+8.963406E-01,
-9.789037E-01,
+1.000000E+00,
+6.118757E-01,
+3.180515E-01
61+2.980443E-01,
-5.025175E-01,
+6.118757E-01,
+1.000000E+00,
+4.018869E-02
62+5.642449E-01,
-3.917778E-01,
+3.180515E-01,
+4.018869E-02,
+1.000000E+00
70+6.000000E+00,
+5.000000E+00,
+6.000000E+00,
+5.000000E+00,
+2.000000E+00,
+5.000000E+00
74+1.000000E+00,
+7.692201E-01,
+5.479082E-01,
-3.191917E-01,
+1.859854E-01,
+6.699873E-01
75+7.692201E-01,
+1.000000E+00,
+8.324206E-02,
+9.449770E-02,
-2.210099E-01,
+7.964961E-01
76+5.479082E-01,
+8.324206E-02,
+1.000000E+00,
-2.154084E-01,
+6.956096E-01,
-1.365258E-01
77-3.191917E-01,
+9.449770E-02,
-2.154084E-01,
+1.000000E+00,
-4.653472E-01,
-7.786135E-02
78+1.859854E-01,
-2.210099E-01,
+6.956096E-01,
-4.653472E-01,
+1.000000E+00,
-1.932095E-01
79+6.699873E-01,
+7.964961E-01,
-1.365258E-01,
-7.786135E-02,
-1.932095E-01,
+1.000000E+00
80cov
= getCov(cor, uppDia, std)
82+3.600000E+01,
+2.307660E+01,
+1.972470E+01,
-9.575750E+00,
+2.231825E+00,
+2.009962E+01
83+2.307660E+01,
+2.500000E+01,
+2.497262E+00,
+2.362442E+00,
-2.210099E+00,
+1.991240E+01
84+1.972470E+01,
+2.497262E+00,
+3.600000E+01,
-6.462253E+00,
+8.347315E+00,
-4.095774E+00
85-9.575750E+00,
+2.362442E+00,
-6.462253E+00,
+2.500000E+01,
-4.653472E+00,
-1.946534E+00
86+2.231825E+00,
-2.210099E+00,
+8.347315E+00,
-4.653472E+00,
+4.000000E+00,
-1.932095E+00
87+2.009962E+01,
+1.991240E+01,
-4.095774E+00,
-1.946534E+00,
-1.932095E+00,
+2.500000E+01
88cov
= getCov(cor, lowDia, std)
90+3.600000E+01,
+2.307660E+01,
+1.972470E+01,
-9.575750E+00,
+2.231825E+00,
+2.009962E+01
91+2.307660E+01,
+2.500000E+01,
+2.497262E+00,
+2.362442E+00,
-2.210099E+00,
+1.991240E+01
92+1.972470E+01,
+2.497262E+00,
+3.600000E+01,
-6.462253E+00,
+8.347315E+00,
-4.095774E+00
93-9.575750E+00,
+2.362442E+00,
-6.462253E+00,
+2.500000E+01,
-4.653472E+00,
-1.946534E+00
94+2.231825E+00,
-2.210099E+00,
+8.347315E+00,
-4.653472E+00,
+4.000000E+00,
-1.932095E+00
95+2.009962E+01,
+1.991240E+01,
-4.095774E+00,
-1.946534E+00,
-1.932095E+00,
+2.500000E+01
97+1.000000E+00,
+7.692201E-01,
+5.479083E-01,
-3.191917E-01,
+1.859854E-01,
+6.699873E-01
98+7.692201E-01,
+1.000000E+00,
+8.324207E-02,
+9.449770E-02,
-2.210099E-01,
+7.964962E-01
99+5.479083E-01,
+8.324207E-02,
+1.000000E+00,
-2.154084E-01,
+6.956096E-01,
-1.365258E-01
100-3.191917E-01,
+9.449770E-02,
-2.154084E-01,
+1.000000E+00,
-4.653473E-01,
-7.786135E-02
101+1.859854E-01,
-2.210099E-01,
+6.956096E-01,
-4.653473E-01,
+1.000000E+00,
-1.932095E-01
102+6.699873E-01,
+7.964962E-01,
-1.365258E-01,
-7.786135E-02,
-1.932095E-01,
+1.000000E+00
110+1.000000E+01,
+2.000000E+00,
+2.000000E+00,
+6.000000E+00,
+2.000000E+00
114+1.000000E+00,
+2.443270E-03,
-8.852635E-01,
-1.088063E-01,
+2.729474E-01
115+2.443270E-03,
+1.000000E+00,
+3.190553E-01,
-9.789006E-01,
-5.788258E-01
116-8.852635E-01,
+3.190553E-01,
+1.000000E+00,
-1.799237E-01,
-3.007606E-01
117-1.088063E-01,
-9.789006E-01,
-1.799237E-01,
+1.000000E+00,
+6.657165E-01
118+2.729474E-01,
-5.788258E-01,
-3.007606E-01,
+6.657165E-01,
+1.000000E+00
119cov
= getCov(cor, uppDia, std)
121+1.000000E+02,
+4.886541E-02,
-1.770527E+01,
-6.528380E+00,
+5.458947E+00
122+4.886541E-02,
+4.000000E+00,
+1.276221E+00,
-1.174681E+01,
-2.315303E+00
123-1.770527E+01,
+1.276221E+00,
+4.000000E+00,
-2.159085E+00,
-1.203043E+00
124-6.528380E+00,
-1.174681E+01,
-2.159085E+00,
+3.600000E+01,
+7.988598E+00
125+5.458947E+00,
-2.315303E+00,
-1.203043E+00,
+7.988598E+00,
+4.000000E+00
126cov
= getCov(cor, lowDia, std)
128+1.000000E+02,
+4.886541E-02,
-1.770527E+01,
-6.528380E+00,
+5.458947E+00
129+4.886541E-02,
+4.000000E+00,
+1.276221E+00,
-1.174681E+01,
-2.315303E+00
130-1.770527E+01,
+1.276221E+00,
+4.000000E+00,
-2.159085E+00,
-1.203043E+00
131-6.528380E+00,
-1.174681E+01,
-2.159085E+00,
+3.600000E+01,
+7.988598E+00
132+5.458947E+00,
-2.315303E+00,
-1.203043E+00,
+7.988598E+00,
+4.000000E+00
134+1.000000E+00,
+2.443271E-03,
-8.852636E-01,
-1.088063E-01,
+2.729474E-01
135+2.443271E-03,
+1.000000E+00,
+3.190553E-01,
-9.789006E-01,
-5.788258E-01
136-8.852636E-01,
+3.190553E-01,
+1.000000E+00,
-1.799237E-01,
-3.007606E-01
137-1.088063E-01,
-9.789006E-01,
-1.799237E-01,
+1.000000E+00,
+6.657165E-01
138+2.729474E-01,
-5.788258E-01,
-3.007606E-01,
+6.657165E-01,
+1.000000E+00
146+9.000000E+00,
+7.000000E+00
150+1.000000E+00,
+5.869347E-01
151+5.869347E-01,
+1.000000E+00
152cov
= getCov(cor, uppDia, std)
154+8.100000E+01,
+3.697689E+01
155+3.697689E+01,
+4.900000E+01
156cov
= getCov(cor, lowDia, std)
158+8.100000E+01,
+3.697689E+01
159+3.697689E+01,
+4.900000E+01
161+1.000000E+00,
+5.869348E-01
162+5.869348E-01,
+1.000000E+00
170+2.000000E+00,
+9.000000E+00,
+1.000000E+00,
+2.000000E+00,
+2.000000E+00,
+5.000000E+00
174+1.000000E+00,
-5.708815E-01,
+7.001553E-01,
-5.786425E-01,
-5.864874E-01,
+7.140691E-01
175-5.708815E-01,
+1.000000E+00,
-7.327796E-01,
-1.113626E-01,
+5.871239E-01,
-4.990965E-01
176+7.001553E-01,
-7.327796E-01,
+1.000000E+00,
-2.631226E-01,
-3.553498E-01,
+6.805356E-01
177-5.786425E-01,
-1.113626E-01,
-2.631226E-01,
+1.000000E+00,
-1.560526E-01,
-7.037156E-01
178-5.864874E-01,
+5.871239E-01,
-3.553498E-01,
-1.560526E-01,
+1.000000E+00,
+5.629885E-02
179+7.140691E-01,
-4.990965E-01,
+6.805356E-01,
-7.037156E-01,
+5.629885E-02,
+1.000000E+00
180cov
= getCov(cor, uppDia, std)
182+4.000000E+00,
-1.027587E+01,
+1.400311E+00,
-2.314570E+00,
-2.345950E+00,
+7.140691E+00
183-1.027587E+01,
+8.100000E+01,
-6.595016E+00,
-2.004526E+00,
+1.056823E+01,
-2.245934E+01
184+1.400311E+00,
-6.595016E+00,
+1.000000E+00,
-5.262451E-01,
-7.106996E-01,
+3.402678E+00
185-2.314570E+00,
-2.004526E+00,
-5.262451E-01,
+4.000000E+00,
-6.242104E-01,
-7.037156E+00
186-2.345950E+00,
+1.056823E+01,
-7.106996E-01,
-6.242104E-01,
+4.000000E+00,
+5.629885E-01
187+7.140691E+00,
-2.245934E+01,
+3.402678E+00,
-7.037156E+00,
+5.629885E-01,
+2.500000E+01
188cov
= getCov(cor, lowDia, std)
190+4.000000E+00,
-1.027587E+01,
+1.400311E+00,
-2.314570E+00,
-2.345950E+00,
+7.140691E+00
191-1.027587E+01,
+8.100000E+01,
-6.595016E+00,
-2.004526E+00,
+1.056823E+01,
-2.245934E+01
192+1.400311E+00,
-6.595016E+00,
+1.000000E+00,
-5.262451E-01,
-7.106996E-01,
+3.402678E+00
193-2.314570E+00,
-2.004526E+00,
-5.262451E-01,
+4.000000E+00,
-6.242104E-01,
-7.037156E+00
194-2.345950E+00,
+1.056823E+01,
-7.106996E-01,
-6.242104E-01,
+4.000000E+00,
+5.629885E-01
195+7.140691E+00,
-2.245934E+01,
+3.402678E+00,
-7.037156E+00,
+5.629885E-01,
+2.500000E+01
197+1.000000E+00,
-5.708815E-01,
+7.001553E-01,
-5.786425E-01,
-5.864874E-01,
+7.140691E-01
198-5.708815E-01,
+1.000000E+00,
-7.327796E-01,
-1.113626E-01,
+5.871239E-01,
-4.990965E-01
199+7.001553E-01,
-7.327796E-01,
+1.000000E+00,
-2.631226E-01,
-3.553498E-01,
+6.805356E-01
200-5.786425E-01,
-1.113626E-01,
-2.631226E-01,
+1.000000E+00,
-1.560526E-01,
-7.037156E-01
201-5.864874E-01,
+5.871239E-01,
-3.553498E-01,
-1.560526E-01,
+1.000000E+00,
+5.629885E-02
202+7.140691E-01,
-4.990965E-01,
+6.805356E-01,
-7.037156E-01,
+5.629885E-02,
+1.000000E+00
210+7.000000E+00,
+7.000000E+00
214+1.000000E+00,
-6.439612E-01
215-6.439612E-01,
+1.000000E+00
216cov
= getCov(cor, uppDia, std)
218+4.900000E+01,
-3.155410E+01
219-3.155410E+01,
+4.900000E+01
220cov
= getCov(cor, lowDia, std)
222+4.900000E+01,
-3.155410E+01
223-3.155410E+01,
+4.900000E+01
225+1.000000E+00,
-6.439613E-01
226-6.439613E-01,
+1.000000E+00
234+5.000000E+00,
+1.000000E+00,
+1.000000E+00,
+4.000000E+00,
+1.000000E+00,
+3.000000E+00,
+1.000000E+00
238+1.000000E+00,
-6.139759E-01,
+9.018455E-01,
+2.172033E-01,
-7.290598E-02,
+3.643507E-01,
+5.489259E-01
239-6.139759E-01,
+1.000000E+00,
-6.272851E-01,
-7.969132E-02,
+2.896488E-01,
-7.127306E-01,
-7.307767E-01
240+9.018455E-01,
-6.272851E-01,
+1.000000E+00,
+2.123346E-01,
-2.867150E-01,
+6.079513E-01,
+5.876704E-01
241+2.172033E-01,
-7.969132E-02,
+2.123346E-01,
+1.000000E+00,
+7.303581E-01,
+4.086391E-01,
+5.376651E-01
242-7.290598E-02,
+2.896488E-01,
-2.867150E-01,
+7.303581E-01,
+1.000000E+00,
-2.314590E-01,
+1.470055E-01
243+3.643507E-01,
-7.127306E-01,
+6.079513E-01,
+4.086391E-01,
-2.314590E-01,
+1.000000E+00,
+5.986668E-01
244+5.489259E-01,
-7.307767E-01,
+5.876704E-01,
+5.376651E-01,
+1.470055E-01,
+5.986668E-01,
+1.000000E+00
245cov
= getCov(cor, uppDia, std)
247+2.500000E+01,
-3.069880E+00,
+4.509227E+00,
+4.344065E+00,
-3.645299E-01,
+5.465260E+00,
+2.744630E+00
248-3.069880E+00,
+1.000000E+00,
-6.272851E-01,
-3.187653E-01,
+2.896488E-01,
-2.138192E+00,
-7.307767E-01
249+4.509227E+00,
-6.272851E-01,
+1.000000E+00,
+8.493386E-01,
-2.867150E-01,
+1.823854E+00,
+5.876704E-01
250+4.344065E+00,
-3.187653E-01,
+8.493386E-01,
+1.600000E+01,
+2.921432E+00,
+4.903669E+00,
+2.150661E+00
251-3.645299E-01,
+2.896488E-01,
-2.867150E-01,
+2.921432E+00,
+1.000000E+00,
-6.943769E-01,
+1.470055E-01
252+5.465260E+00,
-2.138192E+00,
+1.823854E+00,
+4.903669E+00,
-6.943769E-01,
+9.000000E+00,
+1.796000E+00
253+2.744630E+00,
-7.307767E-01,
+5.876704E-01,
+2.150661E+00,
+1.470055E-01,
+1.796000E+00,
+1.000000E+00
254cov
= getCov(cor, lowDia, std)
256+2.500000E+01,
-3.069880E+00,
+4.509227E+00,
+4.344065E+00,
-3.645299E-01,
+5.465260E+00,
+2.744630E+00
257-3.069880E+00,
+1.000000E+00,
-6.272851E-01,
-3.187653E-01,
+2.896488E-01,
-2.138192E+00,
-7.307767E-01
258+4.509227E+00,
-6.272851E-01,
+1.000000E+00,
+8.493386E-01,
-2.867150E-01,
+1.823854E+00,
+5.876704E-01
259+4.344065E+00,
-3.187653E-01,
+8.493386E-01,
+1.600000E+01,
+2.921432E+00,
+4.903669E+00,
+2.150661E+00
260-3.645299E-01,
+2.896488E-01,
-2.867150E-01,
+2.921432E+00,
+1.000000E+00,
-6.943769E-01,
+1.470055E-01
261+5.465260E+00,
-2.138192E+00,
+1.823854E+00,
+4.903669E+00,
-6.943769E-01,
+9.000000E+00,
+1.796000E+00
262+2.744630E+00,
-7.307767E-01,
+5.876704E-01,
+2.150661E+00,
+1.470055E-01,
+1.796000E+00,
+1.000000E+00
264+1.000000E+00,
-6.139759E-01,
+9.018455E-01,
+2.172033E-01,
-7.290598E-02,
+3.643507E-01,
+5.489259E-01
265-6.139759E-01,
+1.000000E+00,
-6.272851E-01,
-7.969132E-02,
+2.896488E-01,
-7.127306E-01,
-7.307767E-01
266+9.018455E-01,
-6.272851E-01,
+1.000000E+00,
+2.123346E-01,
-2.867150E-01,
+6.079513E-01,
+5.876704E-01
267+2.172033E-01,
-7.969132E-02,
+2.123346E-01,
+1.000000E+00,
+7.303581E-01,
+4.086391E-01,
+5.376651E-01
268-7.290598E-02,
+2.896488E-01,
-2.867150E-01,
+7.303581E-01,
+1.000000E+00,
-2.314590E-01,
+1.470055E-01
269+3.643507E-01,
-7.127306E-01,
+6.079513E-01,
+4.086391E-01,
-2.314590E-01,
+1.000000E+00,
+5.986668E-01
270+5.489259E-01,
-7.307767E-01,
+5.876704E-01,
+5.376651E-01,
+1.470055E-01,
+5.986668E-01,
+1.000000E+00
278+1.000000E+01,
+5.000000E+00,
+5.000000E+00,
+7.000000E+00,
+5.000000E+00,
+6.000000E+00
282+1.000000E+00,
+5.646743E-01,
+7.850605E-01,
-2.208656E-02,
+9.809051E-02,
+1.253671E-01
283+5.646743E-01,
+1.000000E+00,
-5.891359E-02,
-4.176201E-01,
-5.934682E-01,
+4.898605E-01
284+7.850605E-01,
-5.891359E-02,
+1.000000E+00,
+3.819137E-01,
+5.283641E-01,
-1.520058E-01
285-2.208656E-02,
-4.176201E-01,
+3.819137E-01,
+1.000000E+00,
+1.547616E-01,
+1.914386E-01
286+9.809051E-02,
-5.934682E-01,
+5.283641E-01,
+1.547616E-01,
+1.000000E+00,
-3.745260E-01
287+1.253671E-01,
+4.898605E-01,
-1.520058E-01,
+1.914386E-01,
-3.745260E-01,
+1.000000E+00
288cov
= getCov(cor, uppDia, std)
290+1.000000E+02,
+2.823372E+01,
+3.925303E+01,
-1.546059E+00,
+4.904525E+00,
+7.522026E+00
291+2.823372E+01,
+2.500000E+01,
-1.472840E+00,
-1.461670E+01,
-1.483671E+01,
+1.469582E+01
292+3.925303E+01,
-1.472840E+00,
+2.500000E+01,
+1.336698E+01,
+1.320910E+01,
-4.560174E+00
293-1.546059E+00,
-1.461670E+01,
+1.336698E+01,
+4.900000E+01,
+5.416655E+00,
+8.040422E+00
294+4.904525E+00,
-1.483671E+01,
+1.320910E+01,
+5.416655E+00,
+2.500000E+01,
-1.123578E+01
295+7.522026E+00,
+1.469582E+01,
-4.560174E+00,
+8.040422E+00,
-1.123578E+01,
+3.600000E+01
296cov
= getCov(cor, lowDia, std)
298+1.000000E+02,
+2.823372E+01,
+3.925303E+01,
-1.546059E+00,
+4.904525E+00,
+7.522026E+00
299+2.823372E+01,
+2.500000E+01,
-1.472840E+00,
-1.461670E+01,
-1.483671E+01,
+1.469582E+01
300+3.925303E+01,
-1.472840E+00,
+2.500000E+01,
+1.336698E+01,
+1.320910E+01,
-4.560174E+00
301-1.546059E+00,
-1.461670E+01,
+1.336698E+01,
+4.900000E+01,
+5.416655E+00,
+8.040422E+00
302+4.904525E+00,
-1.483671E+01,
+1.320910E+01,
+5.416655E+00,
+2.500000E+01,
-1.123578E+01
303+7.522026E+00,
+1.469582E+01,
-4.560174E+00,
+8.040422E+00,
-1.123578E+01,
+3.600000E+01
305+1.000000E+00,
+5.646743E-01,
+7.850606E-01,
-2.208656E-02,
+9.809051E-02,
+1.253671E-01
306+5.646743E-01,
+1.000000E+00,
-5.891359E-02,
-4.176201E-01,
-5.934683E-01,
+4.898606E-01
307+7.850606E-01,
-5.891359E-02,
+1.000000E+00,
+3.819138E-01,
+5.283641E-01,
-1.520058E-01
308-2.208656E-02,
-4.176201E-01,
+3.819138E-01,
+1.000000E+00,
+1.547616E-01,
+1.914386E-01
309+9.809051E-02,
-5.934683E-01,
+5.283641E-01,
+1.547616E-01,
+1.000000E+00,
-3.745261E-01
310+1.253671E-01,
+4.898606E-01,
-1.520058E-01,
+1.914386E-01,
-3.745261E-01,
+1.000000E+00
318+1.000000E+01,
+4.000000E+00
322+1.000000E+00,
-5.784964E-01
323-5.784964E-01,
+1.000000E+00
324cov
= getCov(cor, uppDia, std)
326+1.000000E+02,
-2.313986E+01
327-2.313986E+01,
+1.600000E+01
328cov
= getCov(cor, lowDia, std)
330+1.000000E+02,
-2.313986E+01
331-2.313986E+01,
+1.600000E+01
333+1.000000E+00,
-5.784964E-01
334-5.784964E-01,
+1.000000E+00
344sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
346+3.00000000,
+9.00000000,
+8.00000000,
+9.00000000,
+14.0000000,
+4.00000000,
+6.00000000,
+2.00000000,
+8.00000000,
+5.00000000
347+15.0000000,
+18.0000000,
+6.00000000,
+6.00000000,
+15.0000000,
+6.00000000,
+13.0000000,
+9.00000000,
+19.0000000,
+10.0000000
349'Compute the sample covariance along the second dimension.'
351cov
= getCov(sample,
dim = 2_IK)
353+11.3600006,
+4.54000044
354+4.54000044,
+22.4100018
356'Compute the sample covariance along the first dimension.'
358cov
= getCov(
transpose(sample),
dim = 1_IK)
360+11.3599997,
+4.54000044
361+4.54000044,
+22.4100018
363'Compute the full sample covariance for a pair of time series.'
365cov
= getCov(sample(
1,:), sample(
2,:))
367+11.3600006,
+4.54000044
368+4.54000044,
+22.4100018
371sample
= reshape(
cmplx(
getUnifRand(
1,
20, ndim
* nsam),
-getUnifRand(
1,
20, ndim
* nsam), TKG), shape
= [ndim, nsam], order
= [
2,
1])
373(
+12.0000000,
-9.00000000), (
+19.0000000,
-20.0000000), (
+17.0000000,
-14.0000000), (
+3.00000000,
-19.0000000), (
+19.0000000,
-16.0000000), (
+3.00000000,
-14.0000000), (
+5.00000000,
-19.0000000), (
+5.00000000,
-4.00000000), (
+13.0000000,
-17.0000000), (
+12.0000000,
-1.00000000)
374(
+8.00000000,
-18.0000000), (
+20.0000000,
-10.0000000), (
+20.0000000,
-19.0000000), (
+1.00000000,
-14.0000000), (
+4.00000000,
-15.0000000), (
+1.00000000,
-10.0000000), (
+2.00000000,
-6.00000000), (
+5.00000000,
-2.00000000), (
+11.0000000,
-7.00000000), (
+19.0000000,
-18.0000000)
376'Compute the sample covariance along the second dimension.'
378cov
= getCov(sample,
dim = 2_IK)
380(
+75.7699966,
+0.00000000), (
+27.1499996,
+24.5100002)
381(
+27.1499996,
-24.5100002), (
+86.7800064,
+0.00000000)
383'Compute the sample covariance along the first dimension.'
385cov
= getCov(
transpose(sample),
dim = 1_IK)
387(
+75.7699966,
+0.00000000), (
+27.1499996,
+24.5100002)
388(
+27.1499996,
-24.5100002), (
+86.7800064,
+0.00000000)
390'Compute the full sample covariance for a pair of time series.'
392cov
= getCov(sample(
1,:), sample(
2,:))
394(
+75.7699966,
+0.00000000), (
+27.1499996,
+24.5100002)
395(
+27.1499996,
-24.5100002), (
+86.7800064,
+0.00000000)
405sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
407+19.0000000,
+18.0000000,
+10.0000000,
+3.00000000,
+1.00000000,
+6.00000000,
+3.00000000,
+1.00000000,
+20.0000000,
+10.0000000
408+18.0000000,
+3.00000000,
+6.00000000,
+13.0000000,
+4.00000000,
+2.00000000,
+12.0000000,
+14.0000000,
+10.0000000,
+15.0000000
412+9,
+3,
+5,
+8,
+7,
+7,
+10,
+6,
+7,
+7
413call setMean(mean, sample,
2_IK, iweight, iweisum)
415+8.60869598,
+10.5217390
420+9,
+3,
+5,
+8,
+7,
+7,
+10,
+6,
+7,
+7
421call setMean(mean, sample,
2_IK, rweight, rweisum)
423+8.60869598,
+10.5217390
431cov
= getCov(sample,
2_IK, iweight)
433+51.2236824,
+8.81284714
434+8.81284714,
+27.0611210
436'Compute the sample covariance along the first dimension.'
438cov
= getCov(
transpose(sample),
1_IK, iweight)
440+51.2236938,
+8.81284714
441+8.81284714,
+27.0611210
443'Compute the full sample covariance for a pair of time series.'
445cov
= getCov(sample(
1,:), sample(
2,:), weight
= iweight)
447+51.2236824,
+8.81284714
448+8.81284714,
+27.0611210
455cov
= getCov(sample,
2_IK, rweight)
457+51.2236824,
+8.81284714
458+8.81284714,
+27.0611210
460'Compute the sample covariance along the first dimension.'
462cov
= getCov(
transpose(sample),
1_IK, rweight)
464+51.2236938,
+8.81284714
465+8.81284714,
+27.0611210
467'Compute the full sample covariance for a pair of time series.'
469cov
= getCov(sample(
1,:), sample(
2,:), weight
= rweight)
471+51.2236824,
+8.81284714
472+8.81284714,
+27.0611210
475sample
= reshape(
cmplx(
getUnifRand(
1,
20, ndim
* nsam),
-getUnifRand(
1,
20, ndim
* nsam), TKG), shape
= [ndim, nsam], order
= [
2,
1])
477(
+15.0000000,
-1.00000000), (
+18.0000000,
-16.0000000), (
+1.00000000,
-16.0000000), (
+12.0000000,
-10.0000000), (
+18.0000000,
-9.00000000), (
+12.0000000,
-19.0000000), (
+3.00000000,
-2.00000000), (
+20.0000000,
-17.0000000), (
+15.0000000,
-1.00000000), (
+17.0000000,
-14.0000000)
478(
+4.00000000,
-8.00000000), (
+6.00000000,
-10.0000000), (
+2.00000000,
-5.00000000), (
+2.00000000,
-18.0000000), (
+16.0000000,
-14.0000000), (
+17.0000000,
-2.00000000), (
+12.0000000,
-2.00000000), (
+18.0000000,
-2.00000000), (
+5.00000000,
-14.0000000), (
+12.0000000,
-1.00000000)
482+6,
+3,
+4,
+1,
+7,
+5,
+2,
+4,
+5,
+8
483call setMean(mean, sample,
2_IK, iweight, iweisum)
485(
+14.2888889,
-10.5555553), (
+10.3555555,
-6.97777796)
490+6,
+3,
+4,
+1,
+7,
+5,
+2,
+4,
+5,
+8
491call setMean(mean, sample,
2_IK, rweight, rweisum)
493(
+14.2888889,
-10.5555553), (
+10.3555555,
-6.97777796)
501cov
= getCov(sample,
2_IK, iweight)
503(
+73.7412491,
+0.00000000), (
-6.13481474,
-12.3071613)
504(
-6.13481474,
+12.3071613), (
+62.6064262,
+0.00000000)
506'Compute the sample covariance along the first dimension.'
508cov
= getCov(
transpose(sample),
1_IK, iweight)
510(
+73.7412338,
+0.00000000), (
-6.13481474,
-12.3071613)
511(
-6.13481474,
+12.3071613), (
+62.6064262,
+0.00000000)
513'Compute the full sample covariance for a pair of time series.'
515cov
= getCov(sample(
1,:), sample(
2,:), weight
= iweight)
517(
+73.7412491,
+0.00000000), (
-6.13481474,
-12.3071613)
518(
-6.13481474,
+12.3071613), (
+62.6064262,
+0.00000000)
525cov
= getCov(sample,
2_IK, rweight)
527(
+73.7412491,
+0.00000000), (
-6.13481474,
-12.3071613)
528(
-6.13481474,
+12.3071613), (
+62.6064262,
+0.00000000)
530'Compute the sample covariance along the first dimension.'
532cov
= getCov(
transpose(sample),
1_IK, rweight)
534(
+73.7412338,
+0.00000000), (
-6.13481474,
-12.3071613)
535(
-6.13481474,
+12.3071613), (
+62.6064262,
+0.00000000)
537'Compute the full sample covariance for a pair of time series.'
539cov
= getCov(sample(
1,:), sample(
2,:), weight
= rweight)
541(
+73.7412491,
+0.00000000), (
-6.13481474,
-12.3071613)
542(
-6.13481474,
+12.3071613), (
+62.6064262,
+0.00000000)