Undefine Variable Error

I am trying to replicate the paper written ng Harrison (2012). I used a medium-scale model to replicate his paper. Upon performing the simulation I received the below error

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

The rank condition ISN’T verified!

warning: Problem in the model specification: some variables don’t appear as current. Check whether this is desired.
warning: called from
check_model at line 21 column 5
stoch_simul at line 92 column 1
driver at line 255 column 27
dynare at line 281 column 5

error: Blanchard & Kahn conditions are not satisfied: indeterminacy.
error: called from
print_info at line 32 column 5
stoch_simul at line 120 column 5
driver at line 255 column 27
dynare at line 281 column 5

model_diagnostics
error: ‘M’ undefined near line 38, column 38
error: called from
model_diagnostics at line 38 column 10

I knew that M is define in the model by Equation 2 and wondering why I am getting that error.
EAPBSP.mod (3.5 KB)

Thanks,

Aris

As model_diagnostics says:

MODEL_DIAGNOSTICS: The following endogenous variables aren't present at the current period in the model:
RL

What is the solution in this case?

The variable of RL is not in time t
in your model.

You should review this variable in your model and equations again.

I have the same error but in another model may be because i put K in time (t-1)?

If K or capital stock is a predetermined variable in your model it should be in time t and t-1

There are four type of variables in DSGE models.

Static variables ( t )
Purely predetermined variables ( t and t-1 )
Mixed variables ( t and t-1 and t+1)
Purely forward looking variables ( t and t+1)

I corrected the code on this page : https://forum.dynare.org/t/the-jacobian-or-the-dynamic-model-contains-inf/10854/5, extracted the results, but I encountered that message.
This is the file of the corrected code:

code.mod (22.7 KB)

code_steadystate.m (9.0 KB)

You need to figure out the timing. For example,

       K(-1)=Ko+Kno;

does not make sense.

I recalculated the aggregate capital twice, but I still encounter the same issue. Frankly, I don’t know how to solve the problem.
moncode.mod (23.2 KB)

Check that your initializations can be sequentially executed. You did not set b_SS in

T_SS=(((b_SS^(phi_b))*(GI_SS^(phi_I))*(GC_SS^(phi_C)))/(OR_SS^phi_OR));

I have verified the presence of the steady-state equation for 𝑏_𝑆𝑆 , and it is included in the file dedicated to the steady state. Here is the equation:
b_SS=(((phi_I*Yo_SS)+(gammaa_IOF*OR_SS))-GI_SS)/gammaa_GI;

After this observation, I searched the file and found that there is no equation for
𝐾 in the steady-state file. I attempted to find an equation for it, but the problem is that the study did not provide any indication for calculating the accumulated capital. I tried to estimate the relationship between Ko and Kno econometrically, but the problem remained unsolved. All I could do was assume that 𝐾(𝑡)=(1−𝛿)*𝐾(𝑡−1)+𝐼, yet I couldn’t find the correct steady-state equation. I need assistance in resolving this issue." "After running the model, I still encounter the following message:

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

The rank condition is verified.

Warning: Problem in the model specification: some variables don't appear as current. Check whether this is desired.

In check_model (line 21)
In stoch_simul (line 92)
In moncode.driver (line 801)
In dynare (line 278)"

Without the mod-file it is impossible to tell what is going on.

This is the mode file

code.mod (22.7 KB)

code_steadystate.m (8.8 KB)
dynarewp049.pdf (459.3 KB)

There is still something wrong with your timing.

       K(-1)=Ko+Kno;

cannot be correct as K does never appear contemporaneously in the model.

When I performed the simulation, I found that the values of the variables related to the external sector were missing. Should the steady state of these variables be calculated, and could this be related to the problem?

MODEL SUMMARY

  Number of variables:         35
  Number of stochastic shocks: 4
  Number of state variables:   20
  Number of jumpers:           8
  Number of static variables:  9


MATRIX OF COVARIANCE OF EXOGENOUS SHOCKS
Variables         u_Z       u_r       e_o      u_fx
u_Z          0.000100  0.000000  0.000000  0.000000
u_r          0.000000  0.000100  0.000000  0.000000
e_o          0.000000  0.000000  0.000100  0.000000
u_fx         0.000000  0.000000  0.000000  0.000100

POLICY AND TRANSITION FUNCTIONS
                                   Y              Yo             Yno               C               K              Ko             Kno              KG              NX              OR               b               T              GC              GI               I            PX_o            PX_d             RER             SWF             FDI               R             p_h             p_g            PX_h               N          PXstar           Rstar        fxr_star           bstar           Ystar         Pstar_o               Z           eps_r          eps_fx
