24 type(display_type) :: disp
25 integer(IK) :: itry, ntry
= 10
26 character(:),
allocatable :: format
30 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
31 call disp%show(
"!Compute the correlation matrix from covariance matrix.")
32 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
37 real(TKG),
allocatable :: cov(:,:), cor(:,:), std(:)
41 call disp%show(
"ndim = getUnifRand(0, 7)")
45 call disp%show(
"std = getUnifRand(1, ndim, ndim)")
49 call disp%show(
"cov = getCovRand(1._TKG, std)")
53 call disp%show(
"cor = getCor(cov, uppDia)")
57 call disp%show(
"cor = getCor(cov, upp, stdinv = 1 / std)")
58 cor
= getCor(cov, upp, stdinv
= 1 / std)
61 call disp%show(
"cor = getCor(cov, lowDia)")
65 call disp%show(
"cor = getCor(cov, low, stdinv = 1 / std)")
66 cor
= getCor(cov, low, stdinv
= 1 / std)
69 call disp%show(
"getCov(getCor(cov, lowDia), lowDia, std) ! reconstruct the original covariance matrix.")
71 call disp%show(
"getCov(getCor(cov, uppDia), uppDia, std) ! reconstruct the original covariance matrix.")
78 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
79 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
80 call disp%show(
"!Compute the Pearson correlation matrix for a pair of time series.")
81 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
82 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
87 integer(IK) :: ndim, nsam, dim
88 real(TKG),
allocatable :: sample(:,:), cor(:,:), mean(:)
89 format = getFormat(mold
= [
0._TKG], ed
= SK_
"es", signed
= .true._LK)
90 call disp%show(
"ndim = 2; nsam = 10; dim = 2")
91 ndim
= 2; nsam
= 10; dim
= 2
92 call disp%show(
"sample = reshape(getUnifRand(1, 20, ndim * nsam), shape = [ndim, nsam], order = [2, 1])")
93 sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
95 call disp%show( sample ,
format = format )
96 call disp%show(
"mean = getMean(sample, dim)")
99 call disp%show( mean ,
format = format )
100 call disp%show(
"cor = getCor(sample, dim) ! same result as above.")
103 call disp%show( cor ,
format = format )
105 call disp%show(
"Compute the sample correlation along the first dimension.", deliml
= SK_
'''')
109 call disp%show(
"cor = getCor(transpose(sample), dim) ! same result as above.")
110 cor
= getCor(
transpose(sample), dim)
112 call disp%show( cor ,
format = format )
114 call disp%show(
"Compute the full sample correlation for a pair of time series.", deliml
= SK_
'''')
116 call disp%show(
"cor(1,1) = getCor(sample(1,:), sample(2,:)) ! same result as above.")
117 cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:))
119 call disp%show( cor(
1,
1) ,
format = format )
124 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
125 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
126 call disp%show(
"!Compute the Pearson correlation matrix for a weighted pair of time series.")
127 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
128 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
134 integer(IK),
allocatable :: iweight(:)
135 real(TKG),
allocatable :: rweight(:)
137 integer(IK) :: iweisum
138 integer(IK) :: ndim, nsam, dim
139 real(TKG),
allocatable :: sample(:,:), cor(:,:), mean(:)
140 format = getFormat(mold
= [
0._TKG], ed
= SK_
"es", signed
= .true._LK)
141 call disp%show(
"ndim = 2; nsam = 10; dim = 2")
142 ndim
= 2; nsam
= 10; dim
= 2
143 call disp%show(
"sample = reshape(getUnifRand(1, 20, ndim * nsam), shape = [ndim, nsam], order = [2, 1])")
144 sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
146 call disp%show( sample ,
format = format )
147 call disp%show(
"call setResized(mean, ndim)")
149 call disp%show(
"iweight = getUnifRand(1, 10, nsam) ! integer-valued weights.")
153 call disp%show(
"call setMean(mean, sample, dim, iweight, iweisum)")
154 call setMean(mean, sample, dim, iweight, iweisum)
159 call disp%show(
"rweight = iweight ! or real-valued weights.")
163 call disp%show(
"call setMean(mean, sample, dim, rweight, rweisum)")
164 call setMean(mean, sample, dim, rweight, rweisum)
166 call disp%show( mean ,
format = format )
168 call disp%show( rweisum ,
format = format )
171 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
172 call disp%show(
"!Compute the correlation matrix with integer weights.")
173 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
176 call disp%show(
"cor = getCor(sample, dim, iweight) ! same result as above.")
177 cor
= getCor(sample, dim, iweight)
179 call disp%show( cor ,
format = format )
181 call disp%show(
"Compute the sample correlation along the first dimension.", deliml
= SK_
'''')
185 call disp%show(
"cor = getCor(transpose(sample), dim, iweight) ! same result as above.")
186 cor
= getCor(
transpose(sample), dim, iweight)
188 call disp%show( cor ,
format = format )
190 call disp%show(
"Compute the full sample correlation for a pair of time series.", deliml
= SK_
'''')
192 call disp%show(
"cor(1,1) = getCor(sample(1,:), sample(2,:), iweight) ! same result as above.")
193 cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:), iweight)
195 call disp%show( cor(
1,
1) ,
format = format )
199 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
200 call disp%show(
"!Compute the correlation matrix with real weights.")
201 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
206 call disp%show(
"cor = getCor(sample, dim, rweight) ! same result as above.")
207 cor
= getCor(sample, dim, rweight)
209 call disp%show( cor ,
format = format )
211 call disp%show(
"Compute the sample correlation along the first dimension.", deliml
= SK_
'''')
215 call disp%show(
"cor = getCor(transpose(sample), dim, rweight) ! same result as above.")
216 cor
= getCor(
transpose(sample), dim, rweight)
218 call disp%show( cor ,
format = format )
220 call disp%show(
"Compute the full sample correlation for a pair of time series.", deliml
= SK_
'''')
222 call disp%show(
"cor(1,1) = getCor(sample(1,:), sample(2,:), rweight) ! same result as above.")
223 cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:), rweight)
225 call disp%show( cor(
1,
1) ,
format = format )
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
Generate minimally-spaced character, integer, real sequences or sequences at fixed intervals of size ...
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 an equally-weighted (verbose or flattened) array of the input weighted array of rank 1 or 2.
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.
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...
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 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 generating arrays with linear or logarithm...
This module contains procedures and generic interfaces for flattening (duplicating the elements of) a...
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 classes and procedures for computing the properties related to the covariance ma...
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.
12+5.00000000,
+1.00000000,
+4.00000000,
+6.00000000,
+6.00000000,
+7.00000000,
+1.00000000
15+25.0000000,
+3.42286325,
+14.8290634,
+3.94746423,
-20.8633156,
-23.9637852,
-2.16289282
16+3.42286325,
+0.999999881,
+1.67499459,
-2.29277420,
-4.99174309,
-5.11780691,
-0.634693623
17+14.8290634,
+1.67499459,
+15.9999981,
+0.758326292,
-15.0802774,
-11.3248491,
+0.506526232E-1
18+3.94746423,
-2.29277420,
+0.758326292,
+36.0000000,
+0.905534148,
+8.03260994,
-1.10761917
19-20.8633156,
-4.99174309,
-15.0802774,
+0.905534148,
+36.0000000,
+20.2001801,
+2.81178069
20-23.9637852,
-5.11780691,
-11.3248491,
+8.03260994,
+20.2001801,
+49.0000000,
+4.73817301
21-2.16289282,
-0.634693623,
+0.506526232E-1,
-1.10761917,
+2.81178069,
+4.73817301,
+1.00000000
24+1.00000000,
+0.684572756,
+0.741453290,
+0.131582141,
-0.695443869,
-0.684679627,
-0.432578564
25+0.684572756,
+1.00000000,
+0.418748736,
-0.382129073,
-0.831957281,
-0.731115401,
-0.634693682
26+0.741453290,
+0.418748736,
+1.00000000,
+0.315969326E-1,
-0.628344953,
-0.404458970,
+0.126631577E-1
27+0.131582141,
-0.382129073,
+0.315969326E-1,
+1.00000000,
+0.251537282E-1,
+0.191252634,
-0.184603199
28-0.695443869,
-0.831957281,
-0.628344953,
+0.251537282E-1,
+1.00000000,
+0.480956703,
+0.468630135
29-0.684679627,
-0.731115401,
-0.404458970,
+0.191252634,
+0.480956703,
+1.00000000,
+0.676881909
30-0.432578564,
-0.634693682,
+0.126631577E-1,
-0.184603199,
+0.468630135,
+0.676881909,
+1.00000000
31cor
= getCor(cov, upp, stdinv
= 1 / std)
33+1.00000000,
+0.684572637,
+0.741453171,
+0.131582141,
-0.695443869,
-0.684679627,
-0.432578564
34+0.684572637,
+1.00000000,
+0.418748647,
-0.382129043,
-0.831957221,
-0.731115282,
-0.634693623
35+0.741453171,
+0.418748647,
+1.00000000,
+0.315969288E-1,
-0.628344893,
-0.404458910,
+0.126631558E-1
36+0.131582141,
-0.382129043,
+0.315969288E-1,
+1.00000000,
+0.251537282E-1,
+0.191252634,
-0.184603199
37-0.695443869,
-0.831957221,
-0.628344893,
+0.251537282E-1,
+1.00000000,
+0.480956703,
+0.468630135
38-0.684679627,
-0.731115282,
-0.404458910,
+0.191252634,
+0.480956703,
+1.00000000,
+0.676881909
39-0.432578564,
-0.634693623,
+0.126631558E-1,
-0.184603199,
+0.468630135,
+0.676881909,
+1.00000000
42+1.00000000,
+0.684572756,
+0.741453290,
+0.131582141,
-0.695443869,
-0.684679627,
-0.432578564
43+0.684572756,
+1.00000000,
+0.418748736,
-0.382129073,
-0.831957281,
-0.731115401,
-0.634693682
44+0.741453290,
+0.418748736,
+1.00000000,
+0.315969326E-1,
-0.628344953,
-0.404458970,
+0.126631577E-1
45+0.131582141,
-0.382129073,
+0.315969326E-1,
+1.00000000,
+0.251537282E-1,
+0.191252634,
-0.184603199
46-0.695443869,
-0.831957281,
-0.628344953,
+0.251537282E-1,
+1.00000000,
+0.480956703,
+0.468630135
47-0.684679627,
-0.731115401,
-0.404458970,
+0.191252634,
+0.480956703,
+1.00000000,
+0.676881909
48-0.432578564,
-0.634693682,
+0.126631577E-1,
-0.184603199,
+0.468630135,
+0.676881909,
+1.00000000
49cor
= getCor(cov, low, stdinv
= 1 / std)
51+1.00000000,
+0.684572637,
+0.741453171,
+0.131582141,
-0.695443869,
-0.684679627,
-0.432578564
52+0.684572637,
+1.00000000,
+0.418748647,
-0.382129043,
-0.831957221,
-0.731115282,
-0.634693623
53+0.741453171,
+0.418748647,
+1.00000000,
+0.315969288E-1,
-0.628344893,
-0.404458910,
+0.126631558E-1
54+0.131582141,
-0.382129043,
+0.315969288E-1,
+1.00000000,
+0.251537282E-1,
+0.191252634,
-0.184603199
55-0.695443869,
-0.831957221,
-0.628344893,
+0.251537282E-1,
+1.00000000,
+0.480956703,
+0.468630135
56-0.684679627,
-0.731115282,
-0.404458910,
+0.191252634,
+0.480956703,
+1.00000000,
+0.676881909
57-0.432578564,
-0.634693623,
+0.126631558E-1,
-0.184603199,
+0.468630135,
+0.676881909,
+1.00000000
59+25.0000000,
+3.42286372,
+14.8290653,
+3.94746423,
-20.8633156,
-23.9637871,
-2.16289282
60+3.42286372,
+1.00000000,
+1.67499495,
-2.29277444,
-4.99174356,
-5.11780787,
-0.634693682
61+14.8290653,
+1.67499495,
+16.0000000,
+0.758326411,
-15.0802784,
-11.3248510,
+0.506526306E-1
62+3.94746423,
-2.29277444,
+0.758326411,
+36.0000000,
+0.905534208,
+8.03261089,
-1.10761917
63-20.8633156,
-4.99174356,
-15.0802784,
+0.905534208,
+36.0000000,
+20.2001820,
+2.81178093
64-23.9637871,
-5.11780787,
-11.3248510,
+8.03261089,
+20.2001820,
+49.0000000,
+4.73817348
65-2.16289282,
-0.634693682,
+0.506526306E-1,
-1.10761917,
+2.81178093,
+4.73817348,
+1.00000000
67+25.0000000,
+3.42286372,
+14.8290653,
+3.94746423,
-20.8633156,
-23.9637871,
-2.16289282
68+3.42286372,
+1.00000000,
+1.67499495,
-2.29277444,
-4.99174356,
-5.11780787,
-0.634693682
69+14.8290653,
+1.67499495,
+16.0000000,
+0.758326411,
-15.0802784,
-11.3248510,
+0.506526306E-1
70+3.94746423,
-2.29277444,
+0.758326411,
+36.0000000,
+0.905534208,
+8.03261089,
-1.10761917
71-20.8633156,
-4.99174356,
-15.0802784,
+0.905534208,
+36.0000000,
+20.2001820,
+2.81178093
72-23.9637871,
-5.11780787,
-11.3248510,
+8.03261089,
+20.2001820,
+49.0000000,
+4.73817348
73-2.16289282,
-0.634693682,
+0.506526306E-1,
-1.10761917,
+2.81178093,
+4.73817348,
+1.00000000
81+2.00000000,
+2.00000000
84+4.00000000,
-3.41578817
85-3.41578817,
+4.00000048
88+1.00000000,
-0.853947043
89-0.853947043,
+1.00000000
90cor
= getCor(cov, upp, stdinv
= 1 / std)
92+1.00000000,
-0.853947043
93-0.853947043,
+1.00000000
96+1.00000000,
-0.853947043
97-0.853947043,
+1.00000000
98cor
= getCor(cov, low, stdinv
= 1 / std)
100+1.00000000,
-0.853947043
101-0.853947043,
+1.00000000
103+4.00000000,
-3.41578817
104-3.41578817,
+4.00000000
106+4.00000000,
-3.41578817
107-3.41578817,
+4.00000000
115+2.00000000,
+2.00000000
118+4.00000000,
-1.81410193
119-1.81410193,
+3.99999976
122+1.00000000,
-0.453525543
123-0.453525543,
+1.00000000
124cor
= getCor(cov, upp, stdinv
= 1 / std)
126+1.00000000,
-0.453525484
127-0.453525484,
+1.00000000
130+1.00000000,
-0.453525543
131-0.453525543,
+1.00000000
132cor
= getCor(cov, low, stdinv
= 1 / std)
134+1.00000000,
-0.453525484
135-0.453525484,
+1.00000000
137+4.00000000,
-1.81410217
138-1.81410217,
+4.00000000
140+4.00000000,
-1.81410217
141-1.81410217,
+4.00000000
149+1.00000000,
+5.00000000,
+3.00000000,
+6.00000000,
+6.00000000,
+1.00000000,
+1.00000000
152+1.00000000,
-4.86804104,
+1.89701664,
-1.37734020,
+0.106371790,
+0.503054142,
-0.529540539
153-4.86804104,
+25.0000019,
-11.7432575,
+11.8509970,
+4.45921135,
-2.91629577,
+2.58521318
154+1.89701664,
-11.7432575,
+9.00000000,
-11.7150049,
-7.83632755,
+2.07326889,
-1.39819896
155-1.37734020,
+11.8509970,
-11.7150049,
+36.0000076,
+9.68124199,
-1.39010274,
+1.14766455
156+0.106371790,
+4.45921135,
-7.83632755,
+9.68124199,
+35.9999924,
-2.36941385,
-2.12545347
157+0.503054142,
-2.91629577,
+2.07326889,
-1.39010274,
-2.36941385,
+1.00000000,
-0.619132280
158-0.529540539,
+2.58521318,
-1.39819896,
+1.14766455,
-2.12545347,
-0.619132280,
+0.999999940
161+1.00000000,
-0.973608196,
+0.632338881,
-0.229556680,
+0.177286342E-1,
+0.503054142,
-0.529540598
162-0.973608196,
+1.00000000,
-0.782883883,
+0.395033211,
+0.148640409,
-0.583259165,
+0.517042696
163+0.632338881,
-0.782883883,
+1.00000000,
-0.650833547,
-0.435351580,
+0.691089630,
-0.466066390
164-0.229556680,
+0.395033211,
-0.650833547,
+1.00000000,
+0.268923402,
-0.231683776,
+0.191277429
165+0.177286342E-1,
+0.148640409,
-0.435351580,
+0.268923402,
+1.00000000,
-0.394902349,
-0.354242325
166+0.503054142,
-0.583259165,
+0.691089630,
-0.231683776,
-0.394902349,
+1.00000000,
-0.619132340
167-0.529540598,
+0.517042696,
-0.466066390,
+0.191277429,
-0.354242325,
-0.619132340,
+1.00000000
168cor
= getCor(cov, upp, stdinv
= 1 / std)
170+1.00000000,
-0.973608196,
+0.632338881,
-0.229556710,
+0.177286323E-1,
+0.503054142,
-0.529540539
171-0.973608196,
+1.00000000,
-0.782883883,
+0.395033240,
+0.148640379,
-0.583259165,
+0.517042637
172+0.632338881,
-0.782883883,
+1.00000000,
-0.650833666,
-0.435351551,
+0.691089630,
-0.466066331
173-0.229556710,
+0.395033240,
-0.650833666,
+1.00000000,
+0.268923402,
-0.231683791,
+0.191277429
174+0.177286323E-1,
+0.148640379,
-0.435351551,
+0.268923402,
+1.00000000,
-0.394902319,
-0.354242265
175+0.503054142,
-0.583259165,
+0.691089630,
-0.231683791,
-0.394902319,
+1.00000000,
-0.619132280
176-0.529540539,
+0.517042637,
-0.466066331,
+0.191277429,
-0.354242265,
-0.619132280,
+1.00000000
179+1.00000000,
-0.973608196,
+0.632338881,
-0.229556680,
+0.177286342E-1,
+0.503054142,
-0.529540598
180-0.973608196,
+1.00000000,
-0.782883883,
+0.395033211,
+0.148640409,
-0.583259165,
+0.517042696
181+0.632338881,
-0.782883883,
+1.00000000,
-0.650833547,
-0.435351580,
+0.691089630,
-0.466066390
182-0.229556680,
+0.395033211,
-0.650833547,
+1.00000000,
+0.268923402,
-0.231683776,
+0.191277429
183+0.177286342E-1,
+0.148640409,
-0.435351580,
+0.268923402,
+1.00000000,
-0.394902349,
-0.354242325
184+0.503054142,
-0.583259165,
+0.691089630,
-0.231683776,
-0.394902349,
+1.00000000,
-0.619132340
185-0.529540598,
+0.517042696,
-0.466066390,
+0.191277429,
-0.354242325,
-0.619132340,
+1.00000000
186cor
= getCor(cov, low, stdinv
= 1 / std)
188+1.00000000,
-0.973608196,
+0.632338881,
-0.229556710,
+0.177286323E-1,
+0.503054142,
-0.529540539
189-0.973608196,
+1.00000000,
-0.782883883,
+0.395033240,
+0.148640379,
-0.583259165,
+0.517042637
190+0.632338881,
-0.782883883,
+1.00000000,
-0.650833666,
-0.435351551,
+0.691089630,
-0.466066331
191-0.229556710,
+0.395033240,
-0.650833666,
+1.00000000,
+0.268923402,
-0.231683791,
+0.191277429
192+0.177286323E-1,
+0.148640379,
-0.435351551,
+0.268923402,
+1.00000000,
-0.394902319,
-0.354242265
193+0.503054142,
-0.583259165,
+0.691089630,
-0.231683791,
-0.394902319,
+1.00000000,
-0.619132280
194-0.529540539,
+0.517042637,
-0.466066331,
+0.191277429,
-0.354242265,
-0.619132280,
+1.00000000
196+1.00000000,
-4.86804104,
+1.89701664,
-1.37734008,
+0.106371805,
+0.503054142,
-0.529540598
197-4.86804104,
+25.0000000,
-11.7432585,
+11.8509960,
+4.45921230,
-2.91629577,
+2.58521342
198+1.89701664,
-11.7432585,
+9.00000000,
-11.7150040,
-7.83632851,
+2.07326889,
-1.39819920
199-1.37734008,
+11.8509960,
-11.7150040,
+36.0000000,
+9.68124199,
-1.39010262,
+1.14766455
200+0.106371805,
+4.45921230,
-7.83632851,
+9.68124199,
+36.0000000,
-2.36941409,
-2.12545395
201+0.503054142,
-2.91629577,
+2.07326889,
-1.39010262,
-2.36941409,
+1.00000000,
-0.619132340
202-0.529540598,
+2.58521342,
-1.39819920,
+1.14766455,
-2.12545395,
-0.619132340,
+1.00000000
204+1.00000000,
-4.86804104,
+1.89701664,
-1.37734008,
+0.106371805,
+0.503054142,
-0.529540598
205-4.86804104,
+25.0000000,
-11.7432585,
+11.8509960,
+4.45921230,
-2.91629577,
+2.58521342
206+1.89701664,
-11.7432585,
+9.00000000,
-11.7150040,
-7.83632851,
+2.07326889,
-1.39819920
207-1.37734008,
+11.8509960,
-11.7150040,
+36.0000000,
+9.68124199,
-1.39010262,
+1.14766455
208+0.106371805,
+4.45921230,
-7.83632851,
+9.68124199,
+36.0000000,
-2.36941409,
-2.12545395
209+0.503054142,
-2.91629577,
+2.07326889,
-1.39010262,
-2.36941409,
+1.00000000,
-0.619132340
210-0.529540598,
+2.58521342,
-1.39819920,
+1.14766455,
-2.12545395,
-0.619132340,
+1.00000000
218+3.00000000,
+2.00000000,
+2.00000000
221+9.00000000,
-4.02719975,
+0.983855188
222-4.02719975,
+3.99999952,
-2.94776940
223+0.983855188,
-2.94776940,
+3.99999976
226+1.00000000,
-0.671200037,
+0.163975880
227-0.671200037,
+1.00000000,
-0.736942530
228+0.163975880,
-0.736942530,
+1.00000000
229cor
= getCor(cov, upp, stdinv
= 1 / std)
231+1.00000000,
-0.671199977,
+0.163975865
232-0.671199977,
+1.00000000,
-0.736942351
233+0.163975865,
-0.736942351,
+1.00000000
236+1.00000000,
-0.671200037,
+0.163975880
237-0.671200037,
+1.00000000,
-0.736942530
238+0.163975880,
-0.736942530,
+1.00000000
239cor
= getCor(cov, low, stdinv
= 1 / std)
241+1.00000000,
-0.671199977,
+0.163975865
242-0.671199977,
+1.00000000,
-0.736942351
243+0.163975865,
-0.736942351,
+1.00000000
245+9.00000000,
-4.02720022,
+0.983855247
246-4.02720022,
+4.00000000,
-2.94777012
247+0.983855247,
-2.94777012,
+4.00000000
249+9.00000000,
-4.02720022,
+0.983855247
250-4.02720022,
+4.00000000,
-2.94777012
251+0.983855247,
-2.94777012,
+4.00000000
259+1.00000000,
+2.00000000
262+1.00000000,
+0.817710817
263+0.817710817,
+4.00000000
266+1.00000000,
+0.408855408
267+0.408855408,
+1.00000000
268cor
= getCor(cov, upp, stdinv
= 1 / std)
270+1.00000000,
+0.408855408
271+0.408855408,
+1.00000000
274+1.00000000,
+0.408855408
275+0.408855408,
+1.00000000
276cor
= getCor(cov, low, stdinv
= 1 / std)
278+1.00000000,
+0.408855408
279+0.408855408,
+1.00000000
281+1.00000000,
+0.817710817
282+0.817710817,
+4.00000000
284+1.00000000,
+0.817710817
285+0.817710817,
+4.00000000
293+1.00000000,
+1.00000000,
+1.00000000
296+1.00000000,
-0.839294791,
+0.697833478
297-0.839294791,
+1.00000000,
-0.262053370
298+0.697833478,
-0.262053370,
+1.00000012
301+1.00000000,
-0.839294791,
+0.697833478
302-0.839294791,
+1.00000000,
-0.262053370
303+0.697833478,
-0.262053370,
+1.00000000
304cor
= getCor(cov, upp, stdinv
= 1 / std)
306+1.00000000,
-0.839294791,
+0.697833478
307-0.839294791,
+1.00000000,
-0.262053370
308+0.697833478,
-0.262053370,
+1.00000000
311+1.00000000,
-0.839294791,
+0.697833478
312-0.839294791,
+1.00000000,
-0.262053370
313+0.697833478,
-0.262053370,
+1.00000000
314cor
= getCor(cov, low, stdinv
= 1 / std)
316+1.00000000,
-0.839294791,
+0.697833478
317-0.839294791,
+1.00000000,
-0.262053370
318+0.697833478,
-0.262053370,
+1.00000000
320+1.00000000,
-0.839294791,
+0.697833478
321-0.839294791,
+1.00000000,
-0.262053370
322+0.697833478,
-0.262053370,
+1.00000000
324+1.00000000,
-0.839294791,
+0.697833478
325-0.839294791,
+1.00000000,
-0.262053370
326+0.697833478,
-0.262053370,
+1.00000000
334+3.00000000,
+5.00000000,
+4.00000000,
+1.00000000,
+4.00000000
337+9.00000000,
+5.40125608,
+8.68678856,
-2.37290215,
-7.43177319
338+5.40125608,
+25.0000019,
+0.494687259,
-2.83118606,
+0.835105181
339+8.68678856,
+0.494687259,
+16.0000019,
-1.84764671,
-10.5330791
340-2.37290215,
-2.83118606,
-1.84764671,
+0.999999881,
+2.36803794
341-7.43177319,
+0.835105181,
-10.5330791,
+2.36803794,
+16.0000000
344+1.00000000,
+0.360083759,
+0.723899066,
-0.790967464,
-0.619314432
345+0.360083759,
+1.00000000,
+0.247343630E-1,
-0.566237330,
+0.417552590E-1
346+0.723899066,
+0.247343630E-1,
+1.00000000,
-0.461911738,
-0.658317447
347-0.790967464,
-0.566237330,
-0.461911738,
+1.00000000,
+0.592009544
348-0.619314432,
+0.417552590E-1,
-0.658317447,
+0.592009544,
+1.00000000
349cor
= getCor(cov, upp, stdinv
= 1 / std)
351+1.00000000,
+0.360083759,
+0.723899066,
-0.790967405,
-0.619314432
352+0.360083759,
+1.00000000,
+0.247343630E-1,
-0.566237211,
+0.417552590E-1
353+0.723899066,
+0.247343630E-1,
+1.00000000,
-0.461911678,
-0.658317447
354-0.790967405,
-0.566237211,
-0.461911678,
+1.00000000,
+0.592009485
355-0.619314432,
+0.417552590E-1,
-0.658317447,
+0.592009485,
+1.00000000
358+1.00000000,
+0.360083759,
+0.723899066,
-0.790967464,
-0.619314432
359+0.360083759,
+1.00000000,
+0.247343630E-1,
-0.566237330,
+0.417552590E-1
360+0.723899066,
+0.247343630E-1,
+1.00000000,
-0.461911738,
-0.658317447
361-0.790967464,
-0.566237330,
-0.461911738,
+1.00000000,
+0.592009544
362-0.619314432,
+0.417552590E-1,
-0.658317447,
+0.592009544,
+1.00000000
363cor
= getCor(cov, low, stdinv
= 1 / std)
365+1.00000000,
+0.360083759,
+0.723899066,
-0.790967405,
-0.619314432
366+0.360083759,
+1.00000000,
+0.247343630E-1,
-0.566237211,
+0.417552590E-1
367+0.723899066,
+0.247343630E-1,
+1.00000000,
-0.461911678,
-0.658317447
368-0.790967405,
-0.566237211,
-0.461911678,
+1.00000000,
+0.592009485
369-0.619314432,
+0.417552590E-1,
-0.658317447,
+0.592009485,
+1.00000000
371+9.00000000,
+5.40125656,
+8.68678856,
-2.37290239,
-7.43177319
372+5.40125656,
+25.0000000,
+0.494687259,
-2.83118677,
+0.835105181
373+8.68678856,
+0.494687259,
+16.0000000,
-1.84764695,
-10.5330791
374-2.37290239,
-2.83118677,
-1.84764695,
+1.00000000,
+2.36803818
375-7.43177319,
+0.835105181,
-10.5330791,
+2.36803818,
+16.0000000
377+9.00000000,
+5.40125656,
+8.68678856,
-2.37290239,
-7.43177319
378+5.40125656,
+25.0000000,
+0.494687259,
-2.83118677,
+0.835105181
379+8.68678856,
+0.494687259,
+16.0000000,
-1.84764695,
-10.5330791
380-2.37290239,
-2.83118677,
-1.84764695,
+1.00000000,
+2.36803818
381-7.43177319,
+0.835105181,
-10.5330791,
+2.36803818,
+16.0000000
389+2.00000000,
+2.00000000,
+1.00000000
392+4.00000000,
-3.08771920,
+1.40654802
393-3.08771920,
+3.99999976,
-0.253569245
394+1.40654802,
-0.253569245,
+1.00000000
397+1.00000000,
-0.771929920,
+0.703274012
398-0.771929920,
+1.00000000,
-0.126784638
399+0.703274012,
-0.126784638,
+1.00000000
400cor
= getCor(cov, upp, stdinv
= 1 / std)
402+1.00000000,
-0.771929801,
+0.703274012
403-0.771929801,
+1.00000000,
-0.126784623
404+0.703274012,
-0.126784623,
+1.00000000
407+1.00000000,
-0.771929920,
+0.703274012
408-0.771929920,
+1.00000000,
-0.126784638
409+0.703274012,
-0.126784638,
+1.00000000
410cor
= getCor(cov, low, stdinv
= 1 / std)
412+1.00000000,
-0.771929801,
+0.703274012
413-0.771929801,
+1.00000000,
-0.126784623
414+0.703274012,
-0.126784623,
+1.00000000
416+4.00000000,
-3.08771968,
+1.40654802
417-3.08771968,
+4.00000000,
-0.253569275
418+1.40654802,
-0.253569275,
+1.00000000
420+4.00000000,
-3.08771968,
+1.40654802
421-3.08771968,
+4.00000000,
-0.253569275
422+1.40654802,
-0.253569275,
+1.00000000
430+3.00000000,
+3.00000000,
+3.00000000
433+9.00000000,
-4.50277233,
-1.55142355
434-4.50277233,
+9.00000191,
+5.46954679
435-1.55142355,
+5.46954679,
+9.00000191
438+1.00000000,
-0.500307977,
-0.172380388
439-0.500307977,
+1.00000000,
+0.607727349
440-0.172380388,
+0.607727349,
+1.00000000
441cor
= getCor(cov, upp, stdinv
= 1 / std)
443+1.00000000,
-0.500308096,
-0.172380403
444-0.500308096,
+1.00000000,
+0.607727468
445-0.172380403,
+0.607727468,
+1.00000000
448+1.00000000,
-0.500307977,
-0.172380388
449-0.500307977,
+1.00000000,
+0.607727349
450-0.172380388,
+0.607727349,
+1.00000000
451cor
= getCor(cov, low, stdinv
= 1 / std)
453+1.00000000,
-0.500308096,
-0.172380403
454-0.500308096,
+1.00000000,
+0.607727468
455-0.172380403,
+0.607727468,
+1.00000000
457+9.00000000,
-4.50277185,
-1.55142355
458-4.50277185,
+9.00000000,
+5.46954632
459-1.55142355,
+5.46954632,
+9.00000000
461+9.00000000,
-4.50277185,
-1.55142355
462-4.50277185,
+9.00000000,
+5.46954632
463-1.55142355,
+5.46954632,
+9.00000000
472ndim
= 2; nsam
= 10; dim
= 2
473sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
475+5.000000E+00,
+2.000000E+01,
+7.000000E+00,
+1.400000E+01,
+1.400000E+01,
+2.000000E+00,
+1.000000E+01,
+1.700000E+01,
+1.300000E+01,
+1.600000E+01
476+6.000000E+00,
+1.900000E+01,
+8.000000E+00,
+9.000000E+00,
+3.000000E+00,
+2.000000E+01,
+1.200000E+01,
+1.500000E+01,
+1.900000E+01,
+1.600000E+01
479+1.180000E+01,
+1.270000E+01
482+1.000000E+00,
+1.737033E-01
483+1.737033E-01,
+1.000000E+00
485'Compute the sample correlation along the first dimension.'
488cor
= getCor(
transpose(sample), dim)
490+1.000000E+00,
+1.737033E-01
491+1.737033E-01,
+1.000000E+00
493'Compute the full sample correlation for a pair of time series.'
495cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:))
506ndim
= 2; nsam
= 10; dim
= 2
507sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
509+1.100000E+01,
+4.000000E+00,
+1.400000E+01,
+2.000000E+00,
+2.000000E+01,
+1.000000E+01,
+1.400000E+01,
+9.000000E+00,
+1.800000E+01,
+1.900000E+01
510+1.200000E+01,
+9.000000E+00,
+5.000000E+00,
+2.000000E+01,
+1.100000E+01,
+1.000000E+01,
+1.100000E+01,
+4.000000E+00,
+1.500000E+01,
+1.200000E+01
514+10,
+10,
+4,
+6,
+2,
+1,
+9,
+10,
+3,
+5
515call setMean(mean, sample, dim, iweight, iweisum)
517+10.5500002,
+10.4333344
522+10,
+10,
+4,
+6,
+2,
+1,
+9,
+10,
+3,
+5
523call setMean(mean, sample, dim, rweight, rweisum)
525+1.055000E+01,
+1.043333E+01
533cor
= getCor(sample, dim, iweight)
535+1.000000E+00,
-1.158815E-01
536-1.158815E-01,
+1.000000E+00
538'Compute the sample correlation along the first dimension.'
541cor
= getCor(
transpose(sample), dim, iweight)
543+1.000000E+00,
-1.158815E-01
544-1.158815E-01,
+1.000000E+00
546'Compute the full sample correlation for a pair of time series.'
548cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:), iweight)
558cor
= getCor(sample, dim, rweight)
560+1.000000E+00,
-1.158815E-01
561-1.158815E-01,
+1.000000E+00
563'Compute the sample correlation along the first dimension.'
566cor
= getCor(
transpose(sample), dim, rweight)
568+1.000000E+00,
-1.158815E-01
569-1.158815E-01,
+1.000000E+00
571'Compute the full sample correlation for a pair of time series.'
573cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:), rweight)