Skip to content
Snippets Groups Projects
Select Git revision
  • 5ddffcb3dcd9846df6a10998c4431bf704ccea3f
  • master default protected
  • 6.x protected
  • madysson
  • 5.x protected
  • asm
  • time-varying-information-set
  • 4.6 protected
  • dynare_minreal
  • dragonfly
  • various_fixes
  • 4.5 protected
  • clang+openmp
  • exo_steady_state
  • declare_vars_in_model_block
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • slice
  • aux_func
  • penalty
  • 6.4 protected
  • 6.3 protected
  • 6.2 protected
  • 6.1 protected
  • 6.0 protected
  • 6-beta2 protected
  • 6-beta1 protected
  • 5.5 protected
  • 5.4 protected
  • 5.3 protected
  • 5.2 protected
  • 5.1 protected
  • 5.0 protected
  • 5.0-rc1 protected
  • 4.7-beta3 protected
  • 4.7-beta2 protected
  • 4.7-beta1 protected
  • 4.6.4 protected
  • 4.6.3 protected
  • 4.6.2 protected
41 results

Occbin_example.mod

Blame
  • example1_model_block_declared_vars.mod NaN GiB
    // Declaration of some endogenous variables.
    var c;
    
    /*
    ** REMARKS
    **
    ** Some declarations for the endogenous variables are missing. They are declared below in
    ** the model block.
    **
    */
    
    // Declaration of some of the parameters.
    parameters beta, rho, theta, psi, tau;
    
    rho   = 0.95;
    tau   = 0.025;
    beta  = 0.99;
    psi   = 0;
    theta = 2.95;
    phi   = 0.1;
    
    /*
    ** REMARKS
    **
    ** Same remark, some parameters are defined in the below in the model block (alpha and delta). These
    ** variables must be calibrated after the model block (ie after the calibration).
    **
    ** We do not declare the exogenous variables in the preamble. The innovations are decalred in the model
    ** block below.
    **
    */
    
    model;
    c*theta*h|e^(1+psi)=(1-alpha)*y;
    k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
        *(exp(b(+1))*alpha|p*y(+1)+(1-delta)*k));
    y|e = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
    k|e = exp(b)*(y-c)+(1-delta|p)*k(-1);
    a|e = rho*a(-1) + e|x;
    b|e = rho*b(-1) + u|x;
    end;
    
    /*
    ** REMARKS
    **
    ** On the fly declaration works as follows:
    **
    **  - A symbol followed by |e implicitely declares an endogenous variable.
    **  - A symbol followed by |x implicitely declares an exogenous variable.
    **  - A symbol followed by |p implicitely declares a parameter.
    **
    ** A parameter declared on the fly has to be calibrated after its declaration, ie after the model
    ** block. If the user tries to give a value to a parameter before its declaration, then Dynare
    ** interpret the calibration as a matlab statement, because Dynare doesn't know that the symbol is
    ** a parameter.
    **
    ** By default an undeclared symbol is interpreted as an exogenous variable. Consequently, if the user
    ** removes an equation where an endogenous variable is declared, the status of the variable changes.
    ** For instance, if one comments the last equation, the law of motion of b, symbol b becomes an
    ** exogenous variable (whose value is zero by default). A more interesting use case, is to remove
    ** the first equation, the arbitrage condition between leisure and consumption. Labour supply is
    ** then supposed to be exogenous.
    */
    
    alpha = 0.36;
    delta = 0.025;
    
    initval;
    y = 1.08068253095672;
    c = 0.80359242014163;
    h = 0.29175631001732;
    k = 11.08360443260358;
    a = 0;
    b = 0;
    e = 0;
    u = 0;
    end;
    
    shocks;
      var e; stderr 0.009;
      var u; stderr 0.009;
      var e, u = phi*0.009*0.009;
    end;
    
    stoch_simul(order=1);