A DSGE Model with a financial rigidity

I have tried to solve my model in dynare and apparently i have found the steady state of the model, but the problem is that there are 6 eginvalues larger than 1 in modulus for 7 forward-looking variables.

The Blanchard & Kahn conditions are not satisifed.

This is my code:

//----------------------------------------------------------------

// MODELO DE TESIS: DSGE-SOE

//----------------------------------------------------------------

//----------------------------------------------------------------

// 1. VARIABLE DECLARATION

//----------------------------------------------------------------

var

    pih     // Domestic inflation

    x       // Output gap

    y       // Output

    ynat    // Natural output

    rnat    // Natural real interest rate

    r       // Nominal interest rate

    s       // Terms of trade

    pi      // CPI Inflation

    exch_rate // Nominal exchange rate

    ystar   // World output

    pistar  // World inflation

    a       // Domestic productivity shock

    r_l_hat // Lending interest rate

    mu_r_hat // Credit spread

    xi_hat  // Bank competition shock

    s_hat   // Stock of "deep habits"

    l_hat   // Loans

    x_hat   // Loan composite

    mc_hat  // Real marginal cost

;

varexo

    eps_a       // Domestic productivity shock

    eps_star    // World output shock

    e_xi        // Spread shock (bank competition)

;

//----------------------------------------------------------------

// 2. STRUCTURAL PARAMETER DECLARATION

//----------------------------------------------------------------

parameters

    sigma phi epsilon theta beta rhoa alpha eta gamma rhoy phi_pi

    aalpha ttheta rrho_s rrho_xi mmu_r_ss;

//----------------------------------------------------------------

// 3. STRUCTURAL PARAMETER CALIBRATION

//----------------------------------------------------------------

sigma   = 1; eta     = 1; gamma   = 1; phi     = 3; epsilon = 6;

theta   = 0.75; beta    = 0.99; alpha   = 0.4; phi_pi  = 2.5;

rhoa    = 0.9; rhoy    = 0.86; aalpha  = 1; ttheta  = 0.5;

rrho_s  = 0; rrho_xi = 0.9; mmu_r_ss = 1 + (0.02/4);

//----------------------------------------------------------------

// 4. MODEL BLOCK (LOG-LINEARIZED)

//----------------------------------------------------------------

model(linear);

    // --- 4.1 COMPOSITE PARAMETER CALCULATION ---

    #rho  = beta^(-1)-1;

    #omega_GM = sigma\*gamma+(1-alpha)\*(sigma\*eta-1);

    #sigma_a = sigma/((1-alpha)+alpha\*omega_GM);

    #Theta_GM = (sigma\*gamma-1)+(1-alpha)\*(sigma\*eta-1);

    #lambda_GM = (1-beta\*theta)\*(1-theta)/theta;

    #Gamma = (1+phi)/(sigma_a+phi);

    #Psi = -Theta_GM\*sigma_a/(sigma_a+phi);

    #eeta = (aalpha\*mmu_r_ss)/((1-aalpha)\*beta + aalpha\*mmu_r_ss);

    #xxi = (mmu_r_ss\*(1-ttheta\*beta\*(1-rrho_s)))/(mmu_r_ss\*(1-ttheta)-(1-ttheta));

    #oomega = (1-beta\*ttheta\*(1-rrho_s))/(xxi\*(1-ttheta));

    // --- 4.2 MODEL EQUATIONS ---

    x = x(+1) - (1/sigma_a)\*(r - pih(+1) - rnat);

    rnat = -sigma_a\*Gamma\*(1-rhoa)\*a + alpha\*sigma_a\*(Theta_GM+Psi)\*(ystar(+1)-ystar);

    ynat = Gamma\*a + alpha\*Psi\*ystar;

    x = y - ynat;

    (1 - oomega/(1-beta\*ttheta\*(1-rrho_s)))\*mu_r_hat =

          ((1-ttheta)^(-1)\*ttheta\*oomega/(1-beta\*ttheta\*(1-rrho_s))) \* (beta\*ttheta\*(1-rrho_s)\*(l_hat(+1)-s_hat) - (l_hat-s_hat(-1)))

        - (ttheta\*beta\*oomega\*(1-rrho_s)/(1-beta\*ttheta\*(1-rrho_s))) \* (r(+1) - r)

        - (ttheta\*beta\*oomega\*(1-rrho_s)/(1-beta\*ttheta\*(1-rrho_s))) \* mu_r_hat(+1)

        + (ttheta\*beta\*oomega\*(1-rrho_s)/(1-beta\*ttheta\*(1-rrho_s))) \* (r - pih(+1))

        - oomega\*xi_hat;

    l_hat = ttheta\*s_hat(-1) + (1-ttheta)\*x_hat;

    x_hat = (1+sigma+phi)\*y - (1+phi)\*a; // Corrected: uses sigma

    s_hat = (rrho_s + (1-rrho_s)\*ttheta)\*s_hat(-1) + (1-rrho_s)\*(1-ttheta)\*x_hat;

    mu_r_hat = r_l_hat - r;

    mc_hat = (sigma_a+phi)\*x + eeta\*r_l_hat;

    pih = beta\*pih(+1) + lambda_GM\*mc_hat;

    r = phi_pi\*pih;

    pi = pih + alpha\*(s - s(-1));

    s = s(-1) + exch_rate - exch_rate(-1) + pistar - pih;

    pistar = 0;

    r = exch_rate(+1) - exch_rate;

    a = rhoa\*a(-1) + eps_a;

    ystar = rhoy\*ystar(-1) + eps_star;

    xi_hat = rrho_xi\*xi_hat(-1) + e_xi;