K(-1)                      -0.989053               0        6.624007       32.866726        2.706030               0        1.000000        0.016874       16.372395        8.437129    -1218.375965        3.492972        0.793090        0.843713       40.000000       19.493875       11.056746        8.437129               0               0        0.396790      -13.897181      -11.663750        1.883157        9.931044               0               0       -9.637220      235.360276               0               0               0               0               0
Ko(-1)                      1.851550        0.700000       -5.742618      -31.703994       -1.688707        0.975000       -0.975000       -0.006487      -13.871403       -8.003691     1228.808102       -3.119628       -0.653647       -0.324369      -39.000000      -18.619408      -10.615717       -8.003691       85.820000               0       -0.375940       13.697661       11.527526       -1.853642       -8.609622               0               0        9.201941     -228.907419               0               0               0               0               0
Kno(-1)                     0.986040               0       -6.432119      -32.021992       -1.687558               0               0       -0.016389      -15.901289       -8.194356     1187.458927       -3.392463       -0.770269       -0.819436      -39.000000      -18.959865      -10.765510       -8.194356               0               0       -0.386114       13.538423       11.365145       -1.843220      -10.142608               0               0        9.372592     -228.578898               0               0               0               0               0
KG(-1)                     -0.033890               0       -0.034993       -0.027517        0.000033               0               0        0.979916       -0.081743       -0.042099       -0.226081       -0.017429       -0.003957       -0.004210               0       -0.070241       -0.028142       -0.042099               0               0       -0.001301        0.006575        0.001708        0.004913       -0.292343               0               0        0.035357       -0.009976               0               0               0               0               0
b(-1)                      -0.001271               0       -0.199207        0.003098        0.000053               0               0       -0.005996        0.004154        0.002139        0.590164        0.199885       -0.140799       -0.299786               0        0.001386       -0.000753        0.002139               0               0       -0.000019        0.195663        0.176311       -0.001405       -0.298661               0               0       -0.000768       -0.020926               0               0               0               0               0
GC(-1)                     -0.005053               0        0.439298       -0.000099       -0.000092               0               0       -0.000005       -0.005194       -0.002674       -0.487409        0.528893        0.529749       -0.000267               0       -0.000411        0.002263       -0.002674               0               0        0.000034       -0.445937       -0.401610        0.002457        0.658618               0               0        0.000338        0.034924               0               0               0               0               0
SWF(-1)                     0.001048               0        0.106405       -0.000191       -0.000026               0               0        0.001999       -0.003229        0.999328        0.149742        0.413722        0.093937        0.099933               0       -0.000047        0.000625       -0.000672        0.775000               0        0.000022       -0.104211       -0.093857        0.000648        0.159528               0               0        0.000058        0.009800               0               0               0               0               0
FDI(-1)                     0.040887               0        0.006562       -0.128667       -0.007530        0.005000       -0.005000       -0.000075       -0.158673       -0.037728        7.913521       -0.015619       -0.003546       -0.003773       -0.200000       -0.093090       -0.055363       -0.037728               0        0.200000       -0.001783        0.086734        0.074288       -0.011555        0.009838               0               0        0.045883       -1.235190               0               0               0               0               0
R(-1)                      -5.699760               0       -6.022664       -4.821050       -0.000745               0               0       -0.014509      -14.085702       -7.254263      -16.735101       -3.003265       -0.681901       -0.725426               0      -10.724389       -3.470126       -7.254263               0               0        0.771032        1.359239        0.497889        1.576645       -9.029481               0               0        5.442917        0.733528               0               0               0               0               0
Rstar(-1)                  -0.002730               0        0.472525        0.003323       -0.000081               0               0        0.008883       -0.014302        4.441459       -0.525924        1.838764        0.417497        0.444146               0       -0.001053        0.001932       -0.002985               0               0        0.000033       -0.475085       -0.427875        0.002428        0.708433               0               0        0.000657        0.031006               0               0               0               0               0
fxr_star(-1)                0.061197               0        0.060153        0.045422        0.000078               0               0        0.000144        0.140157        0.072181        0.904513        0.029883        0.006785        0.007218               0        0.104100        0.031919        0.072181               0               0        0.001719       -0.006278        0.001568       -0.017069        0.090184               0               0        0.647071       -0.039586               0               0               0               0               0
bstar(-1)                  -0.000019               0       -0.000019       -0.000017               0               0               0               0        0.000040       -0.000002       -0.001138               0               0               0               0       -0.000001               0       -0.000002               0               0               0       -0.000011       -0.000010        0.000001       -0.000029               0               0               0        0.000029               0               0               0               0               0
Ystar(-1)                  39.028592               0       31.482966       30.916795        0.047259               0               0       -0.060131       93.097062      -30.065431      355.244710      -12.447088       -2.826151       -3.006543               0       52.593539       22.260298       47.868339               0               0        1.074607        1.652461        6.274049       -2.489603       47.200849       17.535098       26.402648      -27.356447      -35.906168        0.800000               0               0               0               0
Pstar_o(-1)                 1.015272               0        0.501090       -0.066508       -0.012085        0.015600       -0.015600        0.000076        1.656653        0.038026       65.462012        0.015743        0.003574        0.003803       -0.624000       -0.247071       -0.065096        0.038026       95.628000        0.624000       -0.000785        0.645680        0.584914       -0.052357        0.751259               0               0        0.010697       -3.543742               0        0.780000               0               0               0
Z(-1)                      -0.035290               0       -0.033676       -0.024771        0.000179               0               0       -0.000081       -0.078331       -0.040342       -0.652916       -0.016702       -0.003792       -0.004034               0       -0.084727       -0.044384       -0.040342               0               0       -0.001823        0.001754       -0.002456       -0.004513       -1.399814               0               0        0.042085       -0.063067               0               0        0.900000               0               0
eps_r(-1)                          0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0        0.950000               0
eps_fx(-1)                 -3.848279               0       -4.109107       -3.315176       -0.000096               0               0       -0.009904       -9.615327       -4.951982       -5.255299       -2.050121       -0.465486       -0.495198               0       -7.334894       -2.382912       -4.951982               0               0        0.277588        0.996631        0.401770        1.068803       -6.160581               0               0        3.722142        0.406581               0               0               0               0        0.400000
I(-1)                       0.063289               0       -0.123983       -0.214702       -0.018276               0               0       -0.000321       -0.311875       -0.160748       30.438946       -0.066550       -0.015110       -0.016075               0       -0.409624       -0.248876       -0.160748               0               0       -0.008572        0.336629        0.286892       -0.056112       -0.185881               0               0        0.201613       -5.861621               0               0               0               0               0
RER(-1)                     0.181233               0        0.189590        0.150610        0.000100               0               0        0.000456        0.443104        0.228224        1.369380        0.094485        0.021453        0.022822               0       -1.135916       -0.364140        0.228224               0               0       -0.014939       -0.039684       -0.012894        0.170409        0.284243               0               0        0.522693       -0.057882               0               0               0               0               0
u_Z                        -0.039212               0       -0.037418       -0.027524        0.000199               0               0       -0.000090       -0.087034       -0.044825       -0.725462       -0.018558       -0.004214       -0.004482               0       -0.094141       -0.049316       -0.044825               0               0       -0.002026        0.001948       -0.002729       -0.005014       -1.555349               0               0        0.046761       -0.070074               0               0        1.000000               0               0
u_r                                0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0               0        1.000000               0
e_o                         1.163288               0        0.496116       -0.202459       -0.015512        0.020000       -0.020000       -0.000255        1.781720       -0.127482       83.513595       -0.052778       -0.011983       -0.012748       -0.800000        0.704766       -0.167752       -0.127482      122.600000        0.800000        0.017724        0.861018        0.762168       -0.028818        0.743803               0               0        0.145939       -4.525299               0        1.000000               0               0               0
u_fx                       -9.620697               0      -10.272769       -8.287940       -0.000239               0               0       -0.024760      -24.038319      -12.379955      -13.138248       -5.125301       -1.163716       -1.237996               0      -18.337235       -5.957280      -12.379955               0               0        0.693970        2.491577        1.004424        2.672007      -15.401452               0               0        9.305355        1.016453               0               0               0               0        1.000000


