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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frédéric Karamé
dynare
Commits
1a978e42
Commit
1a978e42
authored
8 years ago
by
Johannes Pfeifer
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in missing_DiffuseKalmanSmootherH3_Z.m
Closes #1339 by properly factorizing computations
parent
2f9dc092
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/missing_DiffuseKalmanSmootherH3_Z.m
+6
-6
6 additions, 6 deletions
matlab/missing_DiffuseKalmanSmootherH3_Z.m
with
6 additions
and
6 deletions
matlab/missing_DiffuseKalmanSmootherH3_Z.m
+
6
−
6
View file @
1a978e42
...
@@ -294,13 +294,13 @@ if d
...
@@ -294,13 +294,13 @@ if d
if
Finf
(
i
,
t
)
>
diffuse_kalman_tol
if
Finf
(
i
,
t
)
>
diffuse_kalman_tol
% recursions need to be from highest to lowest term in order to not
% recursions need to be from highest to lowest term in order to not
% overwrite lower terms still needed in this step
% overwrite lower terms still needed in this step
Linf
=
eye
(
mm
)
-
Kinf
(:,
i
,
t
)
*
Z
(
i
,:)/
Finf
(
i
,
t
);
L0
=
(
Kinf
(:,
i
,
t
)
*
(
Fstar
(
i
,
t
)/
Finf
(
i
,
t
))
-
Kstar
(:,
i
,
t
))
*
Z
(
i
,:)/
Finf
(
i
,
t
);
r1
(:,
t
)
=
Z
(
i
,:)
'*
v
(
i
,
t
)/
Finf
(
i
,
t
)
+
...
r1
(:,
t
)
=
Z
(
i
,:)
'*
v
(
i
,
t
)/
Finf
(
i
,
t
)
+
...
(
Kinf
(:,
i
,
t
)
'*Fstar(i,t)/Finf(i,t)-Kstar(:,i,t)'
)
*
r0
(:,
t
)/
Finf
(
i
,
t
)
*
Z
(
i
,:)
'
+
...
L0
'*
r0
(:,
t
)
+
...
r1
(:,
t
)
-
Kinf
(:,
i
,
t
)
'*r1(:,t)/Finf(i,t)*Z(i,:)'
;
% KD (2000), eq. (25) for r_1
Linf
'*
r1
(:,
t
);
% KD (2000), eq. (25) for r_1
r0
(:,
t
)
=
r0
(:,
t
)
-
Kinf
(:,
i
,
t
)
'*r0(:,t)/Finf(i,t)*Z(i,:)'
;
% KD (2000), eq. (25) for r_0
r0
(:,
t
)
=
Linf
'*
r0
(:,
t
);
% KD (2000), eq. (25) for r_0
if
state_uncertainty_flag
if
state_uncertainty_flag
Linf
=
eye
(
mm
)
-
Kinf
(:,
i
,
t
)
'
/
Finf
(
i
,
t
);
L0
=
(
Kinf
(:,
i
,
t
)
*
(
Fstar
(
i
,
t
)/
Finf
(
i
,
t
))
-
Kstar
(:,
i
,
t
))
*
Z
(
i
,:)/
Finf
(
i
,
t
);
N_2
(:,:,
t
)
=
Z
(
i
,:)
'
/
Finf
(
i
,
t
)
^
2
*
Z
(
i
,:)
*
Fstar
(
i
,
t
)
...
N_2
(:,:,
t
)
=
Z
(
i
,:)
'
/
Finf
(
i
,
t
)
^
2
*
Z
(
i
,:)
*
Fstar
(
i
,
t
)
...
+
Linf
'*
N_2
(:,:,
t
)
*
Linf
...
+
Linf
'*
N_2
(:,:,
t
)
*
Linf
...
+
Linf
'*
N_1
(:,:,
t
)
*
L0
...
+
Linf
'*
N_1
(:,:,
t
)
*
L0
...
...
...
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