Hello Professor,
I am facing the problem of estimation. I used five observables with quarterly data. However the code did not run. I can’t understand the reason. When I use all observations, The following error message pops up:
initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.
initial_estimation_checks:: This is often a sign of stochastic singularity, but can also sometimes happen by chance
initial_estimation_checks:: for a particular combination of parameters and data realizations.
initial_estimation_checks:: If you think the latter is the case, you should try with different initial values for the estimated parameters.

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…

I did perform the estimation by dropping the variables one at a time. Finally I got an out with only one observable y and I get the following warning: Log data density [Laplace approximation] is NaN.

Try one shock and one observable…2 shocks 2 observables and so on…to locate the problem.
stochastic singularity can occur when the model predicts perfect collinearity and the data disagrees.
for example, if y = c + i in the model and you include y, c and i as observables, one can get this error.
also, on another front, looks like your labour supply equation does not have labour (n) in it…

If my model has stochastic singularity then why does not show something in stoch_simul?
Is there a problem with non-stationarity? Maybe it comes from having stochastic trends in technology.
diffuse_filter option solve the problem?

stochastic simulation has nothing to do with the use of data to estimate, right. that is why.
and unless you specific a unit root tech shock, why should it have a unit root, at the given initial values?

A=A(-1)^rhoA*exp(epsA);

you are estimating rhoA and initiating the estimation at rhoA=0.5. So that is stationary.

Actually, if your model predicts that some variables are collinear, this will show up in the data simulated by stoch_simul or in the the theoretical moments… But this will not trigger any warning or error.

If you consider the example mentioned by @punnoosejacob, you will have \mathbb V [y-c-i]=0 since y = c + i in all the states of Nature. Even if y, c and i are random variables, we can find a linear combination of these variables which is deterministic. This kind of singularity happens frequently in the linear(ized) model we consider in the literature, since we usually have less shocks (source of randomness) than endogenous variables.

Stochastic singularity is only a problem when we need to estimate the model.

The model with the removal of (1-rhomb) of Monetary policy reaction function and the deletion of “or” from observations was changed, and the previous error was not observed, but I did not understand the reason because I did not see the collinearity here. But after the new estimate, I encountered the following error:
Initial value of the log posterior (or likelihood): -94686644715.0093
…
Log data density [Laplace approximation] is NaN.

After running the identification command, I encounter the following message:

==== Identification analysis ====

Prior distribution for parameter betta has unbounded density!
Testing prior mean

All parameters are identified in the model (rank of H).

WARNING !!!
The rank of J (moments) is deficient!

SE_epsor is not identified by J moments!
[dJ/d(SE_epsor)=0 for all J moments!]
rhoor is not identified by J moments!
[dJ/d(rhoor)=0 for all J moments!]

Initial value of the log posterior (or likelihood): -94686644715.0093
…
Log data density [Laplace approximation] is NaN.

why? How to fix it?

Also, if I understand correctly, you said in another post (Performing an estimation of parameters using real data) (24th reply) that the mean of the data should be equal to the mean of the corresponding model variable in the steady state, right? But there is a lot of difference for me.

Should I change the initial parameter values?

Can the problem be fixed by adding the measurement error to the observation equation?
(A Guide to Specifying Observation Equations for the Estimation of DSGE Models)

Sentiment2.mod (5.7 KB)
I do not think I am faced with the identification problem in new files. But I did not understand your meaning about error code and data treatment. I have no trouble in stoch_simul, and the model_diagnostics does not show anything, and I only have a problem in estimation. What is your opinion on these two questions?

Also, if I understand correctly, you said in another post (Performing an estimation of parameters using real data) (24th reply) that the mean of the data should be equal to the mean of the corresponding model variable in the steady state, right? But there is a lot of difference for me.

Should I change the initial parameter values?

Can the problem be fixed by adding the measurement error to the observation equation?
(A Guide to Specifying Observation Equations for the Estimation of DSGE Models)

I read your article and other related articles, and in none of them, the money stock (m) has not been seen. My question is, does the stochastic trends affect the money stock? For example, the demand for real money balance is faced Doc1.pdf (62.9 KB)

So if there is only an effect on consumption, is there a random process in this equation?

Hi after reading your article,I detrend my model variables and entered the data in growth but after running of the model, I encountered the following warning:

mode_check:: could not solve model for parameter alppha at value 0.304, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.317, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.330, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.343, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.356, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.369, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.381, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.394, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.407, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.433, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.446, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.459, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.471, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.484, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.497, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.510, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.523, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.536, error code: 19
mode_check:: could not solve model for parameter alppha at value 0.549, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.003, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.003, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.003, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.003, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.004, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.004, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.004, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.004, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.005, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.005, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.005, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.006, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.006, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.006, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.006, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.007, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.007, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.007, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.008, error code: 19
mode_check:: could not solve model for parameter LambdaYd at value 0.008, error code: 19

That is, your steady state file does not accept any other values for alppha and LambdaYd

I deleted these two parameters from the estimation, but I still get the error. I do not know where the problem is. what is your suggestion?
Also, how did you get this error? It’s different for me.