MOMENTS OF SIMULATED VARIABLES
VARIABLE              MEAN       STD. DEV.        VARIANCE        SKEWNESS        KURTOSIS
Y                -0.035677        0.276959        0.076706        0.063157        0.036467
Yo               -0.000169        0.003250        0.000011        0.186524        0.633525
Yno              -0.554128        1.980927        3.924070       -0.322347       -1.421897
C                -0.431287        1.339270        1.793643       -0.229831       -1.557826
K                -0.635530        2.162038        4.674407       -0.321237       -1.565054
Ko               -0.000238        0.004643        0.000022        0.184716        0.634972
Kno              -0.633607        2.159966        4.665452       -0.322709       -1.561545
KG               -0.389168        1.648677        2.718136       -0.305193       -1.254298
NX               -0.088531        0.698640        0.488098        0.074202        0.055101
OR               -0.211470        7.186096       51.639971       -0.041932        0.187624
b                 1.452313        7.271187       52.870159       -0.134220       -0.090208
T                -0.050942        3.901505       15.221739       -0.081918        0.205892
GC               -0.473788        1.812293        3.284408       -0.332446       -1.383861
GI               -0.454091        1.873283        3.509189       -0.143177       -0.789857
I                -0.698993        2.247057        5.049265       -0.269172       -1.566148
PX_o             -0.004059        0.177752        0.031596       -0.070939       -0.081837
PX_d             -0.004154        0.058739        0.003450       -0.059141       -0.090673
RER              -0.045476        0.359523        0.129257        0.083161        0.067595
SWF              -0.158886        7.171547       51.431086       -0.034009        0.190057
FDI              -0.000079        0.015602        0.000243        0.061456        0.017609
R                -0.000318        0.032904        0.001083       -0.114408       -0.213194
p_h               0.525149        1.992527        3.970165        0.316870       -1.326996
p_g               0.468086        1.798143        3.233319        0.314328       -1.307133
PX_h             -0.002241        0.027312        0.000746        0.088680       -0.076663
N                -0.423599        1.546688        2.392244       -0.291275       -1.253680
PXstar            0.000000        0.000000        0.000000             NaN             NaN
Rstar             0.000000        0.000000        0.000000             NaN             NaN
fxr_star          0.014880        0.136807        0.018716       -0.049395        0.176300
bstar            -0.638049        2.159538        4.663605       -0.318186       -1.561485
Ystar             0.000000        0.000000        0.000000             NaN             NaN
Pstar_o          -0.000077        0.016300        0.000266        0.067237        0.054382
Z                 0.000900        0.021289        0.000453       -0.141506        0.162595
eps_r             0.001409        0.030317        0.000919        0.284115       -0.006119
eps_fx            0.000281        0.010376        0.000108        0.052256       -0.098261