end;

//----------------------------------------------------------------

// 5. STEADY STATE AND SIMULATION

//----------------------------------------------------------------

steady;

check;

shocks;

    var eps_a; stderr 0.0071;

    var eps_star; stderr 0.0078;

    var e_xi; stderr 0.01;

end;

stoch_simul(order=1, irf=40) y x pih pi s exch_rate r r_l_hat mu_r_hat l_hat mc_hat;

Please, i would like someone to help me

What determines the interest rate in your model?

Dear @Fernando1 , I advise you to try to find endogenous variables in your model which are not linked by an equation. The BK error poping out even when steady states are calculated is a sign that there are some redundant equations and some necessary equations missing. In your case of 7 forward-looking variables and 6 eigenvalues larger than 1 by modulus, it means that there is one redundant equation (some variable is determined twice), while another equation is missing (some two endogenous variables are not linked and they are behaving independently from each other). Start by tracing how one variable affects another one, and you will be able to find both the overidentified and underidentified endogenous variables. This process might seem cumbersome, but the results are worth trying. If you still have trouble identifying these variables, just let me know, and i will also search for the overidentified/underidentified variables.

The interest rate for loans is determined by the monopolistic competition in banks, and the pasive interest rate is determined by a simple Taylor rule that focuses only in prices.

Would you mind to tell, how I can do it, please?

I understand the fact that I have one redundant equation, but when I eliminate one equation, there are more endogenous variables than equations.

Does your model work without the financial rigidity?

I ran model_diagnostics; and here’s what I found:

MODEL_DIAGNOSTICS:  The Jacobian of the static model is singular
MODEL_DIAGNOSTICS:  there is 2 collinear relationships between the variables and the equations
Relation 1
Collinear variables:
s
exch_rate
Relation 2
Collinear variables:
s
exch_rate
Relation 1
Collinear equations
     1     2    12    14    16    17

Relation 2
Collinear equations
     1     2    12    14    16    17

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.
Total computing time : 0h00m00s

What this says is that basically you need to resolve the collinearity caused by s and exch_rate variables: s and exch_rate move one-for-one and are not independently determined. Nothing in the model pins down the level of exch_rate — only its differences matter (since the model is linearized). That is why Dynare finds a unit root: exch_rate is only determined up to an arbitrary constant, and s inherits that non-stationarity. Hence, you get: “Variable exch_rate is not in maximum cardinality matching”.

In a log-linearized small open economy DSGE:

  • Only relative prices are stationary (e.g., changes in exchange rate, inflation differentials, terms of trade).
  • The level of the exchange rate** drops out**; it’s not a meaningful steady-state variable in logs.

Thus, your model should not include both s and exch_rate levels.
You must pick one consistent variable to represent the external price differential.

You can replace s-s(-1) by ds and exch_rate-exch_rate(-1) by d_exch_rate. But that will not solve the indeterminacy problem. There must be something more fundamental.