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
Dóra Kocsis
dynare
Commits
b756ee18
Commit
b756ee18
authored
Sep 14, 2012
by
Marco Ratto
Browse files
Analytic derivatives: make them work for lik_init==2 as well
(lik_init =3 and =4 still to be worked out)
parent
e637319b
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/dsge_likelihood.m
View file @
b756ee18
...
...
@@ -523,6 +523,7 @@ if analytic_derivation,
D2P
=
sparse
(
size
(
D2Om
,
1
),
size
(
D2Om
,
2
));
%
zeros
([
size
(
T
),
length
(
xparam1
),
length
(
xparam1
)]);
jcount
=
0
;
end
if
DynareOptions
.
lik_init
==
1
,
for
i
=
1
:
EstimatedParameters
.
nvx
k
=
EstimatedParameters
.
var_exo
(
i
,
1
);
DQ
(
k
,
k
,
i
)
=
2
*
sqrt
(
Q
(
k
,
k
));
...
...
@@ -541,6 +542,7 @@ if analytic_derivation,
end
end
end
end
offset
=
EstimatedParameters
.
nvx
;
for
i
=
1
:
EstimatedParameters
.
nvn
k
=
EstimatedParameters
.
var_endo
(
i
,
1
);
...
...
@@ -550,6 +552,7 @@ if analytic_derivation,
end
end
offset
=
offset
+
EstimatedParameters
.
nvn
;
if
DynareOptions
.
lik_init
==
1
,
for
j
=
1
:
EstimatedParameters
.
np
dum
=
lyapunov_symm
(
T
,
DT
(
:
,
:
,
j
+
offset
)
*
Pstar
*
T
'
+
T
*
Pstar
*
DT
(
:
,
:
,
j
+
offset
)
'
+
DOm
(
:
,
:
,
j
+
offset
),
DynareOptions
.
qz_criterium
,
DynareOptions
.
lyapunov_complex_threshold
);
%
kk
=
find
(
abs
(
dum
)
<
1e-12
);
...
...
@@ -572,6 +575,7 @@ if analytic_derivation,
end
end
end
end
if
analytic_derivation
==
1
,
analytic_deriv_info
=
{
analytic_derivation
,
DT
,
DYss
,
DOm
,
DH
,
DP
,
asy_Hess
};
else
...
...
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