CORRELATION OF SIMULATED VARIABLES
VARIABLE           Y        Yo       Yno         C         K        Ko       Kno        KG        NX        OR         b         T        GC        GI         I      PX_o      PX_d       RER       SWF       FDI         R       p_h       p_g      PX_h         N    PXstar     Rstar  fxr_star     bstar     Ystar   Pstar_o         Z     eps_r    eps_fx
Y             1.0000    0.0197   -0.0057    0.3072    0.0484    0.0258    0.0460   -0.0548    0.9994    0.1046    0.1942    0.1180   -0.1221   -0.1677    0.1308    0.1928    0.2320    0.9974    0.0654    0.0788   -0.8881    0.1169    0.1365   -0.0881   -0.0274       NaN       NaN   -0.7833    0.0509       NaN    0.0785   -0.0286    0.0380   -0.4833
Yo            0.0197    1.0000    0.1621    0.2142    0.2174    0.9967    0.2152    0.0178    0.0043    0.7420    0.2634    0.7321    0.2286   -0.0604    0.2157    0.0175    0.0768   -0.0021    0.6950    0.2561    0.1616   -0.1586   -0.1583    0.0896    0.1551       NaN       NaN   -0.0401    0.2156       NaN    0.2265    0.0591    0.0187    0.0123
Yno          -0.0057    0.1621    1.0000    0.9160    0.9861    0.1564    0.9866    0.9406   -0.0144    0.0315   -0.7989   -0.0297    0.9885    0.9448    0.9562    0.1133    0.2334   -0.0149    0.0298   -0.0195    0.3960   -0.9938   -0.9914    0.1594    0.9895       NaN       NaN   -0.1501    0.9851       NaN   -0.0152    0.1538    0.2210   -0.0335
C             0.3072    0.2142    0.9160    1.0000    0.9505    0.2140    0.9490    0.8075    0.2981    0.1420   -0.6370    0.0878    0.8757    0.7946    0.9836    0.0758    0.2175    0.2959    0.1268    0.0604    0.1230   -0.8756   -0.8674    0.2359    0.8900       NaN       NaN   -0.2900    0.9524       NaN    0.0580    0.1241    0.2293   -0.0647
K             0.0484    0.2174    0.9861    0.9505    1.0000    0.2168    1.0000    0.9245    0.0379    0.1262   -0.7309    0.0659    0.9768    0.8980    0.9813    0.0533    0.1815    0.0355    0.1240    0.0572    0.3572   -0.9740   -0.9706    0.2272    0.9577       NaN       NaN   -0.1301    0.9990       NaN    0.0548    0.1490    0.2228    0.0256
Ko            0.0258    0.9967    0.1564    0.2140    0.2168    1.0000    0.2146    0.0193    0.0080    0.7770    0.2977    0.7675    0.2259   -0.0765    0.2146    0.0159    0.0715   -0.0012    0.7436    0.3338    0.1605   -0.1521   -0.1517    0.0868    0.1442       NaN       NaN   -0.0365    0.2124       NaN    0.3042    0.0558    0.0159    0.0149
Kno           0.0460    0.2152    0.9866    0.9490    1.0000    0.2146    1.0000    0.9264    0.0355    0.1244   -0.7324    0.0642    0.9774    0.8992    0.9802    0.0535    0.1813    0.0331    0.1224    0.0566    0.3586   -0.9747   -0.9714    0.2261    0.9580       NaN       NaN   -0.1293    0.9989       NaN    0.0542    0.1493    0.2226    0.0256
KG           -0.0548    0.0178    0.9406    0.8075    0.9245    0.0193    0.9264    1.0000   -0.0635    0.0049   -0.7667   -0.0521    0.9343    0.9005    0.8527    0.0517    0.1424   -0.0646    0.0138    0.0228    0.3604   -0.9402   -0.9389    0.1497    0.9012       NaN       NaN   -0.0719    0.9222       NaN    0.0234    0.1328    0.1857    0.0287
NX            0.9994    0.0043   -0.0144    0.2981    0.0379    0.0080    0.0355   -0.0635    1.0000    0.0795    0.1838    0.0934   -0.1332   -0.1687    0.1214    0.1889    0.2279    0.9992    0.0359    0.0457   -0.8952    0.1254    0.1450   -0.0858   -0.0346       NaN       NaN   -0.7804    0.0416       NaN    0.0458   -0.0293    0.0371   -0.4803
OR            0.1046    0.7420    0.0315    0.1420    0.1262    0.7770    0.1244    0.0049    0.0795    1.0000    0.5397    0.9978    0.1142   -0.2683    0.1240    0.0093    0.0449    0.0655    0.9748    0.6351    0.0455   -0.0189   -0.0175    0.0222   -0.0293       NaN       NaN   -0.0517    0.1158       NaN    0.5725    0.0123   -0.0196   -0.0150
b             0.1942    0.2634   -0.7989   -0.6370   -0.7309    0.2977   -0.7324   -0.7667    0.1838    0.5397    1.0000    0.5917   -0.7579   -0.9422   -0.7021   -0.0546   -0.1387    0.1709    0.5541    0.4856   -0.4101    0.8159    0.8171   -0.1439   -0.8262       NaN       NaN   -0.0242   -0.7419       NaN    0.4558   -0.1281   -0.1882   -0.0570
T             0.1180    0.7321   -0.0297    0.0878    0.0659    0.7675    0.0642   -0.0521    0.0934    0.9978    0.5917    1.0000    0.0523   -0.3285    0.0650    0.0006    0.0286    0.0793    0.9726    0.6376    0.0077    0.0434    0.0448    0.0137   -0.0901       NaN       NaN   -0.0576    0.0550       NaN    0.5748    0.0018   -0.0327   -0.0183
GC           -0.1221    0.2286    0.9885    0.8757    0.9768    0.2259    0.9774    0.9343   -0.1332    0.1142   -0.7579    0.0523    1.0000    0.9253    0.9358    0.0863    0.2024   -0.1350    0.1161    0.0356    0.5061   -0.9952   -0.9952    0.1709    0.9750       NaN       NaN   -0.0561    0.9741       NaN    0.0340    0.1558    0.2108    0.0269
GI           -0.1677   -0.0604    0.9448    0.7946    0.8980   -0.0765    0.8992    0.9005   -0.1687   -0.2683   -0.9422   -0.3285    0.9253    1.0000    0.8615    0.0863    0.1862   -0.1650   -0.2575   -0.2095    0.4850   -0.9572   -0.9579    0.1534    0.9550       NaN       NaN   -0.0179    0.9005       NaN   -0.1872    0.1477    0.2113    0.0347
I             0.1308    0.2157    0.9562    0.9836    0.9813    0.2146    0.9802    0.8527    0.1214    0.1240   -0.7021    0.0650    0.9358    0.8615    1.0000    0.0438    0.1834    0.1192    0.1173    0.0508    0.2963   -0.9352   -0.9302    0.2610    0.9336       NaN       NaN   -0.1549    0.9826       NaN    0.0491    0.1346    0.2318    0.0227
PX_o          0.1928    0.0175    0.1133    0.0758    0.0533    0.0159    0.0535    0.0517    0.1889    0.0093   -0.0546    0.0006    0.0863    0.0863    0.0438    1.0000    0.9860    0.1894   -0.0029   -0.0137   -0.0441   -0.0907   -0.0867   -0.9423    0.1673       NaN       NaN   -0.5847    0.0467       NaN   -0.0134   -0.0086    0.0194   -0.8895
PX_d          0.2320    0.0768    0.2334    0.2175    0.1815    0.0715    0.1813    0.1424    0.2279    0.0449   -0.1387    0.0286    0.2024    0.1862    0.1834    0.9860    1.0000    0.2301    0.0169   -0.0405   -0.0224   -0.2058   -0.2006   -0.8808    0.2857       NaN       NaN   -0.6112    0.1775       NaN   -0.0474    0.0060    0.0533   -0.8781
RER           0.9974   -0.0021   -0.0149    0.2959    0.0355   -0.0012    0.0331   -0.0646    0.9992    0.0655    0.1709    0.0793   -0.1350   -0.1650    0.1192    0.1894    0.2301    1.0000    0.0143    0.0101   -0.8974    0.1256    0.1452   -0.0863   -0.0336       NaN       NaN   -0.7825    0.0405       NaN    0.0088   -0.0287    0.0377   -0.4824
SWF           0.0654    0.6950    0.0298    0.1268    0.1240    0.7436    0.1224    0.0138    0.0359    0.9748    0.5541    0.9726    0.1161   -0.2575    0.1173   -0.0029    0.0169    0.0143    1.0000    0.7835    0.0884   -0.0210   -0.0206    0.0251   -0.0334       NaN       NaN   -0.0025    0.1065       NaN    0.7355    0.0080   -0.0230    0.0184
FDI           0.0788    0.2561   -0.0195    0.0604    0.0572    0.3338    0.0566    0.0228    0.0457    0.6351    0.4856    0.6376    0.0356   -0.2095    0.0508   -0.0137   -0.0405    0.0101    0.7835    1.0000    0.0351    0.0307    0.0308   -0.0074   -0.0837       NaN       NaN    0.0318    0.0253       NaN    0.9922   -0.0211   -0.0275    0.0341
R            -0.8881    0.1616    0.3960    0.1230    0.3572    0.1605    0.3586    0.3604   -0.8952    0.0455   -0.4101    0.0077    0.5061    0.4850    0.2963   -0.0441   -0.0224   -0.8974    0.0884    0.0351    1.0000   -0.4919   -0.5085    0.0858    0.4168       NaN       NaN    0.6237    0.3520       NaN    0.0329    0.0773    0.0612    0.3659
p_h           0.1169   -0.1586   -0.9938   -0.8756   -0.9740   -0.1521   -0.9747   -0.9402    0.1254   -0.0189    0.8159    0.0434   -0.9952   -0.9572   -0.9352   -0.0907   -0.2058    0.1256   -0.0210    0.0307   -0.4919    1.0000    0.9998   -0.1685   -0.9858       NaN       NaN    0.0618   -0.9728       NaN    0.0266   -0.1560   -0.2153   -0.0208
p_g           0.1365   -0.1583   -0.9914   -0.8674   -0.9706   -0.1517   -0.9714   -0.9389    0.1450   -0.0175    0.8171    0.0448   -0.9952   -0.9579   -0.9302   -0.0867   -0.2006    0.1452   -0.0206    0.0308   -0.5085    0.9998    1.0000   -0.1698   -0.9838       NaN       NaN    0.0460   -0.9694       NaN    0.0267   -0.1562   -0.2140   -0.0304
PX_h         -0.0881    0.0896    0.1594    0.2359    0.2272    0.0868    0.2261    0.1497   -0.0858    0.0222   -0.1439    0.0137    0.1709    0.1534    0.2610   -0.9423   -0.8808   -0.0863    0.0251   -0.0074    0.0858   -0.1685   -0.1698    1.0000    0.1103       NaN       NaN    0.4807    0.2365       NaN   -0.0017    0.0379    0.0552    0.8428
N            -0.0274    0.1551    0.9895    0.8900    0.9577    0.1442    0.9580    0.9012   -0.0346   -0.0293   -0.8262   -0.0901    0.9750    0.9550    0.9336    0.1673    0.2857   -0.0336   -0.0334   -0.0837    0.4168   -0.9858   -0.9838    0.1103    1.0000       NaN       NaN   -0.1803    0.9572       NaN   -0.0738    0.1366    0.2225   -0.0901
PXstar           NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
Rstar            NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
fxr_star     -0.7833   -0.0401   -0.1501   -0.2900   -0.1301   -0.0365   -0.1293   -0.0719   -0.7804   -0.0517   -0.0242   -0.0576   -0.0561   -0.0179   -0.1549   -0.5847   -0.6112   -0.7825   -0.0025    0.0318    0.6237    0.0618    0.0460    0.4807   -0.1803       NaN       NaN    1.0000   -0.1220       NaN    0.0342    0.0094   -0.0590    0.8516
bstar         0.0509    0.2156    0.9851    0.9524    0.9990    0.2124    0.9989    0.9222    0.0416    0.1158   -0.7419    0.0550    0.9741    0.9005    0.9826    0.0467    0.1775    0.0405    0.1065    0.0253    0.3520   -0.9728   -0.9694    0.2365    0.9572       NaN       NaN   -0.1220    1.0000       NaN    0.0223    0.1504    0.2232    0.0334
Ystar            NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
Pstar_o       0.0785    0.2265   -0.0152    0.0580    0.0548    0.3042    0.0542    0.0234    0.0458    0.5725    0.4558    0.5748    0.0340   -0.1872    0.0491   -0.0134   -0.0474    0.0088    0.7355    0.9922    0.0329    0.0266    0.0267   -0.0017   -0.0738       NaN       NaN    0.0342    0.0223       NaN    1.0000   -0.0214   -0.0263    0.0379
Z            -0.0286    0.0591    0.1538    0.1241    0.1490    0.0558    0.1493    0.1328   -0.0293    0.0123   -0.1281    0.0018    0.1558    0.1477    0.1346   -0.0086    0.0060   -0.0287    0.0080   -0.0211    0.0773   -0.1560   -0.1562    0.0379    0.1366       NaN       NaN    0.0094    0.1504       NaN   -0.0214    1.0000   -0.0099    0.0260
eps_r         0.0380    0.0187    0.2210    0.2293    0.2228    0.0159    0.2226    0.1857    0.0371   -0.0196   -0.1882   -0.0327    0.2108    0.2113    0.2318    0.0194    0.0533    0.0377   -0.0230   -0.0275    0.0612   -0.2153   -0.2140    0.0552    0.2225       NaN       NaN   -0.0590    0.2232       NaN   -0.0263   -0.0099    1.0000   -0.0112
eps_fx       -0.4833    0.0123   -0.0335   -0.0647    0.0256    0.0149    0.0256    0.0287   -0.4803   -0.0150   -0.0570   -0.0183    0.0269    0.0347    0.0227   -0.8895   -0.8781   -0.4824    0.0184    0.0341    0.3659   -0.0208   -0.0304    0.8428   -0.0901       NaN       NaN    0.8516    0.0334       NaN    0.0379    0.0260   -0.0112    1.0000


