Objective: The COVID-19 pandemic severely contracted Iran's economy in 2019-2021. Mass vaccinations in Iran, which began in February 2021, gradually made expectations for the future optimistic and increased investment incentives. Considering the importance of this issue, the main goal of the present study is to understand the effect of shock to the marginal efficiency of investment on Iran's economy. Also, considering that since the great recession of 2007, the macroeconomic effects of government expenditures shocks have received more attention, one of the other goals of this study is to investigate the effects of government expenditures shocks and the crowding out effect in Iran's economy. In other words, since the scientific analysis of the effect of economic shocks on economic conditions is essential, the main goal of this article is to understand the effects of shocks on the marginal efficiency of investment and government expenditures on the dynamics of macroeconomic variables in Iran. Method: Dynamic Stochastic General Equilibrium (DSGE) modeling is a branch of macroeconomics that follows the principles of microeconomics and can optimally evaluate the performance of the economy in a stochastic environment. These models are a new version of general equilibrium that emerged following Lucas' criticism. Compared to the models based on time series, DSGE models can show detailed interactions between market decision makers in the framework of general equilibrium. On the other hand, most time series models are not based on economic theory and unlike DSGE models, they are not based on mathematical optimization. Also, unlike calculable general equilibrium models, DSGE models are in a stochastic environment, and since the duration of the shock and its effect on the economy is not known, it is more appropriate to use DSGE models. Considering that the shocks on the economy are stochastic, dynamic stochastic general equilibrium models can best evaluate the effects of these shocks. In this article, a dynamic stochastic general equilibrium model is presented and estimated using the Bayesian approach and seasonal data in the period of 2001:3-2021:3. The primary core of the current research is designed based on the study of Rohe (2012) and by expanding this model, the effect of shock to the marginal efficiency of investment on the dynamics of the macroeconomic variables of Iran has been investigated. In this regard, the studied DSGE model includes households with an unlimited planning horizon, a representative firm producing a homogeneous final product in a perfectly competitive environment, the government, and the oil sector. In order to estimate model indices, Bayesian method and Random Walk Metropolis-Hastings algorithm were used. The data of the observable variables of the model include seasonally adjusted data of Gross Domestic Production (GDP), private consumption, investment and government expenditure; which have been detrended using the Hodrick-Prescott filter. Results: The results indicate that the productivity shock caused an increase in the marginal efficiency of investment and production, and subsequently the hours of employment and investment increased; This caused the interest rate to increase. Due to the increase in household income, consumption increased. The response of the variables to productivity shocks and marginal efficiency of investment are very similar. The only difference is the response of consumption to the shock of the marginal efficiency of investment. As a result of this shock, consumption decreased due to the decrease in wage rates and household income. Also, the dependence of marginal efficiency of investment shocks and government expenditures led to an increase in government expenditures as a result of the marginal efficiency of investment shock. The shock of increasing government expenditures caused an increase in the real interest rate and a decrease in investment. Also, production and employment increased in response to this shock. Due to the significant decrease in the wage rate, consumption has decreased. Since the increase in government expenditures has led to a decrease in investment, the crowding out effect in Iran's economy is confirmed. Conclusion: Comparing the effects of shock to the marginal efficiency of investment and government spending shock on the dynamics of macroeconomic variables in Iran indicates that both shocks lead to an increase in output; but the government expenditures shock has led to the shrinking of the private sector in Iran. As a policy recommendation, it is suggested that the government should manage the political and economic environment of the country in a way so that the expectations of economic agents are formed as optimistically as possible. Also, considering the confirmation of the crowding out effect in Iran's economy, the government should prioritize the goal of reducing its size and expenses. [ABSTRACT FROM AUTHOR]