I set up a DSGE model which includes seven shocks and then use seven data series to do the bayesian estiamtion. However, the result displays that the simulated moments are much larger than the moments of empirical data. Then I decrease the data series, which means I use five observed data series to do the bayesian estiamtion on this model with seven shocks. This time the simulated moments are close to the moments of empirical data.

Why did this happen? And what should I do to deal with this case as I prefer using more data series when doing the estimation?

Unfortunately, this is not unheard of. See the discussion at Endogenous prior for example.
The problem is in-sample you may have correlations between shocks that are 0 if you were to simulate your model.

Thank you for your reply! But I still feel confused. Is there any way to solve this problem? I tried adding â€śendogenous priorâ€ť in the code, but nothing good happened. How could I make the simulated moments close to the moments of empirical data?

good evening dear professor
I finished my git and I could run the calibrated model I would like to add bayesian estimations but the problem that appears is the following I canâ€™t understand where the problems come from can you help me please?
The message that appears is the following:

sal.mod (8.4 KB)
I apologize for the inconvenience

One more question is that:
If the simulated moments are much larger than the moments of empirical data, does it mean the result of bayesian estimation is not acceptable? If it is not acceptable, is it proper to â€ślive with itâ€ť?

The fundamental issue is the following: your estimated model will fully explain the data but typically imply correlated shocks. Now when you run simulations, they will be based on truly uncorrelated shocks. As such, when comparing moments from correlated to moments from uncorrelated shocks, there will obviously be differences. But what does that tell us? Is it the model that is wrong because it says that shocks were correlated in the particular sample. Or was the sample a bit special because shocks were indeed correlated (which can easily happen by chance)? If you believe the latter, then you are going to accept different second moments between the actual data and the simulated model.