Optimal policy and welfare volatility

Dear Dynare team, I want to know how to choose the policy response parameters to maximize the represent household’s welfare. And if benchmark policy regime uses calibrated policy parameters, we need to measure the welfare gains under alternative (optimal) policy regime such that the percentage change in permanent consumption that would leave the representative household indifferent between optimal policy and benchmark economy. Is there any examples with dynare codes or some compute approaches ? Thanks a lot.

And I found there is a RBC_baseline_welfare.mod code, it uses the femincon function. In forum, some uses csminwel function. I didn’t know the how to compute and some code details. Please help me, I will appreciate your kindness return_welfare.m (1.1 KB)
compute optimal policy coefficient.m (1.3 KB)
RBC_baseline_welfare.mod (6.3 KB)

My best,

BaselIIIAndIIIAWelfareAnalysis_preview.pdf (181.4 KB)
And also I want to know how to use dynare achieves the saying: " We used the software Dynare to obtain a solution for the equilibrium implied by a given policy by solving a second-order approximation to the constraints, then evaluating welfare under the policy using this approximate solution, as in Schmitt- Grohe and Uribe (2004)" in the paper. Is there some guide for me?

I can point you to https://github.com/JohannesPfeifer/DSGE_mod/tree/master/Born_Pfeifer_2018/Welfare