Deterministic simulation and impulse response

I want to ask a seemingly silly question.Deterministic simulation If you use an unexpected shock the simulation path that you get is equivalent to the impulse response that you get in a nonlinear environment, right?

I am not sure I understand the question. What has nonlinearity to do with it? Did you mean

?

What I mean by this is that if unexpected shocks are used in deterministic simulations, then the resulting simulation path for each variable is in fact the impulse response diagram of that shock.

Yes, the responses of an unanticipated shock in perfect foresight simulations can be interpreted as an impulse response.

Thank you, professor.I want to ask you one more question, how do you implement the regime-switching model?I want to know how do you write it in a mod if you want to set up the talyor rule in the first few periods , and then switch to another rule.

Do you mean true regime-switching where agents know the probabilities of switching to a different regime? Or an unforeseen break in policy? Or an anticipated change in policy that is known to be once and for all?

Thank you professor, I have not read enough literature, I did not expect there are so many kinds.
I would like to ask the models that the agent to know the probability and the models that the agent fully anticipates regime-switching.

A perfectly anticipated change is a straightforward perfect foresight exercise. You can implement this via an exogenous variable being an indicator for the regime.

Agents knowing the probability is of a switch usually boils down to Markov-Switching DSGE models. Do a Google search and you will find a large literature. Junior Maih’s RISE toolbox is well-suited for this model class.