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
3cbd702b
Commit
3cbd702b
authored
May 30, 2012
by
Stéphane Adjemian
Browse files
Fixed bugs (initialization of the Kalman filter with the fixed point of the Riccatti equation).
parent
0caaeddb
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/dsge_likelihood.m
View file @
3cbd702b
...
...
@@ -361,7 +361,7 @@ if (kalman_algo == 2) || (kalman_algo == 4)
else
if
all
(
all
(
abs
(
H
-
diag
(
diag
(
H
)))
<
1e-14
))
%
ie
,
the
covariance
matrix
is
diagonal
...
H
=
diag
(
H
);
mmm
=
mm
;
mmm
=
mm
;
else
Z
=
[
Z
,
eye
(
pp
)];
T
=
blkdiag
(
T
,
zeros
(
pp
));
...
...
@@ -410,7 +410,7 @@ switch DynareOptions.lik_init
%
Use
standard
kalman
filter
except
if
the
univariate
filter
is
explicitely
choosen
.
if
kalman_algo
==
0
kalman_algo
=
3
;
elseif
~
((
kalman_algo
==
3
)
||
(
kalman_algo
==
4
))
elseif
~
((
kalman_algo
==
3
)
||
(
kalman_algo
==
4
))
error
([
'
diffuse
filter
:
options_
.
kalman_algo
can
only
be
equal
'
...
'
to
0
(
default
),
3
or
4
'
])
end
...
...
@@ -475,16 +475,18 @@ switch DynareOptions.lik_init
kalman_algo
=
1
;
end
if
isequal
(
H
,
0
)
[
err
,
Pstar
]
=
kalman_steady_state
(
transpose
(
T
),
R
*
Q
*
transpose
(
R
),
transpose
(
build_selection_matrix
(
Z
,
np
,
length
(
Z
))));
[
err
,
Pstar
]
=
kalman_steady_state
(
transpose
(
T
),
R
*
Q
*
transpose
(
R
),
transpose
(
build_selection_matrix
(
Z
,
mm
,
length
(
Z
))));
else
[
err
,
Pstar
]
=
kalman_steady_state
(
transpose
(
T
),
R
*
Q
*
transpose
(
R
),
transpose
(
build_selection_matrix
(
Z
,
np
,
length
(
Z
))),
H
);
[
err
,
Pstar
]
=
kalman_steady_state
(
transpose
(
T
),
R
*
Q
*
transpose
(
R
),
transpose
(
build_selection_matrix
(
Z
,
mm
,
length
(
Z
))),
H
);
end
if
err
disp
([
'
dsge_likelihood
:
:
I
am
not
able
to
solve
the
Riccati
equation
,
so
I
switch
to
lik_init
=
1
!
'
]);
DynareOptions
.
lik_init
=
1
;
Pstar
=
lyapunov_symm
(
T
,
R
*
Q
*
R
'
,
DynareOptions
.
qz_criterium
,
DynareOptions
.
lyapunov_complex_threshold
);
end
Pinf
=
[];
Pinf
=
[];
a
=
zeros
(
mm
,
1
);
Zflag
=
0
;
otherwise
error
(
'
dsge_likelihood
::
Unknown
initialization
approach
for
the
Kalman
filter
!
'
)
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