AUTOCORRELATION OF SIMULATED VARIABLES
VARIABLE          1        2        3        4        5
Y            0.9422   0.8864   0.8320   0.7730   0.7172
Yo           0.9962   0.9873   0.9741   0.9576   0.9386
Yno          0.9969   0.9927   0.9881   0.9834   0.9794
C            0.9977   0.9961   0.9946   0.9929   0.9914
K            0.9995   0.9994   0.9993   0.9992   0.9991
Ko           0.9962   0.9873   0.9741   0.9576   0.9385
Kno          0.9995   0.9994   0.9993   0.9992   0.9991
KG           0.9994   0.9993   0.9990   0.9987   0.9983
NX           0.9436   0.8890   0.8354   0.7770   0.7210
OR           0.9755   0.9230   0.8555   0.7811   0.7042
b            0.9875   0.9603   0.9249   0.8860   0.8463
T            0.9750   0.9212   0.8523   0.7766   0.6990
GC           0.9986   0.9961   0.9925   0.9883   0.9838
GI           0.9942   0.9818   0.9656   0.9477   0.9298
I            0.9994   0.9993   0.9990   0.9987   0.9982
PX_o        -0.0083  -0.0092   0.0426  -0.0221  -0.0225
PX_d         0.0314   0.0243   0.0704   0.0112   0.0036
RER          0.9435   0.8885   0.8347   0.7763   0.7199
SWF          0.9755   0.9230   0.8553   0.7804   0.7032
FDI          0.8533   0.6839   0.5449   0.4360   0.3413
R            0.9729   0.9227   0.8646   0.8033   0.7428
p_h          0.9981   0.9947   0.9899   0.9844   0.9788
p_g          0.9982   0.9948   0.9898   0.9841   0.9781
PX_h         0.0713   0.0764   0.1290   0.0741   0.0682
N            0.9901   0.9748   0.9578   0.9411   0.9266
PXstar          NaN      NaN      NaN      NaN      NaN
Rstar           NaN      NaN      NaN      NaN      NaN
fxr_star     0.7579   0.5858   0.4645   0.3505   0.2655
bstar        0.9992   0.9988   0.9984   0.9980   0.9976
Ystar           NaN      NaN      NaN      NaN      NaN
Pstar_o      0.7885   0.6180   0.4906   0.3954   0.3094
Z            0.8794   0.7837   0.7011   0.6290   0.5665
eps_r        0.9444   0.8950   0.8524   0.8105   0.7687
eps_fx       0.3868   0.1715   0.1176   0.0456   0.0159
  1. No, the timing problem is a separate issue.
  2. The NaN for the external sector are for correlations and variance decompositions. Those values are not defined because the variance of those variables is zero.

