Commit Graph

28 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Sébastien Villemot 10af04c6d8
Use Unicode copyright symbol (in UTF-8 encoding) in all source files
It is now supported by the MATLAB editor (as of R2022a).

The old ASCII notation is left in some files that we copy as-is from other
sources (e.g. in the contrib/ and m4/ subdirectories).

The particles submodule is not updated at this point, because it is in an
inconsistent state.

[skip ci]
2022-04-13 14:54:25 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Marco Ratto 5fa6265944 Implement new option smoother_redux, to allow fast smoother for very large models. It runs smoother only for state variables and computes the remaining ones ex-post
Contains improvements, in order to recover as much as possible static unobserved (filtered, smoothed, updated, k-step ahead), Variance, State_uncertainty, k-step ahead variances trying to map lagged states onto current ones using pinv(T). This has exceptions (namely lagged shocks which are ONLY used to recover static NON observed variables). this exception is also trapped.
For such extensions we can only recover smoothed variables starting from d+1. Variances CANNOT be recovered for such variables (the smoother gives ZERO.)
2021-05-27 16:59:15 +02:00
Marcoo Ratto 1645f38269
Implement heteroskedastic filter and smoother 2021-05-26 18:45:16 +02:00
Marco Ratto 551917581f
Bug fixes in fitered variances of smoother
- kalman_algo=1: kstep-ahead variances were WRONG, since Pf was initialized using P in PREVIOUS period
- kalman_algo=2: output argument for filtered varainces should be P1, not P (P are UPDATED variances, there).

For kalman_algo=2, also make a small factorization fix (compute P(:,:,t+1) before defining Pf, so to compute 1-step ahead variance only once)
2021-05-07 16:34:53 +02:00
Johannes Pfeifer 7c8f486727 Allow setting initial state for Kalman filter
Supersedes https://git.dynare.org/Dynare/dynare/-/merge_requests/1522
2021-01-28 17:24:27 +01:00
Johannes Pfeifer b8b05300c1 missing_DiffuseKalmanSmootherH1_Z.m: fix bug with variable dimension 2020-04-02 19:22:55 +02:00
Johannes Pfeifer cbc0cdfef8 Fix bug in multivariate Kalman smoother when observations are missing
The singularity branch did not correctly account for the switching number of observables
2018-01-26 23:13:45 +01:00
Stéphane Adjemian (Charybdis) 1bf81c9f5a Fixed copyright notices. 2017-05-18 18:36:38 +02:00
Stéphane Adjemian (Charybdis) 5417b27ac7 Fixed indentation of matlab files. 2017-05-16 15:10:20 +02:00
Johannes Pfeifer 98cf1bfc1d Add smoothed state uncertainty to Kalman smoother routines 2016-11-04 09:23:55 +01:00
Johannes Pfeifer 86534a5f9f missing_DiffuseKalmanSmootherH1_Z.m: introduce proper case distinction in diffuse backward pass if Finf is singular 2016-11-04 09:21:53 +01:00
Johannes Pfeifer 9ce577b126 Cosmetic changes to missing_DiffuseKalmanSmootherH1_Z.m 2016-11-04 09:21:53 +01:00
Johannes Pfeifer e3aecd4e74 Diffuse Kalman filter: add comment for better comparison to Koopman/Durbin (2003) as there is a typo in their paper 2016-11-04 09:21:53 +01:00
Johannes Pfeifer c94011eeb8 missing_DiffuseKalmanSmootherH1_Z.m: fix crash when Pinf is singular for more than 1 period
iFstar was accessed as three-dimensional array with t along third dimension, but it is only two-dimensional
2016-11-04 09:21:53 +01:00
Johannes Pfeifer ff1522a571 2 bugfixes for missing_DiffuseKalmanSmootherH1_Z.m that led to wrong results
1. In case of missing observations, a_t was not propagated forward to updated a_t+1
2. In the rank-deficient Finf case, Kstar was defined as T^(-1)*K^(0), while in the full rank it was defined as Kstar=K^(0), leading to wrong results when switches between the two clauses occurred. Moreover, the later backwards pass relied on Kstar=K^(0), leading to wrong results when the rank-deficient Finf case was triggered. The implementation now consistently follows the one in kalman_filter_d.m
2016-11-04 09:21:53 +01:00
Johannes Pfeifer 98384eb6f2 Document variable ordering in various headers 2016-04-12 10:52:37 +02:00
Houtan Bastani f60945facc fix copyright dates 2016-03-11 16:22:42 +01:00
Michel Juillard 42ecfa382f fxing bug in diffuse smoother with missing values 2016-03-06 21:07:50 +01:00
Marco Ratto 05fc096569 Make multivariate kalman filter and smoother robust to badly scaled covariance matrix of observables.
This avoids shifting to univariate filter in most cases.
2015-10-13 17:15:01 +02:00
Stéphane Adjemian (Charybdis) 090c4fedbd Added new option (diffuse_kalman_tol) and fixed tolerance paremeters in diffuse smoother routines. 2015-04-03 18:02:03 +02:00
ferhat ae72105b5c Speeds up the Kalman smoother 2014-01-14 17:32:45 +01:00
Michel Juillard 0b0c939849 fixing bug with smoother with univariate filters 2011-11-02 14:02:12 +01:00
Michel Juillard 78d882900a more bug corrections in smoother routines 2011-03-25 21:32:45 +01:00
Michel Juillard 5f8b5fa467 removing useless 'd' output argument from the Kalman smoother functions. Removed global initialization of options_.diffuse_d. Fixed minor bugs in Kalman smoother functions. 2011-03-24 18:38:01 +01:00
Houtan Bastani 43479f6ef3 use short-circuit ops (|| and &&) as opposed to (| and &) to avoid warnings in Octave (and save time) 2011-02-10 15:54:23 +01:00
Sébastien Villemot 9ae3115b9d Fixing function name in header 2011-02-04 12:44:43 +01:00
Michel Juillard e2a1d77f6e - added schur_statespace_transformation.m to factor it out of DsgeLikelihood.m and DsgeSmoother.m
and corrected a bug in the code
- added missing functions missing_DiffuseKalmanSmootherH1_Z.m (multivariate version) and
                          missing_DiffuseKalmanSmootherH3_Z.m (univariate version)
- use only these two versions of the Kalman smoother in DsgeSmoother.m
2011-01-13 21:50:26 +01:00