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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frédéric Karamé
dynare
Commits
16d2fd56
Commit
16d2fd56
authored
Nov 24, 2011
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs. Changed internal documentation.
parent
6105ed43
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/particle/local_state_equation_2.m
+27
-27
27 additions, 27 deletions
matlab/particle/local_state_equation_2.m
with
27 additions
and
27 deletions
matlab/particle/local_state_equation_2.m
+
27
−
27
View file @
16d2fd56
function
[
y
,
y_
]
=
local_state_
iter
ation
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
,
yhat_
,
ss
)
function
[
y
,
y_
]
=
local_state_
equ
ation
_2
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
,
yhat_
,
ss
)
%
@info
:
%!
@deftypefn
{
Function
File
}
{
@var
{
y
},
@var
{
y_
}
=
}
local_state_
iter
ation
(
@var
{
yhat
},
@var
{
epsilon
},
@var
{
ghx
},
@var
{
ghu
},
@var
{
constant
},
@var
{
ghxx
},
@var
{
ghuu
},
@var
{
ghxu
},
@var
{
yhat_
},
@var
{
ss
})
%!
@anchor
{
particle
/
local_state_
iter
ation
}
%!
@deftypefn
{
Function
File
}
{
@var
{
y
},
@var
{
y_
}
=
}
local_state_
equ
ation
_2
(
@var
{
yhat
},
@var
{
epsilon
},
@var
{
ghx
},
@var
{
ghu
},
@var
{
constant
},
@var
{
ghxx
},
@var
{
ghuu
},
@var
{
ghxu
},
@var
{
yhat_
},
@var
{
ss
})
%!
@anchor
{
particle
/
local_state_
equ
ation
_2
}
%!
@sp
1
%!
Given
an
initial
condition
(
y
)
and
an
innovation
(
epsilon
),
this
routine
s
computes
the
next
value
of
the
state
variables
if
the
%!
Given
the
states
(
y
)
and
structural
innovation
s
(
epsilon
),
this
routine
computes
the
level
of
selected
endogenous
variables
when
the
%!
model
is
approximated
by
an
order
two
taylor
expansion
around
the
deterministic
steady
state
.
Depending
on
the
number
of
input
/
output
%!
argument
the
pruning
algorithm
advocated
by
C
.
Sims
is
used
or
not
.
%!
argument
the
pruning
algorithm
advocated
by
C
.
Sims
is
used
or
not
(
this
version
should
not
be
used
if
the
selected
endogenous
variables
%!
are
not
the
states
of
the
model
).
%!
%!
@sp
2
%!
@strong
{
Inputs
}
%!
@sp
1
...
...
@@ -16,30 +18,30 @@ function [y,y_] = local_state_iteration(yhat,epsilon,ghx,ghu,constant,ghxx,ghuu,
%!
@item
epsilon
%!
q
*
1
vector
of
doubles
,
structural
innovations
.
%!
@item
ghx
%!
n
*
n
matrix
of
doubles
,
is
a
subset
of
dr
.
ghx
where
we
only
consider
the
lines
corresponding
to
the
state
variables
.
%!
m
*
n
matrix
of
doubles
,
restricted
dr
.
ghx
where
we
only
consider
the
lines
corresponding
to
a
subset
of
endogenous
variables
.
%!
@item
ghu
%!
n
*
q
matrix
of
doubles
,
is
a
subset
of
dr
.
ghu
where
we
only
consider
the
lines
corresponding
to
the
state
variables
.
%!
m
*
q
matrix
of
doubles
,
restricted
dr
.
ghu
where
we
only
consider
the
lines
corresponding
to
a
subset
of
endogenous
variables
.
%!
@item
constant
%!
n
*
1
vector
of
doubles
,
deterministic
steady
state
plus
second
order
correction
for
the
state
variables
.
%!
m
*
1
vector
of
doubles
,
deterministic
steady
state
plus
second
order
correction
for
a
subset
of
endogenous
variables
.
%!
@item
ghxx
%!
n
*
n
²
matrix
of
doubles
,
subset
of
dr
.
ghxx
where
we
only
consider
the
lines
corresponding
to
the
state
variables
.
%!
m
*
n
²
matrix
of
doubles
,
restricted
dr
.
ghxx
where
we
only
consider
the
lines
corresponding
to
a
subset
of
endogenous
variables
.
%!
@item
ghuu
%!
n
*
q
²
matrix
of
doubles
,
subset
of
dr
.
ghuu
where
we
only
consider
the
lines
corresponding
to
the
state
variables
.
%!
m
*
q
²
matrix
of
doubles
,
restricted
dr
.
ghuu
where
we
only
consider
the
lines
corresponding
to
a
subset
of
endogenous
variables
.
%!
@item
ghxu
%!
n
*
(
nq
)
matrix
of
doubles
,
subset
of
dr
.
ghxu
where
we
only
consider
the
lines
corresponding
to
the
state
variables
.
%!
m
*
(
nq
)
matrix
of
doubles
,
subset
of
dr
.
ghxu
where
we
only
consider
the
lines
corresponding
to
a
subset
of
endogenous
variables
.
%!
@item
yhat_
%!
n
*
1
vector
of
doubles
,
s
econd
initial
condition
for
pruning
version
.
%!
n
*
1
vector
of
doubles
,
s
purious
states
for
the
pruning
version
.
%!
@item
ss
%!
n
*
1
vector
of
doubles
,
steady
state
for
the
union
of
the
states
and
observed
variabl
es
.
%!
n
*
1
vector
of
doubles
,
steady
state
for
the
stat
es
.
%!
@end
table
%!
@sp
2
%!
@strong
{
Outputs
}
%!
@sp
1
%!
@table
@
@var
%!
@item
y
%!
n
*
1
vector
of
doubles
,
next
values
for
the
state
variables
.
%!
m
*
1
vector
of
doubles
,
selected
endogenous
variables
.
%!
@item
y_
%!
n
*
1
vector
of
doubles
,
update
of
the
latent
variables
needed
for
the
pruning
version
(
first
order
update
).
%!
m
*
1
vector
of
doubles
,
update
of
the
latent
variables
needed
for
the
pruning
version
(
first
order
update
).
%!
@end
table
%!
@sp
2
%!
@strong
{
Remarks
}
...
...
@@ -57,8 +59,6 @@ function [y,y_] = local_state_iteration(yhat,epsilon,ghx,ghu,constant,ghxx,ghuu,
%
@eod
:
%
Copyright
(
C
)
2011
Dynare
Team
%
stephane
DOT
adjemian
AT
univ
DASH
lemans
DOT
fr
%
frederic
DOT
karame
AT
univ
DASH
evry
DOT
fr
%
%
This
file
is
part
of
Dynare
.
%
...
...
@@ -75,20 +75,23 @@ function [y,y_] = local_state_iteration(yhat,epsilon,ghx,ghu,constant,ghxx,ghuu,
%
You
should
have
received
a
copy
of
the
GNU
General
Public
License
%
along
with
Dynare
.
If
not
,
see
<
http
:
//www.gnu.org/licenses/>.
%
AUTHOR
(
S
)
stephane
DOT
adjemian
AT
univ
DASH
lemans
DOT
fr
%
frederic
DOT
karame
AT
univ
DASH
evry
DOT
fr
number_of_threads
=
1
;
if
nargin
==
8
pruning
=
0
;
if
nargout
>
1
error
(
'
local_state_
iter
ation
::
Numbers
of
input
and
output
argument
are
inconsistent
!
'
)
error
(
'
local_state_
equ
ation
_2
::
Numbers
of
input
and
output
argument
are
inconsistent
!
'
)
end
elseif
nargin
==
10
pruning
=
1
;
if
nargout
~=
2
error
(
'
local_state_
iter
ation
::
Numbers
of
input
and
output
argument
are
inconsistent
!
'
)
error
(
'
local_state_
equ
ation
_2
::
Numbers
of
input
and
output
argument
are
inconsistent
!
'
)
end
else
error
(
'
local_state_
iter
ation
::
Wrong
number
of
input
arguments
!
'
)
error
(
'
local_state_
equ
ation
_2
::
Wrong
number
of
input
arguments
!
'
)
end
switch
pruning
...
...
@@ -111,8 +114,6 @@ switch pruning
end
%
@test
:
1
%
$
addpath
..
/
matlab
%
$
%
$
n
=
2
;
%
$
q
=
3
;
%
$
...
...
@@ -128,8 +129,8 @@ end
%
$
ss
=
ones
(
n
,
1
);
%
$
%
$
%
Call
the
tested
routine
.
%
$
y1
=
local_state_
iter
ation
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
);
%
$
[
y2
,
y2_
]
=
local_state_
iter
ation
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
,
yhat_
,
ss
);
%
$
y1
=
local_state_
equ
ation
_2
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
);
%
$
[
y2
,
y2_
]
=
local_state_
equ
ation
_2
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
,
yhat_
,
ss
);
%
$
%
$
%
Check
the
results
.
%
$
t
(
1
)
=
dyn_assert
(
y1
,
ones
(
n
,
1
));
...
...
@@ -139,7 +140,6 @@ end
%
@eof
:
1
%
@test
:
2
%
$
addpath
..
/
matlab
%
$
old_path
=
pwd
;
%
$
cd
([
fileparts
(
which
(
'
dynare
'
))
'
/
..
/
tests
/
'
]);
%
$
dynare
(
'
dsge_base2
'
);
...
...
@@ -163,8 +163,8 @@ end
%
$
ss
=
dr
.
ys
(
istates
,
:
);
%
$
%
$
%
Call
the
tested
routine
.
%
$
y1
=
local_state_
iter
ation
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
);
%
$
[
y2
,
y2_
]
=
local_state_
iter
ation
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
,
yhat_
,
ss
);
%
$
y1
=
local_state_
equ
ation
_2
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
);
%
$
[
y2
,
y2_
]
=
local_state_
equ
ation
_2
(
yhat
,
epsilon
,
ghx
,
ghu
,
constant
,
ghxx
,
ghuu
,
ghxu
,
yhat_
,
ss
);
%
$
%
$
%
Check
the
results
.
%
$
t
(
1
)
=
1
;
%
dyn_assert
(
y1
,
ones
(
n
,
1
));
...
...
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