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.
19cor
= getCor(cov, upp, stdinv
= 1 / std)
25cor
= getCor(cov, low, stdinv
= 1 / std)
39+4.00000000,
+4.00000000,
+3.00000000,
+5.00000000,
+2.00000000
42+16.0000000,
-3.50091743,
-9.06825066,
+7.43039036,
+5.47583580
43-3.50091743,
+16.0000000,
-4.15841007,
-8.57373238,
-4.47891235
44-9.06825066,
-4.15841007,
+9.00000191,
-5.13605833,
-1.18745136
45+7.43039036,
-8.57373238,
-5.13605833,
+25.0000000,
+5.46598053
46+5.47583580,
-4.47891235,
-1.18745136,
+5.46598053,
+3.99999976
49+1.00000000,
-0.218807340,
-0.755687535,
+0.371519536,
+0.684479535
50-0.218807340,
+1.00000000,
-0.346534163,
-0.428686619,
-0.559864104
51-0.755687535,
-0.346534163,
+1.00000000,
-0.342403859,
-0.197908565
52+0.371519536,
-0.428686619,
-0.342403859,
+1.00000000,
+0.546598136
53+0.684479535,
-0.559864104,
-0.197908565,
+0.546598136,
+1.00000000
54cor
= getCor(cov, upp, stdinv
= 1 / std)
56+1.00000000,
-0.218807340,
-0.755687594,
+0.371519536,
+0.684479475
57-0.218807340,
+1.00000000,
-0.346534193,
-0.428686619,
-0.559864044
58-0.755687594,
-0.346534193,
+1.00000000,
-0.342403919,
-0.197908565
59+0.371519536,
-0.428686619,
-0.342403919,
+1.00000000,
+0.546598077
60+0.684479475,
-0.559864044,
-0.197908565,
+0.546598077,
+1.00000000
63+1.00000000,
-0.218807340,
-0.755687535,
+0.371519536,
+0.684479535
64-0.218807340,
+1.00000000,
-0.346534163,
-0.428686619,
-0.559864104
65-0.755687535,
-0.346534163,
+1.00000000,
-0.342403859,
-0.197908565
66+0.371519536,
-0.428686619,
-0.342403859,
+1.00000000,
+0.546598136
67+0.684479535,
-0.559864104,
-0.197908565,
+0.546598136,
+1.00000000
68cor
= getCor(cov, low, stdinv
= 1 / std)
70+1.00000000,
-0.218807340,
-0.755687594,
+0.371519536,
+0.684479475
71-0.218807340,
+1.00000000,
-0.346534193,
-0.428686619,
-0.559864044
72-0.755687594,
-0.346534193,
+1.00000000,
-0.342403919,
-0.197908565
73+0.371519536,
-0.428686619,
-0.342403919,
+1.00000000,
+0.546598077
74+0.684479475,
-0.559864044,
-0.197908565,
+0.546598077,
+1.00000000
76+16.0000000,
-3.50091743,
-9.06825066,
+7.43039083,
+5.47583628
77-3.50091743,
+16.0000000,
-4.15841007,
-8.57373238,
-4.47891283
78-9.06825066,
-4.15841007,
+9.00000000,
-5.13605785,
-1.18745136
79+7.43039083,
-8.57373238,
-5.13605785,
+25.0000000,
+5.46598148
80+5.47583628,
-4.47891283,
-1.18745136,
+5.46598148,
+4.00000000
82+16.0000000,
-3.50091743,
-9.06825066,
+7.43039083,
+5.47583628
83-3.50091743,
+16.0000000,
-4.15841007,
-8.57373238,
-4.47891283
84-9.06825066,
-4.15841007,
+9.00000000,
-5.13605785,
-1.18745136
85+7.43039083,
-8.57373238,
-5.13605785,
+25.0000000,
+5.46598148
86+5.47583628,
-4.47891283,
-1.18745136,
+5.46598148,
+4.00000000
94+3.00000000,
+3.00000000,
+3.00000000,
+5.00000000,
+3.00000000
97+9.00000000,
+6.81052399,
+6.75230598,
+11.4625969,
+0.963286519
98+6.81052399,
+8.99999905,
+8.17658234,
+6.70068026,
-2.21397209
99+6.75230598,
+8.17658234,
+9.00000000,
+6.10922766,
-3.61728859
100+11.4625969,
+6.70068026,
+6.10922766,
+24.9999981,
-1.81004620
101+0.963286519,
-2.21397209,
-3.61728859,
-1.81004620,
+9.00000191
104+1.00000000,
+0.756725013,
+0.750256300,
+0.764173150,
+0.107031830
105+0.756725013,
+1.00000000,
+0.908509254,
+0.446712077,
-0.245996922
106+0.750256300,
+0.908509254,
+1.00000000,
+0.407281876,
-0.401920944
107+0.764173150,
+0.446712077,
+0.407281876,
+1.00000000,
-0.120669737
108+0.107031830,
-0.245996922,
-0.401920944,
-0.120669737,
+1.00000000
109cor
= getCor(cov, upp, stdinv
= 1 / std)
111+1.00000000,
+0.756724954,
+0.750256300,
+0.764173150,
+0.107031845
112+0.756724954,
+1.00000000,
+0.908509195,
+0.446712047,
-0.245996922
113+0.750256300,
+0.908509195,
+1.00000000,
+0.407281876,
-0.401920974
114+0.764173150,
+0.446712047,
+0.407281876,
+1.00000000,
-0.120669752
115+0.107031845,
-0.245996922,
-0.401920974,
-0.120669752,
+1.00000000
118+1.00000000,
+0.756725013,
+0.750256300,
+0.764173150,
+0.107031830
119+0.756725013,
+1.00000000,
+0.908509254,
+0.446712077,
-0.245996922
120+0.750256300,
+0.908509254,
+1.00000000,
+0.407281876,
-0.401920944
121+0.764173150,
+0.446712077,
+0.407281876,
+1.00000000,
-0.120669737
122+0.107031830,
-0.245996922,
-0.401920944,
-0.120669737,
+1.00000000
123cor
= getCor(cov, low, stdinv
= 1 / std)
125+1.00000000,
+0.756724954,
+0.750256300,
+0.764173150,
+0.107031845
126+0.756724954,
+1.00000000,
+0.908509195,
+0.446712047,
-0.245996922
127+0.750256300,
+0.908509195,
+1.00000000,
+0.407281876,
-0.401920974
128+0.764173150,
+0.446712047,
+0.407281876,
+1.00000000,
-0.120669752
129+0.107031845,
-0.245996922,
-0.401920974,
-0.120669752,
+1.00000000
131+9.00000000,
+6.81052494,
+6.75230694,
+11.4625969,
+0.963286459
132+6.81052494,
+9.00000000,
+8.17658329,
+6.70068121,
-2.21397233
133+6.75230694,
+8.17658329,
+9.00000000,
+6.10922813,
-3.61728859
134+11.4625969,
+6.70068121,
+6.10922813,
+25.0000000,
-1.81004608
135+0.963286459,
-2.21397233,
-3.61728859,
-1.81004608,
+9.00000000
137+9.00000000,
+6.81052494,
+6.75230694,
+11.4625969,
+0.963286459
138+6.81052494,
+9.00000000,
+8.17658329,
+6.70068121,
-2.21397233
139+6.75230694,
+8.17658329,
+9.00000000,
+6.10922813,
-3.61728859
140+11.4625969,
+6.70068121,
+6.10922813,
+25.0000000,
-1.81004608
141+0.963286459,
-2.21397233,
-3.61728859,
-1.81004608,
+9.00000000
149+1.00000000,
+2.00000000,
+1.00000000
152+1.00000000,
+1.36172950,
+0.170969695
153+1.36172950,
+4.00000000,
-0.695341766
154+0.170969695,
-0.695341766,
+0.999999881
157+1.00000000,
+0.680864751,
+0.170969710
158+0.680864751,
+1.00000000,
-0.347670913
159+0.170969710,
-0.347670913,
+1.00000000
160cor
= getCor(cov, upp, stdinv
= 1 / std)
162+1.00000000,
+0.680864751,
+0.170969695
163+0.680864751,
+1.00000000,
-0.347670883
164+0.170969695,
-0.347670883,
+1.00000000
167+1.00000000,
+0.680864751,
+0.170969710
168+0.680864751,
+1.00000000,
-0.347670913
169+0.170969710,
-0.347670913,
+1.00000000
170cor
= getCor(cov, low, stdinv
= 1 / std)
172+1.00000000,
+0.680864751,
+0.170969695
173+0.680864751,
+1.00000000,
-0.347670883
174+0.170969695,
-0.347670883,
+1.00000000
176+1.00000000,
+1.36172950,
+0.170969710
177+1.36172950,
+4.00000000,
-0.695341825
178+0.170969710,
-0.695341825,
+1.00000000
180+1.00000000,
+1.36172950,
+0.170969710
181+1.36172950,
+4.00000000,
-0.695341825
182+0.170969710,
-0.695341825,
+1.00000000
190+1.00000000,
+2.00000000,
+2.00000000
193+1.00000000,
+1.75050652,
+1.39740634
194+1.75050652,
+4.00000000,
+3.81495476
195+1.39740634,
+3.81495476,
+4.00000048
198+1.00000000,
+0.875253260,
+0.698703170
199+0.875253260,
+1.00000000,
+0.953738689
200+0.698703170,
+0.953738689,
+1.00000000
201cor
= getCor(cov, upp, stdinv
= 1 / std)
203+1.00000000,
+0.875253260,
+0.698703170
204+0.875253260,
+1.00000000,
+0.953738689
205+0.698703170,
+0.953738689,
+1.00000000
208+1.00000000,
+0.875253260,
+0.698703170
209+0.875253260,
+1.00000000,
+0.953738689
210+0.698703170,
+0.953738689,
+1.00000000
211cor
= getCor(cov, low, stdinv
= 1 / std)
213+1.00000000,
+0.875253260,
+0.698703170
214+0.875253260,
+1.00000000,
+0.953738689
215+0.698703170,
+0.953738689,
+1.00000000
217+1.00000000,
+1.75050652,
+1.39740634
218+1.75050652,
+4.00000000,
+3.81495476
219+1.39740634,
+3.81495476,
+4.00000000
221+1.00000000,
+1.75050652,
+1.39740634
222+1.75050652,
+4.00000000,
+3.81495476
223+1.39740634,
+3.81495476,
+4.00000000
236cor
= getCor(cov, upp, stdinv
= 1 / std)
240cor
= getCor(cov, low, stdinv
= 1 / std)
251+2.00000000,
+5.00000000,
+6.00000000,
+2.00000000,
+2.00000000,
+1.00000000
254+3.99999952,
+7.70508003,
-6.53893089,
+1.20600760,
-1.48390090,
+0.696430922
255+7.70508003,
+24.9999962,
-7.74564838,
+3.88635874,
-6.25388718,
-0.214107186
256-6.53893089,
-7.74564838,
+36.0000000,
+4.85372639,
-4.11909485,
+0.917261839E-2
257+1.20600760,
+3.88635874,
+4.85372639,
+4.00000000,
-3.05074596,
+0.534889698
258-1.48390090,
-6.25388718,
-4.11909485,
-3.05074596,
+3.99999952,
-0.616045356
259+0.696430922,
-0.214107186,
+0.917261839E-2,
+0.534889698,
-0.616045356,
+1.00000000
262+1.00000000,
+0.770508170,
-0.544910967,
+0.301501930,
-0.370975316,
+0.348215491
263+0.770508170,
+1.00000000,
-0.258188307,
+0.388635904,
-0.625388861,
-0.428214408E-1
264-0.544910967,
-0.258188307,
+1.00000000,
+0.404477209,
-0.343257934,
+0.152876973E-2
265+0.301501930,
+0.388635904,
+0.404477209,
+1.00000000,
-0.762686610,
+0.267444849
266-0.370975316,
-0.625388861,
-0.343257934,
-0.762686610,
+1.00000000,
-0.308022708
267+0.348215491,
-0.428214408E-1,
+0.152876973E-2,
+0.267444849,
-0.308022708,
+1.00000000
268cor
= getCor(cov, upp, stdinv
= 1 / std)
270+1.00000000,
+0.770507991,
-0.544910908,
+0.301501900,
-0.370975226,
+0.348215461
271+0.770507991,
+1.00000000,
-0.258188307,
+0.388635874,
-0.625388741,
-0.428214371E-1
272-0.544910908,
-0.258188307,
+1.00000000,
+0.404477209,
-0.343257904,
+0.152876973E-2
273+0.301501900,
+0.388635874,
+0.404477209,
+1.00000000,
-0.762686491,
+0.267444849
274-0.370975226,
-0.625388741,
-0.343257904,
-0.762686491,
+1.00000000,
-0.308022678
275+0.348215461,
-0.428214371E-1,
+0.152876973E-2,
+0.267444849,
-0.308022678,
+1.00000000
278+1.00000000,
+0.770508170,
-0.544910967,
+0.301501930,
-0.370975316,
+0.348215491
279+0.770508170,
+1.00000000,
-0.258188307,
+0.388635904,
-0.625388861,
-0.428214408E-1
280-0.544910967,
-0.258188307,
+1.00000000,
+0.404477209,
-0.343257934,
+0.152876973E-2
281+0.301501930,
+0.388635904,
+0.404477209,
+1.00000000,
-0.762686610,
+0.267444849
282-0.370975316,
-0.625388861,
-0.343257934,
-0.762686610,
+1.00000000,
-0.308022708
283+0.348215491,
-0.428214408E-1,
+0.152876973E-2,
+0.267444849,
-0.308022708,
+1.00000000
284cor
= getCor(cov, low, stdinv
= 1 / std)
286+1.00000000,
+0.770507991,
-0.544910908,
+0.301501900,
-0.370975226,
+0.348215461
287+0.770507991,
+1.00000000,
-0.258188307,
+0.388635874,
-0.625388741,
-0.428214371E-1
288-0.544910908,
-0.258188307,
+1.00000000,
+0.404477209,
-0.343257904,
+0.152876973E-2
289+0.301501900,
+0.388635874,
+0.404477209,
+1.00000000,
-0.762686491,
+0.267444849
290-0.370975226,
-0.625388741,
-0.343257904,
-0.762686491,
+1.00000000,
-0.308022678
291+0.348215461,
-0.428214371E-1,
+0.152876973E-2,
+0.267444849,
-0.308022678,
+1.00000000
293+4.00000000,
+7.70508194,
-6.53893185,
+1.20600772,
-1.48390126,
+0.696430981
294+7.70508194,
+25.0000000,
-7.74564934,
+3.88635898,
-6.25388861,
-0.214107201
295-6.53893185,
-7.74564934,
+36.0000000,
+4.85372639,
-4.11909533,
+0.917261839E-2
296+1.20600772,
+3.88635898,
+4.85372639,
+4.00000000,
-3.05074644,
+0.534889698
297-1.48390126,
-6.25388861,
-4.11909533,
-3.05074644,
+4.00000000,
-0.616045415
298+0.696430981,
-0.214107201,
+0.917261839E-2,
+0.534889698,
-0.616045415,
+1.00000000
300+4.00000000,
+7.70508194,
-6.53893185,
+1.20600772,
-1.48390126,
+0.696430981
301+7.70508194,
+25.0000000,
-7.74564934,
+3.88635898,
-6.25388861,
-0.214107201
302-6.53893185,
-7.74564934,
+36.0000000,
+4.85372639,
-4.11909533,
+0.917261839E-2
303+1.20600772,
+3.88635898,
+4.85372639,
+4.00000000,
-3.05074644,
+0.534889698
304-1.48390126,
-6.25388861,
-4.11909533,
-3.05074644,
+4.00000000,
-0.616045415
305+0.696430981,
-0.214107201,
+0.917261839E-2,
+0.534889698,
-0.616045415,
+1.00000000
320cor
= getCor(cov, upp, stdinv
= 1 / std)
326cor
= getCor(cov, low, stdinv
= 1 / std)
340+3.00000000,
+1.00000000,
+4.00000000,
+4.00000000
343+9.00000000,
-2.91477394,
+9.95705700,
+3.87634468
344-2.91477394,
+1.00000000,
-2.91490459,
-1.73088920
345+9.95705700,
-2.91490459,
+16.0000000,
+4.95686865
346+3.87634468,
-1.73088920,
+4.95686865,
+16.0000000
349+1.00000000,
-0.971591353,
+0.829754770,
+0.323028743
350-0.971591353,
+1.00000000,
-0.728726149,
-0.432722300
351+0.829754770,
-0.728726149,
+1.00000000,
+0.309804291
352+0.323028743,
-0.432722300,
+0.309804291,
+1.00000000
353cor
= getCor(cov, upp, stdinv
= 1 / std)
355+1.00000000,
-0.971591353,
+0.829754770,
+0.323028743
356-0.971591353,
+1.00000000,
-0.728726149,
-0.432722300
357+0.829754770,
-0.728726149,
+1.00000000,
+0.309804291
358+0.323028743,
-0.432722300,
+0.309804291,
+1.00000000
361+1.00000000,
-0.971591353,
+0.829754770,
+0.323028743
362-0.971591353,
+1.00000000,
-0.728726149,
-0.432722300
363+0.829754770,
-0.728726149,
+1.00000000,
+0.309804291
364+0.323028743,
-0.432722300,
+0.309804291,
+1.00000000
365cor
= getCor(cov, low, stdinv
= 1 / std)
367+1.00000000,
-0.971591353,
+0.829754770,
+0.323028743
368-0.971591353,
+1.00000000,
-0.728726149,
-0.432722300
369+0.829754770,
-0.728726149,
+1.00000000,
+0.309804291
370+0.323028743,
-0.432722300,
+0.309804291,
+1.00000000
372+9.00000000,
-2.91477394,
+9.95705700,
+3.87634492
373-2.91477394,
+1.00000000,
-2.91490459,
-1.73088920
374+9.95705700,
-2.91490459,
+16.0000000,
+4.95686865
375+3.87634492,
-1.73088920,
+4.95686865,
+16.0000000
377+9.00000000,
-2.91477394,
+9.95705700,
+3.87634492
378-2.91477394,
+1.00000000,
-2.91490459,
-1.73088920
379+9.95705700,
-2.91490459,
+16.0000000,
+4.95686865
380+3.87634492,
-1.73088920,
+4.95686865,
+16.0000000
388+1.00000000,
+3.00000000,
+2.00000000
391+1.00000000,
+2.09673786,
+1.46986127
392+2.09673786,
+9.00000191,
+0.369257390
393+1.46986127,
+0.369257390,
+4.00000048
396+1.00000000,
+0.698912561,
+0.734930634
397+0.698912561,
+1.00000000,
+0.615428947E-1
398+0.734930634,
+0.615428947E-1,
+1.00000000
399cor
= getCor(cov, upp, stdinv
= 1 / std)
401+1.00000000,
+0.698912621,
+0.734930634
402+0.698912621,
+1.00000000,
+0.615428984E-1
403+0.734930634,
+0.615428984E-1,
+1.00000000
406+1.00000000,
+0.698912561,
+0.734930634
407+0.698912561,
+1.00000000,
+0.615428947E-1
408+0.734930634,
+0.615428947E-1,
+1.00000000
409cor
= getCor(cov, low, stdinv
= 1 / std)
411+1.00000000,
+0.698912621,
+0.734930634
412+0.698912621,
+1.00000000,
+0.615428984E-1
413+0.734930634,
+0.615428984E-1,
+1.00000000
415+1.00000000,
+2.09673762,
+1.46986127
416+2.09673762,
+9.00000000,
+0.369257361
417+1.46986127,
+0.369257361,
+4.00000000
419+1.00000000,
+2.09673762,
+1.46986127
420+2.09673762,
+9.00000000,
+0.369257361
421+1.46986127,
+0.369257361,
+4.00000000
430ndim
= 2; nsam
= 10; dim
= 2
431sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
433+1.000000E+00,
+1.600000E+01,
+1.500000E+01,
+2.000000E+00,
+2.000000E+01,
+1.900000E+01,
+1.000000E+01,
+1.400000E+01,
+4.000000E+00,
+1.800000E+01
434+1.600000E+01,
+1.700000E+01,
+1.200000E+01,
+1.700000E+01,
+1.000000E+00,
+1.700000E+01,
+4.000000E+00,
+3.000000E+00,
+1.700000E+01,
+1.000000E+01
437+1.190000E+01,
+1.140000E+01
440+1.000000E+00,
-4.297788E-01
441-4.297788E-01,
+1.000000E+00
443'Compute the sample correlation along the first dimension.'
446cor
= getCor(
transpose(sample), dim)
448+1.000000E+00,
-4.297788E-01
449-4.297788E-01,
+1.000000E+00
451'Compute the full sample correlation for a pair of time series.'
453cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:))
464ndim
= 2; nsam
= 10; dim
= 2
465sample
= reshape(
getUnifRand(
1,
20, ndim
* nsam), shape
= [ndim, nsam], order
= [
2,
1])
467+4.000000E+00,
+5.000000E+00,
+1.600000E+01,
+1.400000E+01,
+1.000000E+01,
+2.000000E+00,
+4.000000E+00,
+1.900000E+01,
+4.000000E+00,
+2.000000E+00
468+1.100000E+01,
+1.600000E+01,
+3.000000E+00,
+7.000000E+00,
+1.100000E+01,
+1.300000E+01,
+7.000000E+00,
+2.000000E+00,
+4.000000E+00,
+1.700000E+01
472+10,
+10,
+8,
+2,
+1,
+8,
+10,
+2,
+4,
+9
473call setMean(mean, sample, dim, iweight, iweisum)
475+6.00000000,
+10.4062500
480+10,
+10,
+8,
+2,
+1,
+8,
+10,
+2,
+4,
+9
481call setMean(mean, sample, dim, rweight, rweisum)
483+6.000000E+00,
+1.040625E+01
491cor
= getCor(sample, dim, iweight)
493+1.000000E+00,
-6.849387E-01
494-6.849387E-01,
+1.000000E+00
496'Compute the sample correlation along the first dimension.'
499cor
= getCor(
transpose(sample), dim, iweight)
501+1.000000E+00,
-6.849387E-01
502-6.849387E-01,
+1.000000E+00
504'Compute the full sample correlation for a pair of time series.'
506cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:), iweight)
516cor
= getCor(sample, dim, rweight)
518+1.000000E+00,
-6.849387E-01
519-6.849387E-01,
+1.000000E+00
521'Compute the sample correlation along the first dimension.'
524cor
= getCor(
transpose(sample), dim, rweight)
526+1.000000E+00,
-6.849387E-01
527-6.849387E-01,
+1.000000E+00
529'Compute the full sample correlation for a pair of time series.'
531cor(
1,
1)
= getCor(sample(
1,:), sample(
2,:), rweight)