Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
c8dd3045
Verified
Commit
c8dd3045
authored
1 year ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Throw an error if composite PAC target ∧ trend_component aux. model.
(cherry picked from commit
9f9f4a99
)
parent
c365f53e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/+pac/+update/parameters.m
+10
-5
10 additions, 5 deletions
matlab/+pac/+update/parameters.m
with
10 additions
and
5 deletions
matlab/+pac/+update/parameters.m
+
10
−
5
View file @
c8dd3045
...
...
@@ -13,7 +13,7 @@ function M_ = parameters(pacname, M_, oo_, verbose)
% SPECIAL REQUIREMENTS
% none
% Copyright © 2018-202
3
Dynare Team
% Copyright © 2018-202
4
Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -78,6 +78,11 @@ else
numberofcomponents
=
0
;
end
% Makes no sense to have a composite PAC target with a trend component auxiliary model (where all the variables are non stationnary)
if
numberofcomponents
>
0
&&
strcmp
(
M_
.
pac
.
pacman
.
auxiliary_model_type
,
'trend_component'
)
error
(
'Composite PAC target not allowed with trend component model.'
)
end
% Build the vector of PAC parameters (ECM parameter + autoregressive parameters).
pacvalues
=
M_
.
params
([
pacmodel
.
ec
.
params
;
pacmodel
.
ar
.
params
(
1
:
pacmodel
.
max_lag
)
'
]);
...
...
@@ -90,7 +95,7 @@ if numberofcomponents
% Find the auxiliary variables if any
ad
=
find
(
cell2mat
(
cellfun
(
@
(
x
)
isauxiliary
(
x
,
[
8
10
]),
varmodel
.
list_of_variables_in_companion_var
,
'UniformOutput'
,
false
)));
if
isempty
(
ad
)
error
(
'Cannot find the trend variable in the Companion VAR
/VECM
model.'
)
error
(
'Cannot find the trend variable in the Companion VAR model.'
)
else
for
j
=
1
:
length
(
ad
)
auxinfo
=
M_
.
aux_vars
(
get_aux_variable_id
(
varmodel
.
list_of_variables_in_companion_var
{
ad
(
j
)}));
...
...
@@ -105,7 +110,7 @@ if numberofcomponents
end
end
if
isempty
(
id
{
i
})
error
(
'Cannot find the trend variable in the Companion VAR
/VECM
model.'
)
error
(
'Cannot find the trend variable in the Companion VAR model.'
)
end
end
end
...
...
@@ -115,7 +120,7 @@ else
% Find the auxiliary variables if any
ad
=
find
(
cell2mat
(
cellfun
(
@
(
x
)
isauxiliary
(
x
,
[
8
10
]),
varmodel
.
list_of_variables_in_companion_var
,
'UniformOutput'
,
false
)));
if
isempty
(
ad
)
error
(
'Cannot find the trend variable in the
Companion VAR/VECM
model.'
)
error
(
'Cannot find the trend variable in the
auxiliary VAR / Trend component
model.'
)
else
for
i
=
1
:
length
(
ad
)
auxinfo
=
M_
.
aux_vars
(
get_aux_variable_id
(
varmodel
.
list_of_variables_in_companion_var
{
ad
(
i
)}));
...
...
@@ -130,7 +135,7 @@ else
end
end
if
isempty
(
id
{
1
})
error
(
'Cannot find the trend variable in the
Companion VAR/VECM
model.'
)
error
(
'Cannot find the trend variable in the
auxiliary VAR / Trend component
model.'
)
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment