Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
MichelJuillard
dynare
Commits
8bb1fae2
Commit
8bb1fae2
authored
Nov 01, 2016
by
MichelJuillard
Browse files
alternative PerfectForesightSolver
parent
5f239375
Changes
1
Hide whitespace changes
Inline
Side-by-side
julia/v0.5/PerfectForesightModelSolver2.jl
View file @
8bb1fae2
...
...
@@ -120,8 +120,8 @@ function perfect_foresight_model!(Y::Array{Float64,1},exogenousvariables::Array{
i_cols
=
find
(
model
.
lead_lag_incidence
'
)
m
=
0
for
it
=
2
:
(
periods
+
1
)
res
=
sub
(
residuals
,
m
+
1
:
m
+
model
.
eq_nbr
)
Yview
=
sub
(
Y
,
i_cols
)
res
=
view
(
residuals
,
m
+
1
:
m
+
model
.
eq_nbr
)
Yview
=
view
(
Y
,
i_cols
)
model
.
dynamic
(
Yview
,
exogenousvariables
,
model
.
params
,
steadystate
,
it
,
res
)
m
+=
model
.
eq_nbr
i_cols
+=
ny
...
...
@@ -138,7 +138,7 @@ function perfect_foresight_model!(Y::Array{Float64,1},exogenousvariables::Array{
offset_c
=
-
ny
nzd
=
0
for
it
=
2
:
(
periods
+
1
)
Yview
=
sub
(
Y
,
i_cols
)
Yview
=
view
(
Y
,
i_cols
)
if
it
==
2
model
.
first_derivatives
(
Y
[
i_cols
],
exogenousvariables
,
model
.
params
,
steadystate
,
it
,
ws
.
iP
,
ws
.
jP
,
ws
.
vP
)
nzd
=
count
(
i
->
(
0
.<
i
.<=
3
*
ny
),
ws
.
jP
)
...
...
@@ -163,9 +163,9 @@ function perfect_foresight_model!(Y::Array{Float64,1},exogenousvariables::Array{
end
end
else
I
=
sub
(
ws
.
iA
,
m
+
1
:
m
+
nzd
)
J
=
sub
(
ws
.
jA
,
m
+
1
:
m
+
nzd
)
V
=
sub
(
ws
.
vA
,
m
+
1
:
m
+
nzd
)
I
=
view
(
ws
.
iA
,
m
+
1
:
m
+
nzd
)
J
=
view
(
ws
.
jA
,
m
+
1
:
m
+
nzd
)
V
=
view
(
ws
.
vA
,
m
+
1
:
m
+
nzd
)
model
.
first_derivatives
(
Y
[
i_cols
],
exogenousvariables
,
model
.
params
,
steadystate
,
it
,
I
,
J
,
V
)
for
k
=
m
+
1
:
m
+
nzd
ws
.
iA
[
k
]
+=
offset_r
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment