B-K conditions are not satisfied but The rank condition is verified

#1

This problem appears in my estimation of the habit formation model which is described in Habit Formation in Consumption and Its Implications for Monetary-Policy Models.
code:
var cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one0 one1 one2 one3;
varexo e0 e1 e2 e3;

parameters c0 lambda gam sig rho delt acc rhoz bet;

c0 = 0.11490;
lambda = 0.25882;
gam = 0.79706;
sig = 6.11251;
rho = 0.99578;
delt = 28.48666;
acc = 0.88879;
rhoz = 0.00147;
bet = 0.99900;

model;
cnsndt - yddt = c0one0 + (1-lambda)pvdy + (1-lambda)((gam(1-sig)(1-rho))/sig)pvdP +
(1-lambda)
(((1-sig)gam)/sig)pvdz - (1-lambda)(delt/sig)rreal + c_;
c_ = acc
c_(-1);
yddt =
0.42308 * cnsndt(-1)
-0.22215 * cnsndt(-2)
+0.71526 * cnsndt(-3)
-0.52802 * cnsndt(-4)
+0.61076 * yddt(-1)
+0.14172 * yddt(-2)
-0.042076 * yddt(-3)
-0.11279 * yddt(-4)
+0.10946 * rff(-1)
-0.26679 * rff(-2)
+0.22829 * rff(-3)
-0.031833 * rff(-4)
-0.17172 * pdotcpix(-1)
+0.11959 * pdotcpix(-2)
+0.012267 * pdotcpix(-3)
-0.024734 * pdotcpix(-4)
+0.00011277 * one1;
rff =
0.46672 * cnsndt(-1)
-1.06382 * cnsndt(-2)
+1.34250 * cnsndt(-3)
-0.46436 * cnsndt(-4)
+0.11369 * yddt(-1)
+0.02255 * yddt(-2)
-0.16794 * yddt(-3)
-0.16131 * yddt(-4)
+1.10657 * rff(-1)
-0.51594 * rff(-2)
+0.35818 * rff(-3)
-0.02744 * rff(-4)
+0.26021 * pdotcpix(-1)
-0.08949 * pdotcpix(-2)
+0.09837 * pdotcpix(-3)
-0.17087 * pdotcpix(-4)
+0.00141 * one2;
pdotcpix =
0.56316 * cnsndt(-1)
-0.70552 * cnsndt(-2)
-0.03313 * cnsndt(-3)
+0.23292 * cnsndt(-4)
+0.08268 * yddt(-1)
+0.24697 * yddt(-2)
-0.15223 * yddt(-3)
-0.08512 * yddt(-4)
+0.16054 * rff(-1)
-0.21888 * rff(-2)
-0.01572 * rff(-3)
+0.04213 * rff(-4)
+0.68637 * pdotcpix(-1)
+0.07805 * pdotcpix(-2)
+0.34762 * pdotcpix(-3)
-0.14149 * pdotcpix(-4)
+0.00348 * one3;
rff - pdotcpix(+1) = rreal - 40.0
(rreal(+1) - rreal);
z = rhoz
z(-1) + (1-rhoz)cnsndt(-1);
P = bet
rhozP(+1) + (((rho-sig)/(1-sig))cnsndt - ((gam(1-sig)-1)(1-sig))z);
pvdy = rho
pvdy(+1) + (yddt(+1) - yddt);
pvdP = rhopvdP(+1) + (P(+1) - P);
pvdz = rho
pvdz(+1) + (z(+1) - z);
one0 = one0(-1)+e0;
one1 = one1(-1)+e1;
one2 = one2(-1)+e2;
one3 = one3(-1)+e3;
end;

initval;
cnsndt = yddt;
end;

steady;
check;
shocks;
var e0;
stderr 1;
var e1;
stderr 1;
var e2;
stderr 1;
var e3;
stderr 1;
end;

estimated_params;
//ML estimation setup
// parameter name, initial value, boundaries_low, …_up;
c0, 0.1, 0.01, 0.4;
lambda, 0.25, 0.01, 0.4;
gam, 0.8, 0.5, 1.0;
sig, 7, 2, 10;
rho, 0.98, 0.5, 1;
delt, 13, 10, 30;
acc, 0.9, 0.5, 1;
rhoz, 0, 0, 0.2;
bet, 0.8, 0.5, 1;
end;
estimated_params_init(use_calibration);
end;
varobs cnsndt pdotcpix rff yddt;

estimation(datafile=data_habit);

report by matlab:

EIGENVALUES:
Modulus Real Imaginary

   5.249e-05        5.249e-05                0
   5.297e-05        4.757e-07        5.297e-05
   5.297e-05        4.757e-07       -5.297e-05
   5.344e-05       -5.344e-05                0
      0.2581           0.1989           0.1645
      0.2581           0.1989          -0.1645
      0.3641          -0.2308           0.2816
      0.3641          -0.2308          -0.2816
      0.5867          -0.2945           0.5075
      0.5867          -0.2945          -0.5075
      0.6333          -0.1291             0.62
      0.6333          -0.1291            -0.62
      0.6448           0.5873           0.2661
      0.6448           0.5873          -0.2661
      0.7147           0.7147                0
      0.8888           0.8888                0
      0.9224           0.9181          0.08877
      0.9224           0.9181         -0.08877
           1                1                0
           1                1                0
           1                1                0
           1                1                0
       1.004            1.004                0
       1.004            1.004                0
       1.004            1.004                0
       1.117            1.117                0
       679.6            679.6                0
   9.464e+20        9.464e+20                0
   4.662e+22       -4.662e+22                0
   5.871e+24       -5.871e+24                0

There are 8 eigenvalue(s) larger than 1 in modulus
for 8 forward-looking variable(s)

The rank condition is verified.

You did not declare endogenous variables after the estimation/calib_smoother command.
Error in computing likelihood for initial parameter values

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

error print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium
error print_info (line 42)
error([‘Blanchard Kahn conditions are not satisfied: no stable’ …
error initial_estimation_checks (line 175)
print_info(info, DynareOptions.noprint, DynareOptions)
error dynare_estimation_1 (line 165)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
error dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);
error habitEstimate (line 345)
oo_recursive_=dynare_estimation(var_list_);

0 Likes

#2

Your model has a unit root. You need to use diffuse_filter in the estimation-command

0 Likes

Steady state contains NAN: another unsolved case!
#3

Thank you very much for your advice, it works well when diffuse_filter is used.

0 Likes

#5

When I substitute the parameters in the original model with new ones, the problem happens again.

var cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one0;
varexo e0 e1 e2 e3;

parameters c0 lambda gam sig rho delt acc rhoz bet;

c0 = 0.22;
lambda = 0.15;
gam = 0.90;
sig = 10;
rho = 1;
delt = 15;
acc = 0.89;
rhoz = 0.0001;
bet = 0.99900;

model;
cnsndt - yddt = c0 * one0 + (1-lambda) * pvdy + (1-lambda) * ((gam*(1-sig) * (1-rho))/sig) * pvdP + (1-lambda) * (((1-sig) * gam)/sig) * pvdz - (1-lambda) * (delt/sig)rreal + c_;
c_ = acc * c_(-1);
yddt =
0.118724 * cnsndt(-1) +0.448208 * cnsndt(-2) + 0.166217 * cnsndt(-3) + 0.284858 * cnsndt(-4) -0.210454 * yddt(-1) -0.364903 * yddt(-2) -0.264717 * yddt(-3) + 0.868668 * yddt(-4)
-0.002622 * rff(-1) + 0.010931 * rff(-2)+ 0.002676 * rff(-3) -0.005766 * rff(-4) -0.003396 * pdotcpix(-1)-0.008557 * pdotcpix(-2) -0.001714 * pdotcpix(-3) + 0.000656 * pdotcpix(-4)+e1;
rff = 1.724642 * cnsndt(-1)+ 23.15204 * cnsndt(-2)-0.309369 * cnsndt(-3) + 17.33500 * cnsndt(-4) -8.918769 * yddt(-1) -18.05803 * yddt(-2) -7.352436 * yddt(-3) -5.739763 * yddt(-4) + 0.616178 * rff(-1) + 0.413616 * rff(-2) + 0.173184 * rff(-3)-0.571169 * rff(-4)
-0.170661 * pdotcpix(-1) + 0.048088 * pdotcpix(-2) + 0.102367 * pdotcpix(-3) + 0.256569 * pdotcpix(-4) +e2;
pdotcpix = 1.350612 * cnsndt(-1) -5.725709 * cnsndt(-2)+ 1.765075 * cnsndt(-3) -8.544864 * cnsndt(-4)-3.765590 * yddt(-1) +3.189699 * yddt(-2) + 2.588477 * yddt(-3) + 8.802582 * yddt(-4) + 0.173176 * rff(-1) -0.028764 * rff(-2) -0.331193 * rff(-3) + 0.264100 * rff(-4)
-0.322855 * pdotcpix(-1) -0.287717 * pdotcpix(-2) -0.233162 * pdotcpix(-3) -0.400467 * pdotcpix(-4) +e3;
rff - pdotcpix(+1) = rreal - 40.0
(rreal(+1) - rreal);
z = rhozz(-1) + (1-rhoz)cnsndt(-1);
P = bet
rhoz
P(+1) + (((rho-sig)/(1-sig))cnsndt - ((gam(1-sig)-1)(1-sig))z);
pvdy = rho
pvdy(+1) + (yddt(+1) - yddt);
pvdP = rho
pvdP(+1) + (P(+1) - P);
pvdz = rho*pvdz(+1) + (z(+1) - z);
one0 = one0(-1)+e0;
end;

initval;
cnsndt = yddt;
end;

steady;
check;
shocks;
var e0;
stderr 1;
var e1;
stderr 1;
var e2;
stderr 1;
var e3;
stderr 1;
end;

stoch_simul(dr_algo=0,periods=1000,irf=40);
save data_habit cnsndt yddt rff pdotcpix one;

Using 64-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file …
WARNING: habitEstimate.mod:118.13-21: dr_algo option is now deprecated, and may be removed in a future version of Dynare
Substitution of endo lags >= 2: added 12 auxiliary variables and equations.
Found 24 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    done
    Preprocessing completed.

STEADY-STATE RESULTS:

cnsndt 0
c_ 0
yddt 0
rff 0
pdotcpix 0
rreal 0
z 0
P 0
pvdy 0
pvdP 0
pvdz 0
one0 0

EIGENVALUES:
Modulus Real Imaginary

   1.936e-05        1.447e-05        1.287e-05
   1.936e-05        1.447e-05       -1.287e-05
    2.15e-05       -1.447e-05        1.591e-05
    2.15e-05       -1.447e-05       -1.591e-05
      0.2555           0.2555                0
      0.6415          -0.4427           0.4643
      0.6415          -0.4427          -0.4643
      0.7853           0.3846           0.6846
      0.7853           0.3846          -0.6846
        0.89             0.89                0
      0.9312          -0.6847           0.6311
      0.9312          -0.6847          -0.6311
      0.9632           0.6119           0.7439
      0.9632           0.6119          -0.7439
      0.9841          -0.9841                0
           1                1                0
           1                1                0
           1                1                0
           1                1                0
           1                1                0
       1.049        -0.008926            1.049
       1.049        -0.008926           -1.049
       1.779            1.779                0
   1.001e+04        1.001e+04                0
   4.564e+48        4.564e+48                0
         Inf              Inf                0
         Inf             -Inf                0

**There are 8 eigenvalue(s) larger than 1 in modulus **
for 8 forward-looking variable(s)

The rank condition ISN’T verified!

warning: stoch_simul: using order = 1 because Hessian is equal to zero

In stoch_simul (line 41)
In habitEstimate (line 312)
In dynare (line 235)
错误使用 print_info (line 48)
Blanchard Kahn conditions are not satisfied: indeterminacy due to rank failure
error stoch_simul (line 100)
print_info(info, options_.noprint, options_);
error habitEstimate (line 312)
info = stoch_simul(var_list_);
error dynare (line 235)
evalin(‘base’,fname) ;

0 Likes

#6

你这个肯定是参考的的旧版本的code,dr_algo已经被废弃了。此外,你有超过1的滞后变量,你需要引入辅助变量。请参见宏观经济研学会微信公众号。

0 Likes

#7

感谢你的回答,这个模型原来是使用的是美国数据估计出来的参数进行校准的,原模型在dynare中运行是没有问题的。但是利用中国数据重新估计参数进行模型校准,运行结果就出错了。所以你的回答似乎并不准确。

0 Likes

#8

1,code with some syntax errors,e.g. line 26, cols 25-30: syntax error, unexpected NAME, line 25, col 34: syntax error, unexpected '(', line 27, col 66: syntax error, unexpected '('

2,Adding resid(1); and model_diagnostics;

3, then report results.

0 Likes

#9

Equation 12 has unit root.

The singularity seems to be (partly) caused by the presence of a unit root as the absolute value of one eigenvalue is in the range of ±1e-6 to 1. If the model is actually supposed to feature unit root behavior, such a warning is expected, but you should nevertheless check whether there is an additional singularity problem. The presence of a singularity problem typically indicates that there is one redundant equation entered in the model block, while another non-redundant equation is missing. The problem often derives from Walras Law.

  Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file ...
WARNING: ex.mod:53.13-21: dr_algo option is now deprecated, and may be removed in a future version of Dynare
Substitution of endo lags >= 2: added 12 auxiliary variables and equations.
Found 24 equation(s).
Evaluating expressions...done
Computing static model derivatives:
 - order 1
Computing dynamic model derivatives:
 - order 1
 - order 2
Processing outputs ...
done
Preprocessing completed.





Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0



STEADY-STATE RESULTS:

cnsndt           		 0
c_               		 0
yddt             		 0
rff              		 0
pdotcpix         		 0
rreal            		 0
z                		 0
P                		 0
pvdy             		 0
pvdP             		 0
pvdz             		 0
one0             		 0

EIGENVALUES:
         Modulus             Real        Imaginary

       1.936e-05        1.447e-05        1.287e-05
       1.936e-05        1.447e-05       -1.287e-05
        2.15e-05       -1.447e-05        1.591e-05
        2.15e-05       -1.447e-05       -1.591e-05
          0.2555           0.2555                0
          0.6415          -0.4427           0.4643
          0.6415          -0.4427          -0.4643
          0.7853           0.3846           0.6846
          0.7853           0.3846          -0.6846
            0.89             0.89                0
          0.9312          -0.6847           0.6311
          0.9312          -0.6847          -0.6311
          0.9632           0.6119           0.7439
          0.9632           0.6119          -0.7439
          0.9841          -0.9841                0
               1                1                0
               1                1                0
               1                1                0
               1                1                0
               1                1                0
           1.049        -0.008926            1.049
           1.049        -0.008926           -1.049
           1.779            1.779                0
       1.001e+04        1.001e+04                0
       4.564e+48        4.564e+48                0
             Inf              Inf                0
             Inf             -Inf                0


There are 8 eigenvalue(s) larger than 1 in modulus 
for 8 forward-looking variable(s)

The rank condition ISN'T verified!

MODEL_DIAGNOSTICS:  The Jacobian of the static model is singular
MODEL_DIAGNOSTICS:  there is 4 colinear relationships between the variables and the equations
Relation 1
Colinear variables:
cnsndt          
yddt            
rff             
pdotcpix        
rreal           
z               
P               
pvdy            
pvdP            
pvdz            
one0            
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 2
Colinear variables:
cnsndt          
yddt            
rff             
pdotcpix        
rreal           
z               
P               
pvdy            
pvdP            
pvdz            
one0            
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 3
Colinear variables:
cnsndt          
yddt            
rff             
pdotcpix        
rreal           
z               
P               
pvdy            
pvdP            
pvdz            
one0            
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 4
Colinear variables:
cnsndt          
yddt            
rff             
pdotcpix        
rreal           
z               
P               
pvdy            
pvdP            
pvdz            
one0            
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 1
Colinear equations
     9    10    11

Relation 2
Colinear equations
     9    10    11    12

Relation 3
Colinear equations
     9    10    11    12

Relation 4
Colinear equations
     9    10    11    12

MODEL_DIAGNOSTICS:  The singularity seems to be (partly) caused by the presence of a unit root
MODEL_DIAGNOSTICS:  as the absolute value of one eigenvalue is in the range of +-1e-6 to 1.
MODEL_DIAGNOSTICS:  If the model is actually supposed to feature unit root behavior, such a warning is expected,
MODEL_DIAGNOSTICS:  but you should nevertheless check whether there is an additional singularity problem.
MODEL_DIAGNOSTICS:  The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS:  redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS:  is missing. The problem often derives from Walras Law.
Warning: stoch_simul: using order = 1 because Hessian is equal to zero 
> In stoch_simul (line 41)
  In ex (line 314)
  In dynare (line 235) 
Error using print_info (line 48)
Blanchard Kahn conditions are not satisfied: indeterminacy due to rank failure

Error in stoch_simul (line 100)
    print_info(info, options_.noprint, options_);

Error in ex (line 314)
info = stoch_simul(var_list_);

Error in dynare (line 235)
evalin('base',fname) ;
0 Likes

#10

Here are the original codes,they could run well in dynare
var cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one;
varexo e;

parameters c0 lambda gam sig rho delt acc rhoz bet;

c0 = 0.11490;
lambda = 0.25882;
gam = 0.79706;
sig = 6.11251;
rho = 0.99578;
delt = 28.48666;
acc = 0.88879;
rhoz = 0.00147;
bet = 0.99900;

model;
cnsndt - yddt = c0one + (1-lambda)pvdy + (1-lambda)((gam(1-sig)(1-rho))/sig)pvdP +
(1-lambda)
(((1-sig)gam)/sig)pvdz - (1-lambda)(delt/sig)rreal + c_;
c_ = acc
c_(-1);
yddt =
0.42308 * cnsndt(-1)
-0.22215 * cnsndt(-2)
+0.71526 * cnsndt(-3)
-0.52802 * cnsndt(-4)
+0.61076 * yddt(-1)
+0.14172 * yddt(-2)
-0.042076 * yddt(-3)
-0.11279 * yddt(-4)
+0.10946 * rff(-1)
-0.26679 * rff(-2)
+0.22829 * rff(-3)
-0.031833 * rff(-4)
-0.17172 * pdotcpix(-1)
+0.11959 * pdotcpix(-2)
+0.012267 * pdotcpix(-3)
-0.024734 * pdotcpix(-4)
+0.00011277 * one;
rff =
0.46672 * cnsndt(-1)
-1.06382 * cnsndt(-2)
+1.34250 * cnsndt(-3)
-0.46436 * cnsndt(-4)
+0.11369 * yddt(-1)
+0.02255 * yddt(-2)
-0.16794 * yddt(-3)
-0.16131 * yddt(-4)
+1.10657 * rff(-1)
-0.51594 * rff(-2)
+0.35818 * rff(-3)
-0.02744 * rff(-4)
+0.26021 * pdotcpix(-1)
-0.08949 * pdotcpix(-2)
+0.09837 * pdotcpix(-3)
-0.17087 * pdotcpix(-4)
+0.00141 * one;
pdotcpix =
0.56316 * cnsndt(-1)
-0.70552 * cnsndt(-2)
-0.03313 * cnsndt(-3)
+0.23292 * cnsndt(-4)
+0.08268 * yddt(-1)
+0.24697 * yddt(-2)
-0.15223 * yddt(-3)
-0.08512 * yddt(-4)
+0.16054 * rff(-1)
-0.21888 * rff(-2)
-0.01572 * rff(-3)
+0.04213 * rff(-4)
+0.68637 * pdotcpix(-1)
+0.07805 * pdotcpix(-2)
+0.34762 * pdotcpix(-3)
-0.14149 * pdotcpix(-4)
+0.00348 * one;
rff - pdotcpix(+1) = rreal - 40.0
(rreal(+1) - rreal);
z = rhoz
z(-1) + (1-rhoz)cnsndt(-1);
P = bet
rhozP(+1) + (((rho-sig)/(1-sig))cnsndt - ((gam(1-sig)-1)(1-sig))z);
pvdy = rho
pvdy(+1) + (yddt(+1) - yddt);
pvdP = rhopvdP(+1) + (P(+1) - P);
pvdz = rho
pvdz(+1) + (z(+1) - z);
one = one(-1)+e;
end;

initval;
cnsndt = yddt;
end;

steady;
check;
shocks;
var e;
stderr 1;
end;

stoch_simul(dr_algo=0,periods=1000,irf=40);

The results of this American parameters model
Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file …
WARNING: habit.mod:173.13-21: dr_algo option is now deprecated, and may be removed in a future version of Dynare
Substitution of endo lags >= 2: added 12 auxiliary variables and equations.
Found 24 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    done
    Preprocessing completed.

STEADY-STATE RESULTS:

cnsndt 0
c_ 0
yddt 0
rff 0
pdotcpix 0
rreal 0
z 0
P 0
pvdy 0
pvdP 0
pvdz 0
one 0

EIGENVALUES:
Modulus Real Imaginary

   2.818e-05       -2.062e-05        1.921e-05
   2.818e-05       -2.062e-05       -1.921e-05
    3.01e-05        2.062e-05        2.193e-05
    3.01e-05        2.062e-05       -2.193e-05
      0.2581           0.1989           0.1645
      0.2581           0.1989          -0.1645
      0.3641          -0.2308           0.2816
      0.3641          -0.2308          -0.2816
      0.5867          -0.2945           0.5075
      0.5867          -0.2945          -0.5075
      0.6333          -0.1291             0.62
      0.6333          -0.1291            -0.62
      0.6448           0.5873           0.2661
      0.6448           0.5873          -0.2661
      0.7147           0.7147                0
      0.8888           0.8888                0
      0.9224           0.9181          0.08877
      0.9224           0.9181         -0.08877
           1                1                0
       1.004            1.004                0
       1.004            1.004                0
       1.004            1.004                0
       1.117            1.117                0
       679.6            679.6                0
   9.596e+20       -9.596e+20                0
   4.568e+21       -4.568e+21                0
    2.46e+22        -2.46e+22                0

There are 8 eigenvalue(s) larger than 1 in modulus
for 8 forward-looking variable(s)

The rank condition is verified.

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0

MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 1 colinear relationships between the variables and the equations
Colinear variables:
cnsndt
yddt
rff
pdotcpix
rreal
z
P
one
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Colinear equations
12
MODEL_DIAGNOSTICS: The singularity seems to be (partly) caused by the presence of a unit root
MODEL_DIAGNOSTICS: as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.
MODEL_DIAGNOSTICS: If the model is actually supposed to feature unit root behavior, such a warning is expected,
MODEL_DIAGNOSTICS: but you should nevertheless check whether there is an additional singularity problem.
MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS: is missing. The problem often derives from Walras Law.
warning: stoch_simul: using order = 1 because Hessian is equal to zero

In stoch_simul (line 41)
In habit (line 302)
In dynare (line 235)

MODEL SUMMARY

Number of variables: 24
Number of stochastic shocks: 1
Number of state variables: 19
Number of jumpers: 8
Number of static variables: 0

MATRIX OF COVARIANCE OF EXOGENOUS SHOCKS
Variables e
e 1.000000

POLICY AND TRANSITION FUNCTIONS
cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one
cnsndt(-1) 0.409592 0 0.423080 0.466720 0.563160 0.041042 0.998530 -25.513273 -0.421116 25.523236 -0.998996 0
c_(-1) 0.531564 0.888790 0 0 0 0.105222 0 0.512756 0.017299 -0.947988 0.017338 0
rff(-1) -0.370309 0 0.109460 1.106570 0.160540 0.115168 0 -0.357280 -0.115681 0.614860 -0.010252 0
one(-1) 0.024732 0 0.000113 0.001410 0.003480 0.026577 0 0.023860 0.005046 -0.152162 0.005133 1.000000
cnsndt(-2) 0.007627 0 -0.222150 -1.063820 -0.705520 -0.017832 0 0.007612 0.232646 -0.248762 0.009653 0
cnsndt(-3) -0.150125 0 0.715260 1.342500 -0.033130 0.096393 0 -0.145004 -0.724878 0.436271 -0.011636 0
cnsndt(-4) 0.027530 0 -0.528020 -0.464360 0.232920 -0.048656 0 0.026552 0.521517 0.023580 -0.002012 0
yddt(-2) 0.132004 0 0.141720 0.022550 0.246970 -0.027643 0 0.127323 -0.140072 -0.221058 0.003731 0
yddt(-3) 0.080291 0 -0.042076 -0.167940 -0.152230 -0.026205 0 0.077451 0.046780 -0.246456 0.006753 0
yddt(-4) 0.020468 0 -0.112790 -0.161310 -0.085120 -0.014358 0 0.019758 0.114300 -0.081809 0.002481 0
rff(-2) -0.000976 0 -0.266790 -0.515940 -0.218880 -0.019297 0 -0.000854 0.271375 -0.110815 0.004471 0
rff(-3) -0.056963 0 0.228290 0.358180 -0.015720 0.033747 0 -0.054967 -0.229153 0.127264 -0.002885 0
rff(-4) 0.003842 0 -0.031833 -0.027440 0.042130 -0.003615 0 0.003702 0.030928 0.010805 -0.000581 0
pdotcpix(-2) 0.140907 0 0.119590 -0.089490 0.078050 -0.032088 0 0.135885 -0.122108 -0.097043 -0.001578 0
pdotcpix(-3) 0.033223 0 0.012267 0.098370 0.347620 -0.009079 0 0.032027 -0.015576 0.028487 -0.002428 0
pdotcpix(-4) 0.051047 0 -0.024734 -0.170870 -0.141490 -0.016368 0 0.049257 0.028283 -0.152502 0.004125 0
yddt(-1) 0.281743 0 0.610760 0.113690 0.082680 -0.034898 0 0.271790 -0.603894 -0.416326 0.005740 0
pdotcpix(-1) -0.007157 0 -0.171720 0.260210 0.686370 -0.012502 0 -0.006908 0.153917 0.420138 -0.016543 0
z(-1) 0.000595 0 0 0 0 0.000016 0.001470 -0.037568 0.000002 0.037509 -0.001468 0
e 0.024732 0 0.000113 0.001410 0.003480 0.026577 0 0.023860 0.005046 -0.152162 0.005133 1.000000

MOMENTS OF SIMULATED VARIABLES
VARIABLE MEAN STD. DEV. VARIANCE SKEWNESS KURTOSIS
cnsndt -0.068608 0.122490 0.015004 -0.156576 0.125498
c_ -0.000000 0.000000 0.000000 -0.136574 0.134863
yddt -0.069130 0.118771 0.014107 -0.155304 -0.007440
rff -1.110331 1.292800 1.671331 -0.629046 -0.288603
pdotcpix -0.668992 0.770842 0.594197 -0.618003 -0.306053
rreal -0.453257 0.522794 0.273313 -0.634767 -0.299549
z -0.068534 0.122503 0.015007 -0.158199 0.124174
P 1.712026 3.063577 9.385502 0.157966 0.124150
pvdy 0.015122 0.097819 0.009568 0.279546 0.601983
pvdP -0.466569 2.593926 6.728455 -0.243876 0.527923
pvdz 0.018682 0.103675 0.010749 0.244836 0.529570
one -13.647178 15.685706 246.041381 -0.630439 -0.307404

CORRELATION OF SIMULATED VARIABLES
VARIABLE cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one
cnsndt 1.0000 -0.3407 0.9308 0.4446 0.4741 0.4872 0.9738 -0.9717 -0.7917 0.8475 -0.8501 0.5050
c_ -0.3407 1.0000 -0.3175 0.4429 0.4024 0.4510 -0.3916 0.3932 0.6609 -0.6985 0.6973 0.4408
yddt 0.9308 -0.3175 1.0000 0.5235 0.5458 0.5381 0.9708 -0.9713 -0.8536 0.8294 -0.8289 0.5498
rff 0.4446 0.4429 0.5235 1.0000 0.9987 0.9958 0.4635 -0.4637 -0.0097 0.0053 -0.0044 0.9938
pdotcpix 0.4741 0.4024 0.5458 0.9987 1.0000 0.9954 0.4935 -0.4937 -0.0363 0.0399 -0.0391 0.9940
rreal 0.4872 0.4510 0.5381 0.9958 0.9954 1.0000 0.4896 -0.4892 -0.0213 0.0296 -0.0295 0.9997
z 0.9738 -0.3916 0.9708 0.4635 0.4935 0.4896 1.0000 -1.0000 -0.8445 0.8853 -0.8856 0.5043
P -0.9717 0.3932 -0.9713 -0.4637 -0.4937 -0.4892 -1.0000 1.0000 0.8457 -0.8858 0.8860 -0.5037
pvdy -0.7917 0.6609 -0.8536 -0.0097 -0.0363 -0.0213 -0.8445 0.8457 1.0000 -0.9613 0.9605 -0.0347
pvdP 0.8475 -0.6985 0.8294 0.0053 0.0399 0.0296 0.8853 -0.8858 -0.9613 1.0000 -0.9999 0.0458
pvdz -0.8501 0.6973 -0.8289 -0.0044 -0.0391 -0.0295 -0.8856 0.8860 0.9605 -0.9999 1.0000 -0.0460
one 0.5050 0.4408 0.5498 0.9938 0.9940 0.9997 0.5043 -0.5037 -0.0347 0.0458 -0.0460 1.0000

AUTOCORRELATION OF SIMULATED VARIABLES
VARIABLE 1 2 3 4 5
cnsndt 0.9728 0.9221 0.8595 0.7893 0.7167
c_ 0.9945 0.9821 0.9626 0.9369 0.9064
yddt 0.9739 0.9175 0.8391 0.7506 0.6634
rff 0.9986 0.9976 0.9963 0.9945 0.9925
pdotcpix 0.9984 0.9973 0.9960 0.9942 0.9918
rreal 0.9977 0.9962 0.9945 0.9928 0.9911
z 0.9728 0.9221 0.8595 0.7893 0.7168
P 0.9718 0.9207 0.8581 0.7878 0.7152
pvdy 0.9604 0.8802 0.7699 0.6544 0.5470
pvdP 0.9597 0.8986 0.8257 0.7432 0.6585
pvdz 0.9616 0.9012 0.8283 0.7460 0.6613
one 0.9970 0.9948 0.9925 0.9904 0.9884
Total computing time : 0h00m11s
Note: 1 warning(s) encountered in the preprocessor
Note: warning(s) encountered in MATLAB/Octave code

Here are the codes with substituted parameters

var cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one;
varexo e;

parameters c0 lambda gam sig rho delt acc rhoz bet;

c0 = 0.22;
lambda = 0.50;
gam = 0.90;
sig = 10;
rho = 1;
delt = 10;
acc = 0.89;
rhoz = 0.0001;
bet = 0.99900;

model;
cnsndt - yddt = c0one + (1-lambda)pvdy + (1-lambda)((gam(1-sig)(1-rho))/sig)pvdP +
(1-lambda)
(((1-sig)gam)/sig)pvdz - (1-lambda)(delt/sig)rreal + c_;
c_ = acc
c_(-1);
yddt =
0.118724 * cnsndt(-1)
+0.448208 * cnsndt(-2)
+0.166217 * cnsndt(-3)
+0.284858 * cnsndt(-4)
-0.210454 * yddt(-1)
-0.364903 * yddt(-2)
-0.264717 * yddt(-3)
+0.868668 * yddt(-4)
-0.002622 * rff(-1)
+0.010931 * rff(-2)
+0.002676 * rff(-3)
-0.005766 * rff(-4)
-0.003396 * pdotcpix(-1)
-0.008557 * pdotcpix(-2)
-0.001714 * pdotcpix(-3)
+0.000656 * pdotcpix(-4)
+one;
rff =
1.724642 * cnsndt(-1)
+23.15204 * cnsndt(-2)
-0.309369 * cnsndt(-3)
+17.33500 * cnsndt(-4)
-8.918769 * yddt(-1)
-18.05803 * yddt(-2)
-7.352436 * yddt(-3)
-5.739763 * yddt(-4)
+0.616178 * rff(-1)
+0.413616 * rff(-2)
+0.173184 * rff(-3)
-0.571169 * rff(-4)
-0.170661 * pdotcpix(-1)
+0.048088 * pdotcpix(-2)
+0.102367 * pdotcpix(-3)
+0.256569 * pdotcpix(-4)
+one;
pdotcpix =
1.350612 * cnsndt(-1)
-5.725709 * cnsndt(-2)
+1.765075 * cnsndt(-3)
-8.544864 * cnsndt(-4)
-3.765590 * yddt(-1)
+3.189699 * yddt(-2)
+2.588477 * yddt(-3)
+8.802582 * yddt(-4)
+0.173176 * rff(-1)
-0.028764 * rff(-2)
-0.331193 * rff(-3)
+0.264100 * rff(-4)
-0.322855 * pdotcpix(-1)
-0.287717 * pdotcpix(-2)
-0.233162 * pdotcpix(-3)
-0.400467 * pdotcpix(-4)
+one;
/yddt =
0.42308 * cnsndt(-1)
-0.22215 * cnsndt(-2)
+0.71526 * cnsndt(-3)
-0.52802 * cnsndt(-4)
+0.61076 * yddt(-1)
+0.14172 * yddt(-2)
-0.042076 * yddt(-3)
-0.11279 * yddt(-4)
+0.10946 * rff(-1)
-0.26679 * rff(-2)
+0.22829 * rff(-3)
-0.031833 * rff(-4)
-0.17172 * pdotcpix(-1)
+0.11959 * pdotcpix(-2)
+0.012267 * pdotcpix(-3)
-0.024734 * pdotcpix(-4)
+0.00011277 * one;
rff =
0.46672 * cnsndt(-1)
-1.06382 * cnsndt(-2)
+1.34250 * cnsndt(-3)
-0.46436 * cnsndt(-4)
+0.11369 * yddt(-1)
+0.02255 * yddt(-2)
-0.16794 * yddt(-3)
-0.16131 * yddt(-4)
+1.10657 * rff(-1)
-0.51594 * rff(-2)
+0.35818 * rff(-3)
-0.02744 * rff(-4)
+0.26021 * pdotcpix(-1)
-0.08949 * pdotcpix(-2)
+0.09837 * pdotcpix(-3)
-0.17087 * pdotcpix(-4)
+0.00141 * one;
pdotcpix =
0.56316 * cnsndt(-1)
-0.70552 * cnsndt(-2)
-0.03313 * cnsndt(-3)
+0.23292 * cnsndt(-4)
+0.08268 * yddt(-1)
+0.24697 * yddt(-2)
-0.15223 * yddt(-3)
-0.08512 * yddt(-4)
+0.16054 * rff(-1)
-0.21888 * rff(-2)
-0.01572 * rff(-3)
+0.04213 * rff(-4)
+0.68637 * pdotcpix(-1)
+0.07805 * pdotcpix(-2)
+0.34762 * pdotcpix(-3)
-0.14149 * pdotcpix(-4)
+0.00348 * one; /
rff - pdotcpix(+1) = rreal - 40.0
(rreal(+1) - rreal);
z = rhoz
z(-1) + (1-rhoz)cnsndt(-1);
P = bet
rhoz
P(+1) + (((rho-sig)/(1-sig))cnsndt - ((gam(1-sig)-1)
(1-sig))z);
pvdy = rho
pvdy(+1) + (yddt(+1) - yddt);
pvdP = rhopvdP(+1) + (P(+1) - P);
pvdz = rho
pvdz(+1) + (z(+1) - z);
one = one(-1)+e;
end;

initval;
cnsndt = yddt;
end;

steady;
check;
shocks;
var e;
stderr 1;
end;
resid(1);
model_diagnostics;
stoch_simul(dr_algo=0,periods=1000,irf=40);
The results of Chinese parameters model
Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file …
WARNING: habit.mod:173.13-21: dr_algo option is now deprecated, and may be removed in a future version of Dynare
Substitution of endo lags >= 2: added 12 auxiliary variables and equations.
Found 24 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    done
    Preprocessing completed.

STEADY-STATE RESULTS:

cnsndt 0
c_ 0
yddt 0
rff 0
pdotcpix 0
rreal 0
z 0
P 0
pvdy 0
pvdP 0
pvdz 0
one 0

EIGENVALUES:
Modulus Real Imaginary

   1.945e-05        1.452e-05        1.293e-05
   1.945e-05        1.452e-05       -1.293e-05
   2.157e-05       -1.452e-05        1.595e-05
   2.157e-05       -1.452e-05       -1.595e-05
      0.2348           0.2348                0
      0.6386          -0.4689           0.4335
      0.6386          -0.4689          -0.4335
      0.7711            0.377           0.6727
      0.7711            0.377          -0.6727
        0.89             0.89                0
      0.8904          -0.6366           0.6225
      0.8904          -0.6366          -0.6225
      0.8964           0.6777           0.5867
      0.8964           0.6777          -0.5867
      0.9999           0.9999                0
           1                1                0
           1                1                0
           1                1                0
           1                1                0
        1.03            -1.03                0
       1.033         -0.01591            1.033
       1.033         -0.01591           -1.033
       1.484            1.484                0
   1.001e+04        1.001e+04                0
   1.306e+17       -1.306e+17                0
   1.156e+18       -1.156e+18                0
   6.891e+18       -6.891e+18                0

There are 8 eigenvalue(s) larger than 1 in modulus
for 8 forward-looking variable(s)

The rank condition ISN’T verified!

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0

MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 4 colinear relationships between the variables and the equations
Relation 1
Colinear variables:
cnsndt
yddt
rff
pdotcpix
rreal
z
P
pvdy
pvdP
pvdz
one
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 2
Colinear variables:
cnsndt
yddt
rff
pdotcpix
rreal
z
P
pvdy
pvdP
pvdz
one
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 3
Colinear variables:
cnsndt
yddt
rff
pdotcpix
rreal
z
P
pvdy
pvdP
pvdz
one
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 4
Colinear variables:
cnsndt
yddt
rff
pdotcpix
rreal
z
P
pvdy
pvdP
pvdz
one
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_0_3
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_2_3
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_3_3
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
AUX_ENDO_LAG_4_3
Relation 1
Colinear equations
9 10 11 12
Relation 2
Colinear equations
10 11 12
Relation 3
Colinear equations
9 10 11 12
Relation 4
Colinear equations
9 10 11
MODEL_DIAGNOSTICS: The singularity seems to be (partly) caused by the presence of a unit root
MODEL_DIAGNOSTICS: as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.
MODEL_DIAGNOSTICS: If the model is actually supposed to feature unit root behavior, such a warning is expected,
MODEL_DIAGNOSTICS: but you should nevertheless check whether there is an additional singularity problem.
MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS: is missing. The problem often derives from Walras Law.
Warning: stoch_simul: using order = 1 because Hessian is equal to zero

In stoch_simul (line 41)
In habit (line 302)
In dynare (line 235)
misused print_info (line 48)
Blanchard Kahn conditions are not satisfied: indeterminacy due to rank failure
error stoch_simul (line 100)
print_info(info, options_.noprint, options_);
error habit (line 302)
info = stoch_simul(var_list_);
error dynare (line 235)
evalin(‘base’,fname) ;

0 Likes

#11

The calibrating value of parameter rho is in the area of indeterminacy.
it can’t be less than 0.95 and greater than 1.
[0.995,1] is an appropriate area for smoother.

My code is

var cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one;
varexo e;

parameters c0 lambda gam sig rho delt acc rhoz bet;
/* US parameters
c0 = 0.11490;
lambda	= 0.25882;
gam = 0.79706;
sig = 6.11251;
rho = 0.99578;
delt = 28.48666;
acc = 0.88879;
rhoz = 0.00147;
bet = 0.99900;
*/
% Chinese parameters
c0 = 0.22;
lambda	= 0.50;
gam = 0.90;
sig = 10;
rho = 0.995;
delt = 10;
acc = 0.89;
rhoz = 0.0001;
bet = 0.99900;

model;
cnsndt - yddt = c0*one + (1-lambda)*pvdy + (1-lambda)*((gam*(1-sig)*(1-rho))/sig)*pvdP +
(1-lambda)*(((1-sig)*gam)/sig)*pvdz - (1-lambda)*(delt/sig)*rreal + c_;
c_ = acc*c_(-1);
yddt =
0.42308 * cnsndt(-1)
-0.22215 * cnsndt(-2)
+0.71526 * cnsndt(-3)
-0.52802 * cnsndt(-4)
+0.61076 * yddt(-1)
+0.14172 * yddt(-2)
-0.042076 * yddt(-3)
-0.11279 * yddt(-4)
+0.10946 * rff(-1)
-0.26679 * rff(-2)
+0.22829 * rff(-3)
-0.031833 * rff(-4)
-0.17172 * pdotcpix(-1)
+0.11959 * pdotcpix(-2)
+0.012267 * pdotcpix(-3)
-0.024734 * pdotcpix(-4)
+0.00011277 * one;
rff =
0.46672 * cnsndt(-1)
-1.06382 * cnsndt(-2)
+1.34250 * cnsndt(-3)
-0.46436 * cnsndt(-4)
+0.11369 * yddt(-1)
+0.02255 * yddt(-2)
-0.16794 * yddt(-3)
-0.16131 * yddt(-4)
+1.10657 * rff(-1)
-0.51594 * rff(-2)
+0.35818 * rff(-3)
-0.02744 * rff(-4)
+0.26021 * pdotcpix(-1)
-0.08949 * pdotcpix(-2)
+0.09837 * pdotcpix(-3)
-0.17087 * pdotcpix(-4)
+0.00141 * one;
pdotcpix =
0.56316 * cnsndt(-1)
-0.70552 * cnsndt(-2)
-0.03313 * cnsndt(-3)
+0.23292 * cnsndt(-4)
+0.08268 * yddt(-1)
+0.24697 * yddt(-2)
-0.15223 * yddt(-3)
-0.08512 * yddt(-4)
+0.16054 * rff(-1)
-0.21888 * rff(-2)
-0.01572 * rff(-3)
+0.04213 * rff(-4)
+0.68637 * pdotcpix(-1)
+0.07805 * pdotcpix(-2)
+0.34762 * pdotcpix(-3)
-0.14149 * pdotcpix(-4)
+0.00348 * one;
rff - pdotcpix(+1) = rreal - 40.0*(rreal(+1) - rreal);
z = rhoz*z(-1) + (1-rhoz)*cnsndt(-1);
P = bet*rhoz*P(+1) + (((rho-sig)/(1-sig))*cnsndt - ((gam*(1-sig)-1)*(1-sig))*z);
pvdy = rho*pvdy(+1) + (yddt(+1) - yddt);
pvdP = rho*pvdP(+1) + (P(+1) - P);
pvdz = rho*pvdz(+1) + (z(+1) - z);
one = one(-1)+e;
end;

initval;
cnsndt = yddt;
end;

steady;
check;
shocks;
var e;
stderr 1;
end;

stoch_simul(periods=1000,irf=40);
0 Likes

#12

The parameters in these equations are not the same as mine which are estimated using Chinese data by VAR.
America:
yddt =
0.42308 * cnsndt(-1)
-0.22215 * cnsndt(-2)
+0.71526 * cnsndt(-3)
-0.52802 * cnsndt(-4)
+0.61076 * yddt(-1)
+0.14172 * yddt(-2)
-0.042076 * yddt(-3)
-0.11279 * yddt(-4)
+0.10946 * rff(-1)
-0.26679 * rff(-2)
+0.22829 * rff(-3)
-0.031833 * rff(-4)
-0.17172 * pdotcpix(-1)
+0.11959 * pdotcpix(-2)
+0.012267 * pdotcpix(-3)
-0.024734 * pdotcpix(-4)
+0.00011277 * one;
rff =
0.46672 * cnsndt(-1)
-1.06382 * cnsndt(-2)
+1.34250 * cnsndt(-3)
-0.46436 * cnsndt(-4)
+0.11369 * yddt(-1)
+0.02255 * yddt(-2)
-0.16794 * yddt(-3)
-0.16131 * yddt(-4)
+1.10657 * rff(-1)
-0.51594 * rff(-2)
+0.35818 * rff(-3)
-0.02744 * rff(-4)
+0.26021 * pdotcpix(-1)
-0.08949 * pdotcpix(-2)
+0.09837 * pdotcpix(-3)
-0.17087 * pdotcpix(-4)
+0.00141 * one;
pdotcpix =
0.56316 * cnsndt(-1)
-0.70552 * cnsndt(-2)
-0.03313 * cnsndt(-3)
+0.23292 * cnsndt(-4)
+0.08268 * yddt(-1)
+0.24697 * yddt(-2)
-0.15223 * yddt(-3)
-0.08512 * yddt(-4)
+0.16054 * rff(-1)
-0.21888 * rff(-2)
-0.01572 * rff(-3)
+0.04213 * rff(-4)
+0.68637 * pdotcpix(-1)
+0.07805 * pdotcpix(-2)
+0.34762 * pdotcpix(-3)
-0.14149 * pdotcpix(-4)
+0.00348 * one;
China
yddt =
0.118724 * cnsndt(-1)
+0.448208 * cnsndt(-2)
+0.166217 * cnsndt(-3)
+0.284858 * cnsndt(-4)
-0.210454 * yddt(-1)
-0.364903 * yddt(-2)
-0.264717 * yddt(-3)
+0.868668 * yddt(-4)
-0.002622 * rff(-1)
+0.010931 * rff(-2)
+0.002676 * rff(-3)
-0.005766 * rff(-4)
-0.003396 * pdotcpix(-1)
-0.008557 * pdotcpix(-2)
-0.001714 * pdotcpix(-3)
+0.000656 * pdotcpix(-4)
+one;
rff =
1.724642 * cnsndt(-1)
+23.15204 * cnsndt(-2)
-0.309369 * cnsndt(-3)
+17.33500 * cnsndt(-4)
-8.918769 * yddt(-1)
-18.05803 * yddt(-2)
-7.352436 * yddt(-3)
-5.739763 * yddt(-4)
+0.616178 * rff(-1)
+0.413616 * rff(-2)
+0.173184 * rff(-3)
-0.571169 * rff(-4)
-0.170661 * pdotcpix(-1)
+0.048088 * pdotcpix(-2)
+0.102367 * pdotcpix(-3)
+0.256569 * pdotcpix(-4)
+one;
pdotcpix =
1.350612 * cnsndt(-1)
-5.725709 * cnsndt(-2)
+1.765075 * cnsndt(-3)
-8.544864 * cnsndt(-4)
-3.765590 * yddt(-1)
+3.189699 * yddt(-2)
+2.588477 * yddt(-3)
+8.802582 * yddt(-4)
+0.173176 * rff(-1)
-0.028764 * rff(-2)
-0.331193 * rff(-3)
+0.264100 * rff(-4)
-0.322855 * pdotcpix(-1)
-0.287717 * pdotcpix(-2)
-0.233162 * pdotcpix(-3)
-0.400467 * pdotcpix(-4)
+one;

0 Likes

#13

Sorry, too many parameters had been adjusted, and they maybe not appropriate.

0 Likes

#14

Thanks very much for your help

0 Likes

#15

I found that the VAR model is not stable ,and I restimated the VAR again to get a stable model,and used this new one to replace the former, the problem was solved.
var cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one;
varexo e;

parameters c0 lambda gam sig rho delt acc rhoz bet;

c0 = 0.22;
lambda = 0.50;
gam = 0.90;
sig = 10;
rho = 0.99;
delt = 2;
acc = 0.89;
rhoz = 0.0001;
bet = 0.99900;

model;
cnsndt - yddt = c0one + (1-lambda)pvdy + (1-lambda)((gam(1-sig)*(1-rho))/sig)pvdP +
(1-lambda)
(((1-sig)*gam)/sig)pvdz - (1-lambda)(delt/sig)rreal + c_;
c_ = acc
c_(-1);
yddt =
0.173842 * cnsndt(-1)
-0.050612 * cnsndt(-2)
-0.094435 * cnsndt(-3)
+0.314172 * yddt(-1)
+0.068899 * yddt(-2)

  • 0.116297 * yddt(-3)
    +6.50E-05 * rff(-1)
  • 0.003639 * rff(-2)
    -0.002855 * rff(-3)
    -0.000855 * pdotcpix(-1)
    -0.003619 * pdotcpix(-2)
    -0.002494 * pdotcpix(-3)
    +one;
    rff =
    -5.929343 * cnsndt(-1)
    +19.37706 * cnsndt(-2)
  • 26.48161 * cnsndt(-3)
    -45.48207 * yddt(-1)
    -87.06222 * yddt(-2)
    +9.387100 * yddt(-3)
    +1.074982 * rff(-1)
    -0.135574 * rff(-2)
    +0.147767 * rff(-3)
    +0.106680 * pdotcpix(-1)
    -0.307578 * pdotcpix(-2)
    -0.642825 * pdotcpix(-3)
    +one;
    pdotcpix =
    6.051769 * cnsndt(-1)
    +19.84066 * cnsndt(-2)
    +1.240049 * cnsndt(-3)
    -42.11207 * yddt(-1)
    +15.10935 * yddt(-2)
    -19.14845 * yddt(-3)
    +0.046488 * rff(-1)
    -0.078349 * rff(-2)
    +0.309381 * rff(-3)
    -0.793286 * pdotcpix(-1)
    -0.316557 * pdotcpix(-2)
    -0.503324 * pdotcpix(-3)
    +one;
    /yddt =
    0.42308 * cnsndt(-1)
    -0.22215 * cnsndt(-2)
    +0.71526 * cnsndt(-3)
    -0.52802 * cnsndt(-4)
    +0.61076 * yddt(-1)
    +0.14172 * yddt(-2)
    -0.042076 * yddt(-3)
    -0.11279 * yddt(-4)
    +0.10946 * rff(-1)
    -0.26679 * rff(-2)
    +0.22829 * rff(-3)
    -0.031833 * rff(-4)
    -0.17172 * pdotcpix(-1)
    +0.11959 * pdotcpix(-2)
    +0.012267 * pdotcpix(-3)
    -0.024734 * pdotcpix(-4)
    +0.00011277 * one;
    rff =
    0.46672 * cnsndt(-1)
    -1.06382 * cnsndt(-2)
    +1.34250 * cnsndt(-3)
    -0.46436 * cnsndt(-4)
    +0.11369 * yddt(-1)
    +0.02255 * yddt(-2)
    -0.16794 * yddt(-3)
    -0.16131 * yddt(-4)
    +1.10657 * rff(-1)
    -0.51594 * rff(-2)
    +0.35818 * rff(-3)
    -0.02744 * rff(-4)
    +0.26021 * pdotcpix(-1)
    -0.08949 * pdotcpix(-2)
    +0.09837 * pdotcpix(-3)
    -0.17087 * pdotcpix(-4)
    +0.00141 * one;
    pdotcpix =
    0.56316 * cnsndt(-1)
    -0.70552 * cnsndt(-2)
    -0.03313 * cnsndt(-3)
    +0.23292 * cnsndt(-4)
    +0.08268 * yddt(-1)
    +0.24697 * yddt(-2)
    -0.15223 * yddt(-3)
    -0.08512 * yddt(-4)
    +0.16054 * rff(-1)
    -0.21888 * rff(-2)
    -0.01572 * rff(-3)
    +0.04213 * rff(-4)
    +0.68637 * pdotcpix(-1)
    +0.07805 * pdotcpix(-2)
    +0.34762 * pdotcpix(-3)
    -0.14149 * pdotcpix(-4)
    +0.00348 * one; /
    rff - pdotcpix(+1) = rreal - 40.0
    (rreal(+1) - rreal);
    z = rhoz
    z(-1) + (1-rhoz)cnsndt(-1);
    P = bet
    rhozP(+1) + (((rho-sig)/(1-sig))cnsndt - ((gam(1-sig)-1)(1-sig))z);
    pvdy = rho
    pvdy(+1) + (yddt(+1) - yddt);
    pvdP = rhopvdP(+1) + (P(+1) - P);
    pvdz = rho
    pvdz(+1) + (z(+1) - z);
    one = one(-1)+e;
    end;

initval;
cnsndt = yddt;
end;

steady;
check;
shocks;
var e;
stderr 1;
end;
resid(1);
model_diagnostics;
stoch_simul(dr_algo=0,periods=1000,irf=40);

Results
dynare habit

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.7).
Starting preprocessing of the model file …
WARNING: habit.mod:178.13-21: dr_algo option is now deprecated, and may be removed in a future version of Dynare
Substitution of endo lags >= 2: added 8 auxiliary variables and equations.
Found 20 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    done
    Preprocessing completed.

STEADY-STATE RESULTS:

cnsndt 0
c_ 0
yddt 0
rff 0
pdotcpix 0
rreal 0
z 0
P 0
pvdy 0
pvdP 0
pvdz 0
one 0

EIGENVALUES:
Modulus Real Imaginary

   4.093e-06        4.093e-06                0
   4.179e-06       -2.047e-06        3.644e-06
   4.179e-06       -2.047e-06       -3.644e-06
     0.04526          0.04526                0
      0.3108           0.3108                0
      0.7516           0.7516                0
      0.7537          -0.5474           0.5181
      0.7537          -0.5474          -0.5181
      0.8233          0.06801           0.8205
      0.8233          0.06801          -0.8205
        0.88           0.6986           0.5351
        0.88           0.6986          -0.5351
        0.89             0.89                0
      0.9734          -0.9734                0
           1                1                0
        1.01             1.01                0
        1.01             1.01                0
        1.01             1.01                0
       1.194            1.194                0
        9969             9969                0
   2.569e+16        2.569e+16                0
   9.346e+16       -9.346e+16                0
   2.207e+18       -2.207e+18                0

There are 8 eigenvalue(s) larger than 1 in modulus
for 8 forward-looking variable(s)

The rank condition is verified.

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0

MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 1 colinear relationships between the variables and the equations
Colinear variables:
cnsndt
yddt
rff
pdotcpix
rreal
z
P
one
AUX_ENDO_LAG_0_1
AUX_ENDO_LAG_0_2
AUX_ENDO_LAG_2_1
AUX_ENDO_LAG_2_2
AUX_ENDO_LAG_3_1
AUX_ENDO_LAG_3_2
AUX_ENDO_LAG_4_1
AUX_ENDO_LAG_4_2
Colinear equations
12
MODEL_DIAGNOSTICS: The singularity seems to be (partly) caused by the presence of a unit root
MODEL_DIAGNOSTICS: as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.
MODEL_DIAGNOSTICS: If the model is actually supposed to feature unit root behavior, such a warning is expected,
MODEL_DIAGNOSTICS: but you should nevertheless check whether there is an additional singularity problem.
MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS: is missing. The problem often derives from Walras Law.
警告: stoch_simul: using order = 1 because Hessian is equal to zero

