Skip to content

Commit 0c7f85b

Browse files
committed
function or script not identified adequately in FileExchange
1 parent f7f27dc commit 0c7f85b

38 files changed

+1361
-119
lines changed

core/asymp_dtf.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%% ASYMP_DTF
2-
% Compute DTF connectivity measures magnitude, from series j--> i, for
3-
% any of three of metrics -- Euclidean, diagonal and information --
2+
% Compute DTF connectivity measures magnitude, from series j-->i, for
3+
% any of three of metrics --- Euclidean, diagonal and information ---
44
% as well as asymptotic statistics from vector autoregressive (VAR)
55
% coefficients in the frequency domain.
66
%
@@ -102,6 +102,8 @@
102102
% (C) Koichi Sameshima & Luiz A. Baccalá, 2022.
103103
% See file license.txt in installation directory for licensing terms.
104104

105+
%%
106+
105107
function c = asymp_dtf(u,A,pf,nFreqs,metric,alpha)
106108

107109
if ~(nargin == 6)

core/asymp_pdc.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@
116116
% (C) Koichi Sameshima & Luiz A. Baccalá, 2022.
117117
% See file license.txt in installation directory for licensing terms.
118118

119+
%%
120+
119121
function c = asymp_pdc(u,A,pf,nFreqs,metric,alpha)
120122

121123
if nargin < 6
@@ -373,8 +375,8 @@
373375
%
374376
end
375377

376-
%%
377-
% Subfunctions
378+
379+
%% Subfunctions
378380
%
379381

380382
%==========================================================================

core/dtf_alg.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
% (C) Koichi Sameshima & Luiz A. Baccalá, 2022.
5656
% See file license.txt in installation directory for licensing terms.
5757

58-
58+
%%
5959

6060
function c = dtf_alg(u,nFreqs,metric,alg,criterion,maxIP,alpha)
6161

core/gct_alg.m

+12-3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
end
8080
end
8181

82+
%% Subfunctions
83+
%
84+
85+
%==========================================================================
8286
function [Tr,Va,v,th,pValue]=granmatx(b,G,SU,significance)
8387

8488
% function [Tr,Va,v,th,pValue]=granmatx(b,G,SU);
@@ -115,11 +119,11 @@
115119
end
116120
end
117121

118-
122+
%%
119123
% =========================================================================
120124

121125
function [y,value,v,th,pValue]=grangt(CO,b,G,SU,significance)
122-
%%% Function GRANGT for Granger Causality Test
126+
% Function GRANGT for Granger Causality Test
123127
%function [y,value,v,th,pValue]=grangt(CO,b,G,SU,significance);
124128
%
125129
% Causality test
@@ -166,7 +170,7 @@
166170
pValue = 1 - chi2cdf(value,v);
167171
end
168172

169-
173+
%%
170174
%==========================================================================
171175

172176
function [Tr,Va,v,th,pValue]=granmaty(pf,N,significance)
@@ -211,7 +215,9 @@
211215
end
212216
end
213217

218+
%%
214219
%==========================================================================
220+
215221
function [y,value,v,th,pValue]=instata(CO,pf,N,significance)
216222
% Test for instataneous causality
217223
% input: CO - matrix describing the structure for testing - 1 position to test.
@@ -248,6 +254,7 @@
248254
pValue = 1-chi2cdf(value,v); % p-value of instantaneous Granger causality test
249255
end
250256

257+
%%
251258
%==========================================================================
252259
%
253260
% 01/30/1998 - L.A.B.
@@ -279,6 +286,7 @@
279286
end
280287
end
281288

289+
%%
282290
%==========================================================================
283291
% VECH or VEC is matrix column stacking operator function
284292
%
@@ -297,6 +305,7 @@
297305
end
298306
end
299307

308+
%%
300309
%==========================================================================
301310
% Computation of Z - data structure (no estimation of the mean)
302311
%

