I am working on a model that I calibrated to have the first moment values of the steady state fitted to the first moments in the data. However, I obtain very high and unrealistic values of the second moments of my variables of interest and the IRFs are also unrealistic.

I am not sure it makes a difference, but I should precise that the block of my interest in the model is based on a one period optimization. All other blocks are based on infinite time optimization. Furthermore, this is a real model without nominal regidities.

Does anyone know what are the reccurent reasons to have high and unrealistic second moments of variables in a model? Does unrealistic second moment values imply necessarily unrealistic IRFs?

This indicates that something is wrong. Are you using theoretical moments or simulated ones? The latter can be explosive when you do not use pruning.
Unrealistic second moment values tend to coincide with unrealistic IRFs, the reason being that the movement of variables derives from a sequence of IRFs to the shocks at every point in time.

I am working on an extension of Gertler & Kiyotaki (2011) in which I introduce the two main facilities of the central bank. The lending facility with which the central bank lend to commercial banks and the deposit facility with which commercial banks can deposit reserves at the central bank. But I need the bank to optimize only on one period and I assume that both incentive constraintes are binding.

I attach below the .mod file and the .mat files of the parameters and the steady state.

The worst case of the second moments that I find is a variance of 1328 for a mean of 0.3593.

An additional question, would the use of Sims’ package (Solving Linear Rational Expectations Models; 2002, Computational Economics) give me different second moments?

You should not look at variances, but at standard deviations, which have a more natural interpretation if your variables are in logs.

You can see in the displayed policy functions that some variables massively react to your shock processes. For that reason, the problem seems to be an economic one. You need to understand why the amplification of shocks is so big in your model. It has nothing to do with the solution technique. Therefore, using Sims’s package would not help (Dynare essentially does the same)

Thank you for taking the time to see the code. I start with a smaller extension and add things gradually to understand what really happens in the model.

But one last question, could big differences between the two lagrangian of the incentive constaints (52.7241 vs. 1.20028) be the economic reason behind these results? The financial variables are present in these two binding incentive constraints.

That may be, but I don’t know your model or the economics behind it, so it’s hard to tell. Gradually adding features is always a good idea to better understand what is going on.