I checked the model and the steady state equations and deleted some variables. replaced them with their equation definitions as they are indication in the paper , but I got this error


Warning: Some of the parameters have no value (T_SS, TS_SS, Y_SS, Yo_SS, Yno_SS, Kno_SS, Ko_SS, b_SS, bstar_SS, C_SS,
CS_SS, CN_SS, N_SS, NX_SS, R_SS, Rstar_SS, GI_SS, GC_SS, KG_SS, RER_SS, OR_SS, I_SS, fxr_SS, RFF_SS, FDI_SS, W_SS, Q_SS)

[moncode.mod|attachment](upload://iyZDiVRpooTwN5J2pLZDaBoiSGv.mod) (23.9 KB)
[moncode_steadystate.m|attachment](upload://u9cV4Vgqd59gPHceT1xaYa1Y9UY.m) (9.2 KB)
when using stoch_simul. If these parameters are not initialized in a steadystate file or a steady_state_model-block,
Dynare may not be able to solve the model. Note that simul, perfect_foresight_setup, and perfect_foresight_solver do not
automatically call the steady state file. 
Error using print_info (line 32)
The steady state has NaNs or Inf.

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

Error in moncode.driver (line 771)
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);

Error in dynare (line 278)
    evalin('base',[fname '.driver']);

when I executed the diagnosis and this message appeared.

model_diagnostics(M_,options_, oo_);
Warning: Some of the parameters have no value (T_SS, TS_SS, Y_SS, Yo_SS, Yno_SS, Kno_SS, Ko_SS, b_SS, bstar_SS, C_SS,
CS_SS, CN_SS, N_SS, NX_SS, R_SS, Rstar_SS, GI_SS, GC_SS, KG_SS, RER_SS, OR_SS, I_SS, fxr_SS, RFF_SS, FDI_SS, W_SS, Q_SS)
when using model_diagnostics. If these parameters are not initialized in a steadystate file or a
steady_state_model-block, Dynare may not be able to solve the model. Note that simul, perfect_foresight_setup, and
perfect_foresight_solver do not automatically call the steady state file. 

MODEL_DIAGNOSTICS: The Jacobian of the static model contains Inf or NaN. The problem arises from: 


Derivative of Equation 13 with respect to Variable T  (initial value of T: 0) 
Derivative of Equation 2 with respect to Variable PX_d  (initial value of PX_d: 0) 
Derivative of Equation 2 with respect to Variable R  (initial value of R: 0) 

MODEL_DIAGNOSTICS:   The problem most often occurs, because a variable with
MODEL_DIAGNOSTICS:   exponent smaller than 1 has been initialized to 0. Taking the derivative
MODEL_DIAGNOSTICS:   and evaluating it at the steady state then results in a division by 0.
MODEL_DIAGNOSTICS:   If you are using model-local variables (# operator), check their values as well.

MODEL_DIAGNOSTICS: The Jacobian of the dynamic model contains Inf or NaN. The problem arises from: 


Derivative of Equation 1 with respect to  Variable T  (initial value of T: 0) 
Derivative of Equation 13 with respect to  Variable T  (initial value of T: 0) 
Derivative of Equation 2 with respect to  Variable R  (initial value of R: 0) 
Derivative of Equation 1 with respect to lead of Variable T  (initial value of T: 0) 
Derivative of Equation 2 with respect to lead of Variable PX_d  (initial value of PX_d: 0) 

I don’t know what I should do

Make sure all parameters are correctly set. Apart from that, it’s impossible to tell more without the files.

moncode.mod (23.9 KB)
moncode_steadystate.m (9.2 KB)
This is the files, i don’t know why they are not upload although I did

You need to make sure that the content of the steady state file is sequentially executable. For example, OR_SS is not set when

    b_SS=(((Yo_SS^(zeta_GI))*(OR_SS^(gammaa_IOF)))/(delta_g*KG_SS))^(1/gammaa_GI);

is executed.