# Optimal policy welfare function

Hi,

I would like to solve for the optimal policy under discretion and commitment that maximizes the lifetime utility of the representative household.

\begin{align} \max_{c_{T,t},e_t} \quad &-\sum_{t=0}^\infty \beta^t \mathbb{E}_0\left[ \phi B_t^2 + \sigma{c}_{T,t}^2 + \chi\sigma{y}_{N,t}^2 + \frac{\psi}{\alpha_T}({y}_{T,t}-{a}_{T,t})^2 + \chi\frac{\psi}{\alpha_N}({y}_{N,t}-{a}_{N,t})^2 \right] \nonumber\\ s.t. \quad &c_{T,t} = y_{N,t} -\frac{1}{\sigma}e_t\\ &e_t = \frac{1-\alpha_T}{\alpha_T}y_{T,t} - \frac{1}{\alpha_T}a_{T,t}\\ &c_{T,t} = y_{T,t}+\frac{1}{\kappa}(RB_{t-1}-B_t) \end{align}

The planner chooses two variables, c_{T,t} and e_t to maximize the welfare function. I solve this in Dynare and find that the unconditional welfare loss is the same under discretion and commitment. The code used to derive the welfare loss is attached.

com_cc.mod (946 Bytes)
dis_cc.mod (940 Bytes)

To my understanding, under the discretionary case, we assume that future variables are linear functions of future state variables and assume that the coefficients are exogenous to the policymaker. This would imply that although there are no forward-looking variables in the constraint since the welfare function is forward-looking there should be some effects of the instruments on the future variables that the policymaker does not internalize. Therefore the welfare cost should be different between the commitment case and the discretionary case.

Is this understanding correct?

If so, is the reason that the unconditional welfare cost is the same because perhaps Dynare only computes the welfare for the current period? If so, how should I change the code so that Dynare solves for the lifetime welfare?