core/html/arfitcaps.html

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
2+
<!DOCTYPE html
3+
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4+
<html><head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6+
<!--
7+
This HTML was auto-generated from MATLAB code.
8+
To make changes, update the MATLAB code and republish this document.
9+
--><title>ARFITCAPS</title><meta name="generator" content="MATLAB 9.8"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-10-06"><meta name="DC.source" content="arfitcaps.m"><style type="text/css">
10+
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
11+
12+
html { min-height:100%; margin-bottom:1px; }
13+
html body { height:100%; margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000; line-height:140%; background:#fff none; overflow-y:scroll; }
14+
html body td { vertical-align:top; text-align:left; }
15+
16+
h1 { padding:0px; margin:0px 0px 25px; font-family:Arial, Helvetica, sans-serif; font-size:1.5em; color:#d55000; line-height:100%; font-weight:normal; }
17+
h2 { padding:0px; margin:0px 0px 8px; font-family:Arial, Helvetica, sans-serif; font-size:1.2em; color:#000; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; }
18+
h3 { padding:0px; margin:0px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:1.1em; color:#000; font-weight:bold; line-height:140%; }
19+
20+
a { color:#005fce; text-decoration:none; }
21+
a:hover { color:#005fce; text-decoration:underline; }
22+
a:visited { color:#004aa0; text-decoration:none; }
23+
24+
p { padding:0px; margin:0px 0px 20px; }
25+
img { padding:0px; margin:0px 0px 20px; border:none; }
26+
p img, pre img, tt img, li img, h1 img, h2 img { margin-bottom:0px; }
27+
28+
ul { padding:0px; margin:0px 0px 20px 23px; list-style:square; }
29+
ul li { padding:0px; margin:0px 0px 7px 0px; }
30+
ul li ul { padding:5px 0px 0px; margin:0px 0px 7px 23px; }
31+
ul li ol li { list-style:decimal; }
32+
ol { padding:0px; margin:0px 0px 20px 0px; list-style:decimal; }
33+
ol li { padding:0px; margin:0px 0px 7px 23px; list-style-type:decimal; }
34+
ol li ol { padding:5px 0px 0px; margin:0px 0px 7px 0px; }
35+
ol li ol li { list-style-type:lower-alpha; }
36+
ol li ul { padding-top:7px; }
37+
ol li ul li { list-style:square; }
38+
39+
.content { font-size:1.2em; line-height:140%; padding: 20px; }
40+
41+
pre, code { font-size:12px; }
42+
tt { font-size: 1.2em; }
43+
pre { margin:0px 0px 20px; }
44+
pre.codeinput { padding:10px; border:1px solid #d3d3d3; background:#f7f7f7; }
45+
pre.codeoutput { padding:10px 11px; margin:0px 0px 20px; color:#4c4c4c; }
46+
pre.error { color:red; }
47+
48+
@media print { pre.codeinput, pre.codeoutput { word-wrap:break-word; width:100%; } }
49+
50+
span.keyword { color:#0000FF }
51+
span.comment { color:#228B22 }
52+
span.string { color:#A020F0 }
53+
span.untermstring { color:#B20000 }
54+
span.syscmd { color:#B28C00 }
55+
span.typesection { color:#A0522D }
56+
57+
.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }
58+
.footer p { margin:0px; }
59+
.footer a { color:#878787; }
60+
.footer a:hover { color:#878787; text-decoration:underline; }
61+
.footer a:visited { color:#878787; }
62+
63+
table th { padding:7px 5px; text-align:left; vertical-align:middle; border: 1px solid #d6d4d4; font-weight:bold; }
64+
table td { padding:7px 5px; text-align:left; vertical-align:top; border:1px solid #d6d4d4; }
65+
66+
67+
68+
69+
70+
</style></head><body><div class="content"><h1>ARFITCAPS</h1><!--introduction--><pre> Capsule function to call the arfit.m routine, part of
71+
"ARfit: Multivariate Autoregressive Model Fitting" package.</pre><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Syntax:</a></li><li><a href="#2">Input Arguments</a></li><li><a href="#3">Output Arguments</a></li><li><a href="#4">Description:</a></li><li><a href="#5">Note: As described by the authors, acf.m in ARfit needs Signal Processing</a></li><li><a href="#6">See also: ARFIT, MVAR, MCARNS, MCARVM, CMLSM</a></li></ul></div><h2 id="1">Syntax:</h2><pre> [pf,A,ef] = ARFITCAPS(u,IP)</pre><h2 id="2">Input Arguments</h2><pre class="language-matlab">u: time series
72+
IP: VAR model <span class="string">order</span>
73+
</pre><h2 id="3">Output Arguments</h2><pre class="language-matlab">pf: covariance matrix <span class="string">provided</span> <span class="string">by</span> <span class="string">ARFIT</span> <span class="string">routine</span>
74+
A: AR estimate <span class="string">matrix</span> <span class="string">provided</span> <span class="string">by</span> <span class="string">ARFIT</span> <span class="string">routine</span>
75+
ef: forward residuals <span class="string">provided</span> <span class="string">by</span> <span class="string">ARRES</span> <span class="string">routine</span>
76+
</pre><h2 id="4">Description:</h2><p>ARFITCAPS is capsule that calls arfit.m and arres.m routines, part of Autoregressive Model Fitting" package, which implements algorithms as described in the following articles:</p><pre> [1] Neumaier A &amp; Schneider T, 2001. Estimation of parameters and
77+
eigenmodes of multivariate autoregressive models. ACM Trans Math
78+
Softw, 27:27-57.
79+
[2] Schneider T &amp; Neumaier A, 2001. Algorithm 808: ARfit - A Matlab
80+
package for the estimation of parameters and eigenmodes of multivariate
81+
autoregressive models. ACM Trans Math Softw, 27:58-65.</pre><pre>If you are interested in using ARfit algorithm for VAR model estimation, we
82+
advise you to get the software from Tapio Schneider's website at
83+
https://climate-dynamics.org/software/#arfit
84+
or from Mathworks.com File Exchange site (verified on August 27, 2021, but
85+
not tested)
86+
https://www.mathworks.com/matlabcentral/fileexchange/174-arfit,</pre><pre>and, before using it, verify the license terms, it seems to be a copyrighted
87+
material by the Association for Computing Machinery, Inc.</pre><h2 id="5">Note: As described by the authors, acf.m in ARfit needs Signal Processing</h2><pre>Toolbox (TM), as it requires XCORR, a cross-correlation function estimator.</pre><pre>ARfit availability was checked on August 13, 2015, and August 27, 2021. KS</pre><pre>The version we have tested and included was obtained on February 24, 2011 from
88+
www.gps.caltech.edu/~tapio/arfit/index.html,
89+
which is now obsolete.</pre><h2 id="6">See also: ARFIT, MVAR, MCARNS, MCARVM, CMLSM</h2><pre class="codeinput"><span class="comment">% (C) Koichi Sameshima &amp; Luiz A. Baccal&aacute;, 2022.</span>
90+
<span class="comment">% See file license.txt in installation directory for licensing terms.</span>
91+
</pre><pre class="codeinput"><span class="keyword">function</span> [pf,A,ef] = arfitcaps(u,IP)
92+
93+
<span class="keyword">if</span> ~exist(<span class="string">'arfit.m'</span>,<span class="string">'file'</span>)
94+
help <span class="string">arfitcaps</span>
95+
error(<span class="string">'ARfit.m not found. Get the ARfit package from Tapio Schneider''s web site.'</span>)
96+
<span class="keyword">end</span>;
97+
98+
v = u';
99+
[w, Au, C, sbc, fpe, th] = arfit(v,IP,IP);
100+
pf = C;
101+
102+
<span class="keyword">if</span> IP &gt;= 20
103+
[siglev,res] = arres(w,Au,v,IP+1);
104+
<span class="keyword">else</span>
105+
[siglev,res] = arres(w,Au,v);
106+
<span class="keyword">end</span>;
107+
108+
<span class="comment">% Variable 'siglev' is not used.</span>
109+
110+
ef = res';
111+
A = zeros(length(w),length(w),IP);
112+
<span class="keyword">for</span> i = 1:IP
113+
A(:,:,i) = Au(:,(i-1)*length(w)+1:i*length(w));
114+
wu = ceil(length(ef)*rand(size(w)));
115+
<span class="keyword">if</span> length(ef)&lt;length(v)
116+
ef = [ef ef(:,wu(1))];
117+
<span class="keyword">else</span>
118+
ef = ef(:,1:length(v));
119+
<span class="keyword">end</span>
120+
<span class="keyword">end</span>
121+
</pre><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2020a</a><br></p></div><!--
122+
##### SOURCE BEGIN #####
123+
%% ARFITCAPS
124+
% Capsule function to call the arfit.m routine, part of
125+
% "ARfit: Multivariate Autoregressive Model Fitting" package.
126+
%
127+
%% Syntax:
128+
% [pf,A,ef] = ARFITCAPS(u,IP)
129+
%
130+
%% Input Arguments
131+
% u: time series
132+
% IP: VAR model order
133+
%
134+
%% Output Arguments
135+
% pf: covariance matrix provided by ARFIT routine
136+
% A: AR estimate matrix provided by ARFIT routine
137+
% ef: forward residuals provided by ARRES routine
138+
%
139+
%% Description:
140+
% ARFITCAPS is capsule that calls arfit.m and arres.m routines, part of
141+
% Autoregressive Model Fitting" package, which implements algorithms
142+
% as described in the following articles:
143+
%
144+
% [1] Neumaier A & Schneider T, 2001. Estimation of parameters and
145+
% eigenmodes of multivariate autoregressive models. ACM Trans Math
146+
% Softw, 27:27-57.
147+
% [2] Schneider T & Neumaier A, 2001. Algorithm 808: ARfit - A Matlab
148+
% package for the estimation of parameters and eigenmodes of multivariate
149+
% autoregressive models. ACM Trans Math Softw, 27:58-65.
150+
%
151+
% If you are interested in using ARfit algorithm for VAR model estimation, we
152+
% advise you to get the software from Tapio Schneider's website at
153+
% https://climate-dynamics.org/software/#arfit
154+
% or from Mathworks.com File Exchange site (verified on August 27, 2021, but
155+
% not tested)
156+
% https://www.mathworks.com/matlabcentral/fileexchange/174-arfit,
157+
%
158+
% and, before using it, verify the license terms, it seems to be a copyrighted
159+
% material by the Association for Computing Machinery, Inc.
160+
%
161+
%% Note: As described by the authors, acf.m in ARfit needs Signal Processing
162+
% Toolbox (TM), as it requires XCORR, a cross-correlation function estimator.
163+
%
164+
% ARfit availability was checked on August 13, 2015, and August 27, 2021. KS
165+
%
166+
% The version we have tested and included was obtained on February 24, 2011 from
167+
% www.gps.caltech.edu/~tapio/arfit/index.html,
168+
% which is now obsolete.
169+
%
170+
%% See also: ARFIT, MVAR, MCARNS, MCARVM, CMLSM
171+
172+
% (C) Koichi Sameshima & Luiz A. Baccalá, 2022.
173+
% See file license.txt in installation directory for licensing terms.
174+
175+
%%
176+
177+
function [pf,A,ef] = arfitcaps(u,IP)
178+
179+
if ~exist('arfit.m','file')
180+
help arfitcaps
181+
error('ARfit.m not found. Get the ARfit package from Tapio Schneider''s web site.')
182+
end;
183+
184+
v = u';
185+
[w, Au, C, sbc, fpe, th] = arfit(v,IP,IP);
186+
pf = C;
187+
188+
if IP >= 20
189+
[siglev,res] = arres(w,Au,v,IP+1);
190+
else
191+
[siglev,res] = arres(w,Au,v);
192+
end;
193+
194+
% Variable 'siglev' is not used.
195+
196+
ef = res';
197+
A = zeros(length(w),length(w),IP);
198+
for i = 1:IP
199+
A(:,:,i) = Au(:,(i-1)*length(w)+1:i*length(w));
200+
wu = ceil(length(ef)*rand(size(w)));
201+
if length(ef)<length(v)
202+
ef = [ef ef(:,wu(1))];
203+
else
204+
ef = ef(:,1:length(v));
205+
end
206+
end
207+
208+
##### SOURCE END #####
209+
--></body></html>

core/html/asymp_dtf.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<!--
77
This HTML was auto-generated from MATLAB code.
88
To make changes, update the MATLAB code and republish this document.
9-
--><title>ASYMP_DTF</title><meta name="generator" content="MATLAB 9.8"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-10-05"><meta name="DC.source" content="asymp_dtf.m"><style type="text/css">
9+
--><title>ASYMP_DTF</title><meta name="generator" content="MATLAB 9.8"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-10-06"><meta name="DC.source" content="asymp_dtf.m"><style type="text/css">
1010
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
1111

1212
html { min-height:100%; margin-bottom:1px; }
@@ -67,8 +67,8 @@
6767

6868

6969

70-
</style></head><body><div class="content"><h1>ASYMP_DTF</h1><!--introduction--><pre> Compute DTF connectivity measures magnitude, from series j--&gt; i, for
71-
any of three of metrics -- Euclidean, diagonal and information --
70+
</style></head><body><div class="content"><h1>ASYMP_DTF</h1><!--introduction--><pre> Compute DTF connectivity measures magnitude, from series j--&gt;i, for
71+
any of three of metrics --- Euclidean, diagonal and information ---
7272
as well as asymptotic statistics from vector autoregressive (VAR)
7373
coefficients in the frequency domain.</pre><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Syntax:</a></li><li><a href="#2">Input Arguments:</a></li><li><a href="#3">Output Arguments:</a></li><li><a href="#4">Description:</a></li><li><a href="#5">Example:</a></li><li><a href="#6">References:</a></li><li><a href="#7">See also: DTF_ALG, ASYMP_PDC, MVAR, MCARNS, MCARVM, CMLSM, ARFIT</a></li><li><a href="#9">Change Log:</a></li></ul></div><h2 id="1">Syntax:</h2><pre> c = ASYMP_DTF(u,A,pf,nFreqs,metric,alpha)</pre><h2 id="2">Input Arguments:</h2><pre> u - multiple row vectors time series
7474
A - AR estimate matrix obtained via MVAR routine
@@ -560,8 +560,8 @@
560560
</pre><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB&reg; R2020a</a><br></p></div><!--
561561
##### SOURCE BEGIN #####
562562
%% ASYMP_DTF
563-
% Compute DTF connectivity measures magnitude, from series jREPLACE_WITH_DASH_DASH> i, for
564-
% any of three of metrics REPLACE_WITH_DASH_DASH Euclidean, diagonal and information REPLACE_WITH_DASH_DASH
563+
% Compute DTF connectivity measures magnitude, from series jREPLACE_WITH_DASH_DASH>i, for
564+
% any of three of metrics REPLACE_WITH_DASH_DASH- Euclidean, diagonal and information REPLACE_WITH_DASH_DASH-
565565
% as well as asymptotic statistics from vector autoregressive (VAR)
566566
% coefficients in the frequency domain.
567567
%

0 commit comments

Comments
 (0)