# Comparing Data-Driven and DSGE Model Slopes: Guidance Needed

Hello everyone,

I am an undergraduate student currently exploring DSGE models in my free time. I am particularly interested in understanding how DSGE models can be used to regularize data-driven predictions.

As a personal project, I am trying to compare the slopes obtained from data-driven models with those predicted by DSGE models. Specifically, I am focusing on slopes relative to forecasted inflation. These slopes represent how changes in current variables (like output and interest rates) impact the expected future inflation. In data-driven models, such as neural networks used for forecasting, these slopes are essentially the gradients that indicate the sensitivity of the forecasted variable (inflation) to changes in the input variables.

Here are my main questions:

1. Calculating Slopes in Dynare: How can I calculate the slopes of variables with respect to forecasted inflation using Dynare? I am aware that solving a DSGE model in Dynare provides policy functions, but I am not entirely sure how to extract these specific slopes. Any step-by-step guidance or examples would be greatly appreciated.
2. Soundness of Approach: Is comparing data-driven slopes to those predicted by DSGE models a sound approach in the context of DSGEs? I aim to understand if this method is theoretically valid and if it can provide meaningful insights.
3. Resources and References: Can you recommend any resources or references that might help me better understand this process? I am looking for both theoretical background and practical guides, especially those that are accessible to someone relatively new to this field.

I am considering using a hybrid loss function that combines a standard data-driven metric (e.g., MSE) with a DSGE-based metric (e.g., the difference between the slopes found in the neural network and the slopes predicted by the DSGE model, or other relationships I could derive from the DSGEs).

Are there other pieces of information I could incorporate as part of my loss function? Could I somehow differentiate these DSGEs to find the relationship between the slopes of these variables? (if that makes any sense)

I am no expert in this area, but it sounds a bit like you want to use a structural DSGE model to determine non-structural relationships. I donâ€™t really understand what the point of this would be. The strength of the DSGE model is to provide structural/causal relations.

Of course, you could to indirect inference by simulating data from the DSGE and then estimate the slope using the neural network.