1
$\begingroup$

I am using Python (statsmodels) to create a dynamic factor model on which I apply the Kalman filter. Thanks to earlier questions on this forum, I landed upon using exact diffuse initialization. My code is below:

mod = DynamicFactor(
                    endog=NG.astype(float), # nobs x P
                    exog=HDD.astype(float), # nobs x k_exog
                    k_factors=1,
                    freq=NG.index.inferred_freq, # Which is daily data ('D') or start of the month ('MS')
                    factor_order=f,
                    error_order=0,
                    error_cov_type='diagonal'
)

mod.ssm.initialize_diffuse()
     
with mod.fix_params(dicts):
  
     res = mod.fit(
                   disp=True,
                   method='nm', #Nelder-Mead algorithm
                   xtol=10e-5,
                   maxiter=350000
                   )

Now I am interested in what the initial state equation would look like. It should be of the form: Initial state equation And I know that Q0 is not just a very large number, because that would be approximate diffuse initialization. In fact, I believe in the statsmodels package, the variance of the disturbance eta is set to 1/unity to avoid identification issues.

So this begs the question, what do the design matrix R (and Q0) look like in practice?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.