Dear all，

I established a logarithmic linearization model. I want to analyze the welfare loss function，like

lambda_x *var(y_hat)+var(pi_hat). Can someone tell me how to do it? If there is an example, it is best.

# How to analyze welfare loss function

What exactly do you want? If you already derived your linear-quadratic model, then you can simply plug in the numbers. See for example

excuse me, professor, I want to know why the wealfare loss function (like line 316 in your code) shall be divided by 100? Thank you!

Because it is expressed in percent so that 0.01 is one percent. The reason is that we are dealing with a linear model where a standard deviation of 1 for the shocks has been used to mean 1 percent. One needs to undo this to match the numbers in the book. A more thorough way would be to use 0.01 as the shock standard deviation and not divide welfare by 100.

Dear Professor. I have a follow up question on this topic.

How can I use this example to do welfare analysis using a **nonlinear model** (such as **Gali_2015_chapter_3_nonlinear.mod** )? Can use the same definition of natural output and interest rate and add them to the model block? Do I need to change anything in the Loss Function?

Thank you very much for your patience. I really appreciate it.