In stoch_simul (line 41)
In habit (line 266)
In dynare (line 235)

MODEL SUMMARY

Number of variables: 20
Number of stochastic shocks: 1
Number of state variables: 15
Number of jumpers: 8
Number of static variables: 0

MATRIX OF COVARIANCE OF EXOGENOUS SHOCKS
Variables e
e 1.000000

POLICY AND TRANSITION FUNCTIONS
cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one
cnsndt(-1) -0.023224 0 0.173842 -5.929343 6.051769 1.832794 0.999900 -81.914894 -0.175381 82.647503 -1.008953 0
c_(-1) 0.397097 0.890000 0 0 0 4.946064 0 0.394324 0.000716 -0.678295 0.003461 0
rff(-1) -0.007816 0 0.000065 1.074982 0.046488 0.078498 0 -0.007762 -0.000029 0.023124 -0.000189 0
one(-1) 7.606945 0 1.000000 1.000000 1.000000 -64.190735 0 7.554071 0.897351 -542.682375 6.613996 1.000000
cnsndt(-2) -0.567651 0 -0.050612 19.377060 19.840660 5.407009 0 -0.563700 0.048850 2.182639 -0.019942 0
cnsndt(-3) -0.385275 0 -0.094435 26.481610 1.240049 3.373997 0 -0.382586 0.094549 1.276146 -0.010998 0
yddt(-2) 0.866863 0 0.068899 -87.062220 15.109350 -8.308964 0 0.860825 -0.068771 -3.032099 0.026733 0
yddt(-3) 0.147131 0 0.116297 9.387100 -19.148450 -0.877622 0 0.146104 -0.113966 -0.715300 0.007018 0
rff(-2) 0.003659 0 0.003639 -0.135574 -0.078349 -0.018446 0 0.003634 -0.003675 -0.005373 0.000021 0
rff(-3) -0.006556 0 -0.002855 0.147767 0.309381 0.051022 0 -0.006510 0.002820 0.025251 -0.000231 0
pdotcpix(-2) -0.000796 0 -0.003619 -0.307578 -0.316557 -0.010373 0 -0.000791 0.003562 0.008976 -0.000101 0
pdotcpix(-3) 0.002343 0 -0.002494 -0.642825 -0.503324 -0.035885 0 0.002326 0.002482 -0.004318 0.000024 0
yddt(-1) 1.716418 0 0.314172 -45.482070 -42.112070 -15.548014 0 1.704456 -0.309907 -6.505093 0.059130 0
pdotcpix(-1) -0.000667 0 -0.000855 0.106680 -0.793286 0.002198 0 -0.000663 0.000806 0.008407 -0.000096 0
z(-1) 0.000006 0 0 0 0 0.000010 0.000100 -0.008184 0 0.008183 -0.000100 0
e 7.606945 0 1.000000 1.000000 1.000000 -64.190735 0 7.554071 0.897351 -542.682375 6.613996 1.000000

