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.
14+1.000000E+00,
+2.000000E+00
18+1.000000E+00,
-8.156881E-01
19-8.156881E-01,
+1.000000E+00
20cov
= getCov(cor, uppDia, std)
22+1.000000E+00,
-1.631376E+00
23-1.631376E+00,
+4.000000E+00
24cov
= getCov(cor, lowDia, std)
26+1.000000E+00,
-1.631376E+00
27-1.631376E+00,
+4.000000E+00
29+1.000000E+00,
-8.156881E-01
30-8.156881E-01,
+1.000000E+00
43cov
= getCov(cor, uppDia, std)
46cov
= getCov(cor, lowDia, std)
58+9.000000E+00,
+3.000000E+00,
+1.000000E+01
62+1.000000E+00,
+5.890449E-01,
-4.425062E-01
63+5.890449E-01,
+1.000000E+00,
-3.070235E-01
64-4.425062E-01,
-3.070235E-01,
+1.000000E+00
65cov
= getCov(cor, uppDia, std)
67+8.100000E+01,
+1.590421E+01,
-3.982556E+01
68+1.590421E+01,
+9.000000E+00,
-9.210706E+00
69-3.982556E+01,
-9.210706E+00,
+1.000000E+02
70cov
= getCov(cor, lowDia, std)
72+8.100000E+01,
+1.590421E+01,
-3.982556E+01
73+1.590421E+01,
+9.000000E+00,
-9.210706E+00
74-3.982556E+01,
-9.210706E+00,
+1.000000E+02
76+1.000000E+00,
+5.890449E-01,
-4.425062E-01
77+5.890449E-01,
+1.000000E+00,
-3.070236E-01
78-4.425062E-01,
-3.070236E-01,
+1.000000E+00
86+7.000000E+00,
+5.000000E+00,
+6.000000E+00,
+3.000000E+00
90+1.000000E+00,
+5.257127E-01,
+5.521179E-01,
+5.841199E-01
91+5.257127E-01,
+1.000000E+00,
+9.974027E-01,
+9.890235E-01
92+5.521179E-01,
+9.974027E-01,
+1.000000E+00,
+9.968132E-01
93+5.841199E-01,
+9.890235E-01,
+9.968132E-01,
+1.000000E+00
94cov
= getCov(cor, uppDia, std)
96+4.900000E+01,
+1.839995E+01,
+2.318895E+01,
+1.226652E+01
97+1.839995E+01,
+2.500000E+01,
+2.992208E+01,
+1.483535E+01
98+2.318895E+01,
+2.992208E+01,
+3.600000E+01,
+1.794264E+01
99+1.226652E+01,
+1.483535E+01,
+1.794264E+01,
+9.000000E+00
100cov
= getCov(cor, lowDia, std)
102+4.900000E+01,
+1.839995E+01,
+2.318895E+01,
+1.226652E+01
103+1.839995E+01,
+2.500000E+01,
+2.992208E+01,
+1.483535E+01
104+2.318895E+01,
+2.992208E+01,
+3.600000E+01,
+1.794264E+01
105+1.226652E+01,
+1.483535E+01,
+1.794264E+01,
+9.000000E+00
107+1.000000E+00,
+5.257128E-01,
+5.521179E-01,
+5.841199E-01
108+5.257128E-01,
+1.000000E+00,
+9.974027E-01,
+9.890236E-01
109+5.521179E-01,
+9.974027E-01,
+1.000000E+00,
+9.968133E-01
110+5.841199E-01,
+9.890236E-01,
+9.968133E-01,
+1.000000E+00
118+2.000000E+00,
+4.000000E+00,
+3.000000E+00
122+1.000000E+00,
-6.935921E-01,
+6.501193E-01
123-6.935921E-01,
+1.000000E+00,
+9.479794E-02
124+6.501193E-01,
+9.479794E-02,
+1.000000E+00
125cov
= getCov(cor, uppDia, std)
127+4.000000E+00,
-5.548737E+00,
+3.900716E+00
128-5.548737E+00,
+1.600000E+01,
+1.137575E+00
129+3.900716E+00,
+1.137575E+00,
+9.000000E+00
130cov
= getCov(cor, lowDia, std)
132+4.000000E+00,
-5.548737E+00,
+3.900716E+00
133-5.548737E+00,
+1.600000E+01,
+1.137575E+00
134+3.900716E+00,
+1.137575E+00,
+9.000000E+00
136+1.000000E+00,
-6.935921E-01,
+6.501193E-01
137-6.935921E-01,
+1.000000E+00,
+9.479794E-02
138+6.501193E-01,
+9.479794E-02,
+1.000000E+00
146+6.000000E+00,
+4.000000E+00,
+3.000000E+00
150+1.000000E+00,
-8.367915E-01,
+2.911324E-01
151-8.367915E-01,
+1.000000E+00,
+5.950055E-02
152+2.911324E-01,
+5.950055E-02,
+1.000000E+00
153cov
= getCov(cor, uppDia, std)
155+3.600000E+01,
-2.008299E+01,
+5.240384E+00
156-2.008299E+01,
+1.600000E+01,
+7.140065E-01
157+5.240384E+00,
+7.140065E-01,
+9.000000E+00
158cov
= getCov(cor, lowDia, std)
160+3.600000E+01,
-2.008299E+01,
+5.240384E+00
161-2.008299E+01,
+1.600000E+01,
+7.140065E-01
162+5.240384E+00,
+7.140065E-01,
+9.000000E+00
164+1.000000E+00,
-8.367915E-01,
+2.911325E-01
165-8.367915E-01,
+1.000000E+00,
+5.950055E-02
166+2.911325E-01,
+5.950055E-02,
+1.000000E+00
174+8.000000E+00,
+4.000000E+00
178+1.000000E+00,
+9.357148E-01
179+9.357148E-01,
+1.000000E+00
180cov
= getCov(cor, uppDia, std)
182+6.400000E+01,
+2.994287E+01
183+2.994287E+01,
+1.600000E+01
184cov
= getCov(cor, lowDia, std)
186+6.400000E+01,
+2.994287E+01
187+2.994287E+01,
+1.600000E+01
189+1.000000E+00,
+9.357148E-01
190+9.357148E-01,
+1.000000E+00
203cov
= getCov(cor, uppDia, std)
206cov
= getCov(cor, lowDia, std)
218+2.000000E+00,
+8.000000E+00,
+1.000000E+00,
+7.000000E+00,
+8.000000E+00
222+1.000000E+00,
+2.335250E-01,
+2.207616E-01,
-1.086629E-01,
+1.843638E-01
223+2.335250E-01,
+1.000000E+00,
+9.317105E-01,
+4.592218E-02,
-1.676614E-01
224+2.207616E-01,
+9.317105E-01,
+1.000000E+00,
-1.802482E-01,
+5.627710E-02
225-1.086629E-01,
+4.592218E-02,
-1.802482E-01,
+1.000000E+00,
-5.366302E-01
226+1.843638E-01,
-1.676614E-01,
+5.627710E-02,
-5.366302E-01,
+1.000000E+00
227cov
= getCov(cor, uppDia, std)
229+4.000000E+00,
+3.736401E+00,
+4.415232E-01,
-1.521281E+00,
+2.949821E+00
230+3.736401E+00,
+6.400000E+01,
+7.453684E+00,
+2.571642E+00,
-1.073033E+01
231+4.415232E-01,
+7.453684E+00,
+1.000000E+00,
-1.261738E+00,
+4.502168E-01
232-1.521281E+00,
+2.571642E+00,
-1.261738E+00,
+4.900000E+01,
-3.005129E+01
233+2.949821E+00,
-1.073033E+01,
+4.502168E-01,
-3.005129E+01,
+6.400000E+01
234cov
= getCov(cor, lowDia, std)
236+4.000000E+00,
+3.736401E+00,
+4.415232E-01,
-1.521281E+00,
+2.949821E+00
237+3.736401E+00,
+6.400000E+01,
+7.453684E+00,
+2.571642E+00,
-1.073033E+01
238+4.415232E-01,
+7.453684E+00,
+1.000000E+00,
-1.261738E+00,
+4.502168E-01
239-1.521281E+00,
+2.571642E+00,
-1.261738E+00,
+4.900000E+01,
-3.005129E+01
240+2.949821E+00,
-1.073033E+01,
+4.502168E-01,
-3.005129E+01,
+6.400000E+01
242+1.000000E+00,
+2.335250E-01,
+2.207616E-01,
-1.086629E-01,
+1.843638E-01
243+2.335250E-01,
+1.000000E+00,
+9.317105E-01,
+4.592218E-02,
-1.676614E-01
244+2.207616E-01,
+9.317105E-01,
+1.000000E+00,
-1.802482E-01,
+5.627710E-02
245-1.086629E-01,
+4.592218E-02,
-1.802482E-01,
+1.000000E+00,
-5.366302E-01
246+1.843638E-01,
-1.676614E-01,
+5.627710E-02,
-5.366302E-01,
+1.000000E+00
254+5.000000E+00,
+6.000000E+00,
+1.000000E+01,
+7.000000E+00,
+6.000000E+00,
+6.000000E+00
258+1.000000E+00,
-8.360406E-01,
+7.955736E-01,
+3.998902E-01,
-7.772763E-03,
-3.233274E-01
259-8.360406E-01,
+1.000000E+00,
-3.329079E-01,
-6.350493E-01,
+9.336077E-02,
+1.734658E-01
260+7.955736E-01,
-3.329079E-01,
+1.000000E+00,
-5.028822E-03,
+1.046380E-01,
-3.565818E-01
261+3.998902E-01,
-6.350493E-01,
-5.028822E-03,
+1.000000E+00,
-3.005168E-02,
+5.875157E-01
262-7.772763E-03,
+9.336077E-02,
+1.046380E-01,
-3.005168E-02,
+1.000000E+00,
-2.089017E-01
263-3.233274E-01,
+1.734658E-01,
-3.565818E-01,
+5.875157E-01,
-2.089017E-01,
+1.000000E+00
264cov
= getCov(cor, uppDia, std)
266+2.500000E+01,
-2.508122E+01,
+3.977868E+01,
+1.399616E+01,
-2.331829E-01,
-9.699822E+00
267-2.508122E+01,
+3.600000E+01,
-1.997448E+01,
-2.667207E+01,
+3.360988E+00,
+6.244770E+00
268+3.977868E+01,
-1.997448E+01,
+1.000000E+02,
-3.520176E-01,
+6.278280E+00,
-2.139491E+01
269+1.399616E+01,
-2.667207E+01,
-3.520176E-01,
+4.900000E+01,
-1.262171E+00,
+2.467566E+01
270-2.331829E-01,
+3.360988E+00,
+6.278280E+00,
-1.262171E+00,
+3.600000E+01,
-7.520463E+00
271-9.699822E+00,
+6.244770E+00,
-2.139491E+01,
+2.467566E+01,
-7.520463E+00,
+3.600000E+01
272cov
= getCov(cor, lowDia, std)
274+2.500000E+01,
-2.508122E+01,
+3.977868E+01,
+1.399616E+01,
-2.331829E-01,
-9.699822E+00
275-2.508122E+01,
+3.600000E+01,
-1.997448E+01,
-2.667207E+01,
+3.360988E+00,
+6.244770E+00
276+3.977868E+01,
-1.997448E+01,
+1.000000E+02,
-3.520176E-01,
+6.278280E+00,
-2.139491E+01
277+1.399616E+01,
-2.667207E+01,
-3.520176E-01,
+4.900000E+01,
-1.262171E+00,
+2.467566E+01
278-2.331829E-01,
+3.360988E+00,
+6.278280E+00,
-1.262171E+00,
+3.600000E+01,
-7.520463E+00
279-9.699822E+00,
+6.244770E+00,
-2.139491E+01,
+2.467566E+01,
-7.520463E+00,
+3.600000E+01
281+1.000000E+00,
-8.360406E-01,
+7.955737E-01,
+3.998902E-01,
-7.772763E-03,
-3.233274E-01
282-8.360406E-01,
+1.000000E+00,
-3.329079E-01,
-6.350494E-01,
+9.336078E-02,
+1.734658E-01
283+7.955737E-01,
-3.329079E-01,
+1.000000E+00,
-5.028823E-03,
+1.046380E-01,
-3.565818E-01
284+3.998902E-01,
-6.350494E-01,
-5.028823E-03,
+1.000000E+00,
-3.005168E-02,
+5.875158E-01
285-7.772763E-03,
+9.336078E-02,
+1.046380E-01,
-3.005168E-02,
+1.000000E+00,
-2.089018E-01
286-3.233274E-01,
+1.734658E-01,
-3.565818E-01,
+5.875158E-01,
-2.089018E-01,
+1.000000E+00
296sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
298+3.00000000,
+9.00000000,
+6.00000000,
+9.00000000,
+7.00000000,
+11.0000000,
+11.0000000,
+14.0000000,
+6.00000000,
+19.0000000
299+3.00000000,
+2.00000000,
+1.00000000,
+7.00000000,
+3.00000000,
+3.00000000,
+12.0000000,
+17.0000000,
+17.0000000,
+9.00000000
301'Compute the sample covariance along the second dimension.'
303cov
= getCov(sample,
dim = 2_IK)
305+18.8500004,
+9.00000000
306+9.00000000,
+33.6399994
308'Compute the sample covariance along the first dimension.'
310cov
= getCov(
transpose(sample),
dim = 1_IK)
312+18.8500004,
+9.00000000
313+9.00000000,
+33.6399994
315'Compute the full sample covariance for a pair of time series.'
317cov
= getCov(sample(
1,:), sample(
2,:))
319+18.8500004,
+9.00000000
320+9.00000000,
+33.6399994
323sample
= reshape(
cmplx(
getUnifRand(
1,
20, ndim
* nsam),
-getUnifRand(
1,
20, ndim
* nsam), TKG), shape
= [ndim, nsam], order
= [
2,
1])
325(
+11.0000000,
-14.0000000), (
+6.00000000,
-17.0000000), (
+13.0000000,
-11.0000000), (
+20.0000000,
-3.00000000), (
+9.00000000,
-6.00000000), (
+17.0000000,
-20.0000000), (
+17.0000000,
-17.0000000), (
+1.00000000,
-12.0000000), (
+20.0000000,
-8.00000000), (
+1.00000000,
-17.0000000)
326(
+18.0000000,
-5.00000000), (
+11.0000000,
-14.0000000), (
+18.0000000,
-19.0000000), (
+6.00000000,
-7.00000000), (
+10.0000000,
-4.00000000), (
+16.0000000,
-4.00000000), (
+16.0000000,
-20.0000000), (
+15.0000000,
-7.00000000), (
+15.0000000,
-9.00000000), (
+16.0000000,
-15.0000000)
328'Compute the sample covariance along the second dimension.'
330cov
= getCov(sample,
dim = 2_IK)
332(
+73.9000015,
+0.00000000), (
+5.45000029,
-14.0500002)
333(
+5.45000029,
+14.0500002), (
+47.1300011,
+0.00000000)
335'Compute the sample covariance along the first dimension.'
337cov
= getCov(
transpose(sample),
dim = 1_IK)
339(
+73.9000015,
+0.00000000), (
+5.45000029,
-14.0500002)
340(
+5.45000029,
+14.0500002), (
+47.1300011,
+0.00000000)
342'Compute the full sample covariance for a pair of time series.'
344cov
= getCov(sample(
1,:), sample(
2,:))
346(
+73.9000015,
+0.00000000), (
+5.45000029,
-14.0500002)
347(
+5.45000029,
+14.0500002), (
+47.1300011,
+0.00000000)
357sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
359+10.0000000,
+4.00000000,
+14.0000000,
+15.0000000,
+15.0000000,
+8.00000000,
+18.0000000,
+4.00000000,
+18.0000000,
+7.00000000
360+15.0000000,
+19.0000000,
+2.00000000,
+3.00000000,
+19.0000000,
+7.00000000,
+9.00000000,
+12.0000000,
+7.00000000,
+13.0000000
364+4,
+9,
+2,
+5,
+5,
+7,
+7,
+7,
+1,
+5
365call setMean(mean, sample,
2_IK, iweight, iweisum)
367+9.94230843,
+11.7884617
372+4,
+9,
+2,
+5,
+5,
+7,
+7,
+7,
+1,
+5
373call setMean(mean, sample,
2_IK, rweight, rweisum)
375+9.94230843,
+11.7884617
383cov
= getCov(sample,
2_IK, iweight)
385+27.7466717,
-12.7237434
386-12.7237434,
+30.6283302
388'Compute the sample covariance along the first dimension.'
390cov
= getCov(
transpose(sample),
1_IK, iweight)
392+27.7466717,
-12.7237434
393-12.7237434,
+30.6283302
395'Compute the full sample covariance for a pair of time series.'
397cov
= getCov(sample(
1,:), sample(
2,:), weight
= iweight)
399+27.7466717,
-12.7237434
400-12.7237434,
+30.6283302
407cov
= getCov(sample,
2_IK, rweight)
409+27.7466717,
-12.7237434
410-12.7237434,
+30.6283302
412'Compute the sample covariance along the first dimension.'
414cov
= getCov(
transpose(sample),
1_IK, rweight)
416+27.7466717,
-12.7237434
417-12.7237434,
+30.6283302
419'Compute the full sample covariance for a pair of time series.'
421cov
= getCov(sample(
1,:), sample(
2,:), weight
= rweight)
423+27.7466717,
-12.7237434
424-12.7237434,
+30.6283302
427sample
= reshape(
cmplx(
getUnifRand(
1,
20, ndim
* nsam),
-getUnifRand(
1,
20, ndim
* nsam), TKG), shape
= [ndim, nsam], order
= [
2,
1])
429(
+3.00000000,
-17.0000000), (
+8.00000000,
-11.0000000), (
+8.00000000,
-1.00000000), (
+13.0000000,
-10.0000000), (
+20.0000000,
-16.0000000), (
+7.00000000,
-14.0000000), (
+16.0000000,
-9.00000000), (
+19.0000000,
-15.0000000), (
+1.00000000,
-1.00000000), (
+2.00000000,
-1.00000000)
430(
+7.00000000,
-6.00000000), (
+5.00000000,
-1.00000000), (
+7.00000000,
-12.0000000), (
+4.00000000,
-15.0000000), (
+16.0000000,
-20.0000000), (
+8.00000000,
-4.00000000), (
+10.0000000,
-13.0000000), (
+17.0000000,
-17.0000000), (
+13.0000000,
-3.00000000), (
+6.00000000,
-19.0000000)
434+8,
+10,
+9,
+6,
+7,
+6,
+9,
+1,
+8,
+6
435call setMean(mean, sample,
2_IK, iweight, iweisum)
437(
+8.84285736,
-8.87142849), (
+8.57142830,
-9.88571453)
442+8,
+10,
+9,
+6,
+7,
+6,
+9,
+1,
+8,
+6
443call setMean(mean, sample,
2_IK, rweight, rweisum)
445(
+8.84285736,
-8.87142849), (
+8.57142830,
-9.88571453)
453cov
= getCov(sample,
2_IK, iweight)
455(
+73.9587708,
+0.00000000), (
+5.86081553,
+20.0371437)
456(
+5.86081553,
-20.0371437), (
+57.3746948,
+0.00000000)
458'Compute the sample covariance along the first dimension.'
460cov
= getCov(
transpose(sample),
1_IK, iweight)
462(
+73.9587784,
+0.00000000), (
+5.86081553,
+20.0371437)
463(
+5.86081553,
-20.0371437), (
+57.3746948,
+0.00000000)
465'Compute the full sample covariance for a pair of time series.'
467cov
= getCov(sample(
1,:), sample(
2,:), weight
= iweight)
469(
+73.9587708,
+0.00000000), (
+5.86081553,
+20.0371437)
470(
+5.86081553,
-20.0371437), (
+57.3746948,
+0.00000000)
477cov
= getCov(sample,
2_IK, rweight)
479(
+73.9587708,
+0.00000000), (
+5.86081553,
+20.0371437)
480(
+5.86081553,
-20.0371437), (
+57.3746948,
+0.00000000)
482'Compute the sample covariance along the first dimension.'
484cov
= getCov(
transpose(sample),
1_IK, rweight)
486(
+73.9587784,
+0.00000000), (
+5.86081553,
+20.0371437)
487(
+5.86081553,
-20.0371437), (
+57.3746948,
+0.00000000)
489'Compute the full sample covariance for a pair of time series.'
491cov
= getCov(sample(
1,:), sample(
2,:), weight
= rweight)
493(
+73.9587708,
+0.00000000), (
+5.86081553,
+20.0371437)
494(
+5.86081553,
-20.0371437), (
+57.3746948,
+0.00000000)