Мне пришлось копаться в документации по адресу statsmodels.tsa.statespace.dynamic_factor.DynamicFactor.
Сразу после мода измените код со следующими строками
with mod.fix_params({'beta.exog_only_for_inc_equation.dln_inv': 0,'beta.exog_only_for_inv_equation.dln_inc':0}):
res = mod.fit()
print(res.summary())
, что приведет к:
Statespace Model Results
==================================================================================
Dep. Variable: ['dln_inv', 'dln_inc'] No. Observations: 75
Model: VARX(2) Log Likelihood 359.238
Date: Sat, 25 Apr 2020 AIC -692.475
Time: 00:52:20 BIC -662.348
Sample: 04-01-1960 HQIC -680.446
- 10-01-1978
Covariance Type: opg
===================================================================================
Ljung-Box (Q): 61.97, 39.25 Jarque-Bera (JB): 14.10, 2.67
Prob(Q): 0.01, 0.50 Prob(JB): 0.00, 0.26
Heteroskedasticity (H): 0.44, 0.39 Skew: 0.10, -0.40
Prob(H) (two-sided): 0.05, 0.02 Kurtosis: 5.11, 3.47
Results for equation dln_inv
===========================================================================================================
coef std err z P>|z| [0.025 0.975]
-----------------------------------------------------------------------------------------------------------
L1.dln_inv -0.2537 0.095 -2.663 0.008 -0.440 -0.067
L1.dln_inc 0.5490 0.442 1.243 0.214 -0.317 1.415
L2.dln_inv -0.1359 0.175 -0.778 0.436 -0.478 0.206
L2.dln_inc 0.4770 0.371 1.286 0.198 -0.250 1.204
beta.exog_only_for_inv_equation 0.0015 0.005 0.321 0.748 -0.008 0.011
beta.exog_only_for_inc_equation (fixed) 0 nan nan nan nan nan
Results for equation dln_inc
===========================================================================================================
coef std err z P>|z| [0.025 0.975]
-----------------------------------------------------------------------------------------------------------
L1.dln_inv 0.0615 0.035 1.737 0.082 -0.008 0.131
L1.dln_inc 0.0584 0.105 0.557 0.577 -0.147 0.264
L2.dln_inv 0.0091 0.031 0.289 0.773 -0.052 0.071
L2.dln_inc 0.0181 0.126 0.144 0.886 -0.229 0.265
beta.exog_only_for_inv_equation (fixed) 0 nan nan nan nan nan
beta.exog_only_for_inc_equation 0.8123 0.115 7.070 0.000 0.587 1.038
Error covariance matrix
============================================================================================
coef std err z P>|z| [0.025 0.975]
--------------------------------------------------------------------------------------------
sqrt.var.dln_inv 0.0445 0.003 14.175 0.000 0.038 0.051
sqrt.cov.dln_inv.dln_inc -5.595e-05 0.002 -0.028 0.978 -0.004 0.004
sqrt.var.dln_inc 0.0108 0.001 11.536 0.000 0.009 0.013
============================================================================================
Warnings:
[1] Covariance matrix calculated using the outer product of gradients (complex-step).
Чтобы найти имена параметров, просто наберите
res.param_names
, который покажет вам все имена параметров, которые вы можете использовать. Для приведенного выше примера,
['L1.dln_inv.dln_inv',
'L1.dln_inc.dln_inv',
'L2.dln_inv.dln_inv',
'L2.dln_inc.dln_inv',
'L1.dln_inv.dln_inc',
'L1.dln_inc.dln_inc',
'L2.dln_inv.dln_inc',
'L2.dln_inc.dln_inc',
'beta.exog_only_for_inv_equation.dln_inv',
'beta.exog_only_for_inc_equation.dln_inv',
'beta.exog_only_for_inv_equation.dln_inc',
'beta.exog_only_for_inc_equation.dln_inc',
'sqrt.var.dln_inv',
'sqrt.cov.dln_inv.dln_inc',
'sqrt.var.dln_inc']
Надеюсь, это окажется полезным.