MOMENTS OF SIMULATED VARIABLES
VARIABLE MEAN STD. DEV. VARIANCE SKEWNESS KURTOSIS
cnsndt -89.531609 102.621007 10531.071021 -0.624714 -0.311312
c_ -0.000000 0.000000 0.000000 -0.644280 -0.234483
yddt -25.743537 29.673647 880.525331 -0.627115 -0.294959
rff 191.106247 522.917695 273442.915342 0.135166 -0.279607
pdotcpix -458.343601 546.416775 298571.291741 -0.561981 -0.219157
rreal 607.787218 695.992293 484405.271975 0.621314 -0.313701
z -89.218265 102.675865 10542.333230 -0.626828 -0.305328
P 7218.068455 8307.552350 69015426.055523 0.626799 -0.305166
pvdy 0.009341 2.291385 5.250447 0.050509 -0.001997
pvdP -10.526929 641.788942 411893.046108 -0.026204 0.006418
pvdz 0.134013 7.850829 61.635516 0.026651 0.004728
one -13.647178 15.685706 246.041381 -0.630439 -0.307404

CORRELATION OF SIMULATED VARIABLES
VARIABLE cnsndt c_ yddt rff pdotcpix rreal z P pvdy pvdP pvdz one
cnsndt 1.0000 0.9822 0.9980 -0.3608 0.9685 -0.9998 0.9970 -0.9970 -0.0288 0.0109 -0.0114 0.9990
c_ 0.9822 1.0000 0.9846 -0.2455 0.9575 -0.9795 0.9845 -0.9845 0.0003 -0.0038 0.0043 0.9879
yddt 0.9980 0.9846 1.0000 -0.3332 0.9735 -0.9967 0.9972 -0.9971 -0.0806 0.0385 -0.0389 0.9970
rff -0.3608 -0.2455 -0.3332 1.0000 -0.3583 0.3684 -0.3740 0.3742 -0.0337 -0.4839 0.4868 -0.3374
pdotcpix 0.9685 0.9575 0.9735 -0.3583 1.0000 -0.9663 0.9716 -0.9716 -0.1285 0.0993 -0.0998 0.9668
rreal -0.9998 -0.9795 -0.9967 0.3684 -0.9663 1.0000 -0.9956 0.9955 0.0200 0.0003 0.0003 -0.9984
z 0.9970 0.9845 0.9972 -0.3740 0.9716 -0.9956 1.0000 -1.0000 -0.0433 0.0759 -0.0761 0.9971
P -0.9970 -0.9845 -0.9971 0.3742 -0.9716 0.9955 -1.0000 1.0000 0.0435 -0.0767 0.0769 -0.9970
pvdy -0.0288 0.0003 -0.0806 -0.0337 -0.1285 0.0200 -0.0433 0.0435 1.0000 -0.5104 0.5135 -0.0037
pvdP 0.0109 -0.0038 0.0385 -0.4839 0.0993 0.0003 0.0759 -0.0767 -0.5104 1.0000 -1.0000 -0.0003
pvdz -0.0114 0.0043 -0.0389 0.4868 -0.0998 0.0003 -0.0761 0.0769 0.5135 -1.0000 1.0000 0.0000
one 0.9990 0.9879 0.9970 -0.3374 0.9668 -0.9984 0.9971 -0.9970 -0.0037 -0.0003 0.0000 1.0000

AUTOCORRELATION OF SIMULATED VARIABLES
VARIABLE 1 2 3 4 5
cnsndt 0.9959 0.9914 0.9866 0.9829 0.9804
c_ 0.9988 0.9985 0.9981 0.9975 0.9967
yddt 0.9954 0.9878 0.9814 0.9785 0.9786
rff 0.8825 0.5957 0.2502 -0.0431 -0.2021
pdotcpix 0.9079 0.9593 0.8790 0.9529 0.8859
rreal 0.9947 0.9896 0.9845 0.9803 0.9772
z 0.9960 0.9914 0.9866 0.9829 0.9804
P 0.9959 0.9913 0.9866 0.9828 0.9803
pvdy 0.4651 -0.1552 -0.4599 -0.4737 -0.3120
pvdP 0.1881 -0.0990 -0.2892 -0.2645 -0.1557
pvdz 0.1897 -0.0985 -0.2892 -0.2650 -0.1562
one 0.9970 0.9948 0.9925 0.9904 0.9884
Total computing time : 0h00m22s
Note: 1 warning(s) encountered in the preprocessor
Note: warning(s) encountered in MATLAB/Octave code

0 Likes

#16

It is good. Glad to hear the news.

0 Likes