Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marco Ratto
dynare
Commits
047c4894
Unverified
Commit
047c4894
authored
May 17, 2022
by
Sébastien Villemot
Browse files
Merge branch 'NK_baseline' of git.dynare.org:JohannesPfeifer/dynare
Ref. !2027
parents
35c7f2d0
ab6b6425
Changes
1
Show whitespace changes
Inline
Side-by-side
examples/NK_baseline_steadystate.m
View file @
047c4894
...
...
@@ -65,6 +65,7 @@ Lambdax=mu_z;
%set the parameter gammma1
gammma1
=
mu_z
*
mu_I
/
betta
-
(
1
-
delta
);
if
gammma1
<
0
% parameter violates restriction; Preventing this cannot be implemented via prior restriction as it is a composite of different parameters and the valid prior region has unknown form
params
=
M_
.
params
;
check
=
1
;
%set failure indicator
return
;
%return without updating steady states
end
...
...
@@ -86,13 +87,20 @@ vp=(1-thetap)/(1-thetap*PI^((1-chi)*epsilon))*PIstar^(-epsilon);
vw
=
(
1
-
thetaw
)/(
1
-
thetaw
*
PI
^
((
1
-
chiw
)
*
eta
)
*
mu_z
^
eta
)
*
PIstarw
^
(
-
eta
);
tempvaromega
=
alppha
/(
1
-
alppha
)
*
w
/
r
*
mu_z
*
mu_I
;
[
ld
,
fval
,
exitflag
]
=
fzero
(
@
(
ld
)(
1
-
betta
*
thetaw
*
mu_z
^
(
eta
-
1
)
*
PI
^
(
-
(
1
-
chiw
)
*
(
1
-
eta
)))/(
1
-
betta
*
thetaw
*
mu_z
^
(
eta
*
(
1
+
gammma
))
*
PI
^
(
eta
*
(
1
-
chiw
)
*
(
1
+
gammma
)))
...
-
(
eta
-
1
)/
eta
*
wstar
/(
varpsi
*
PIstarw
^
(
-
eta
*
gammma
)
*
ld
^
gammma
)
*
((
1
-
h
*
mu_z
^
(
-
1
))
^
(
-
1
)
-
betta
*
h
*
(
mu_z
-
h
)
^
(
-
1
))
*
...
((
mu_A
*
mu_z
^
(
-
1
)
*
vp
^
(
-
1
)
*
tempvaromega
^
alppha
-
tempvaromega
*
(
1
-
(
1
-
delta
)
*
(
mu_z
*
mu_I
)
^
(
-
1
)))
*
ld
-
vp
^
(
-
1
)
*
Phi
)
^
(
-
1
),
0.25
,
options
);
try
%proper error handling for cases for infeasible initial value, which would result in error instead of valid exitflag
[
ld
,
fval
,
exitflag
]
=
fzero
(
@
(
ld
)(
1
-
betta
*
thetaw
*
mu_z
^
(
eta
-
1
)
*
PI
^
(
-
(
1
-
chiw
)
*
(
1
-
eta
)))/(
1
-
betta
*
thetaw
*
mu_z
^
(
eta
*
(
1
+
gammma
))
*
PI
^
(
eta
*
(
1
-
chiw
)
*
(
1
+
gammma
)))
...
-
(
eta
-
1
)/
eta
*
wstar
/(
varpsi
*
PIstarw
^
(
-
eta
*
gammma
)
*
ld
^
gammma
)
*
((
1
-
h
*
mu_z
^
(
-
1
))
^
(
-
1
)
-
betta
*
h
*
(
mu_z
-
h
)
^
(
-
1
))
*
...
((
mu_A
*
mu_z
^
(
-
1
)
*
vp
^
(
-
1
)
*
tempvaromega
^
alppha
-
tempvaromega
*
(
1
-
(
1
-
delta
)
*
(
mu_z
*
mu_I
)
^
(
-
1
)))
*
ld
-
vp
^
(
-
1
)
*
Phi
)
^
(
-
1
),
0.25
,
options
);
catch
exitflag
=
0
;
end
if
exitflag
<
1
%indicate the SS computation was not sucessful; this would also be detected by Dynare
%setting the indicator here shows how to use this functionality to
%filter out parameter draws
params
=
M_
.
params
;
check
=
1
;
%set failure indicator
return
;
%return without updating steady states
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment