Estimate my own state space model

I used Dynare to construct a rational expectation DSGE model and retrieved the first-order approximation of the model’s equilibrium conditions and the state-space representation of the solution through dynamic_g1.m and oo_.dr. Based on this benchmark model, I incorporated a bounded rational expectations formation mechanism. After doing this, the model’s actual law of motion (ALM) can still be written as a linear state-space model, but its specific form differs from that of the original rational expectations model, and some endogenous variables that were originally observables have now become state variables.

Since I know that writing my own estimation algorithm might lead to many errors, I would like to know whether it is possible to input my modified model into one of the intermediate steps based on Dynare’s Bayesian estimation, and then use Dynare’s built-in algorithms to estimate my model.

Thank you in advance.

Do you now have a new representation of the model as a function of the parameters? Or would you need to solve the RE model first for each set of parameters, do the transformation, and then obtain the new state space representation?

Thanks for your reply! Now I need to solve the RE model first by Dynare for each set of parameters. But if the representation of the model as a function of the parameters must be computed by myself, I believe I can manage to do that.