Skip to content

Commit 3d92588

Browse files
authored
Merge pull request statsmodels#6131 from ChadFulton/diffuse-std-fcast-err
ENH: Compute standardized forecast error in diffuse period if possible
2 parents 384e522 + db16fa3 commit 3d92588

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

statsmodels/tsa/statespace/_filters/_univariate_diffuse.pyx.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ cdef int {{prefix}}forecast_univariate_diffuse({{prefix}}KalmanFilter kfilter, {
151151
kfilter.nobs_kendog_diffuse_nonsingular = kfilter.nobs_kendog_diffuse_nonsingular + 1
152152
forecast_error_cov_inv = 1.0 / forecast_error_cov
153153

154+
# Standardized forecasts error
155+
if not (kfilter.conserve_memory & MEMORY_NO_STD_FORECAST > 0):
156+
kfilter._standardized_forecast_error[i] = (
157+
kfilter._forecast_error[i] * forecast_error_cov_inv**0.5)
158+
154159
# K0 = M[:, i:i+1] / F[i, i]
155160
blas.{{prefix}}copy(&kfilter.k_states, &kfilter._M[i*kfilter.k_states], &inc, kfilter._tmpK0, &inc)
156161
blas.{{prefix}}scal(&kfilter.k_states, &forecast_error_cov_inv, kfilter._tmpK0, &inc)

0 commit comments

Comments
 (0)