# Why are the optimal values initial values when I run maximize welfare code

**URL:** https://forum.dynare.org/t/why-are-the-optimal-values-initial-values-when-i-run-maximize-welfare-code/14432
**Category:** Optimal Policy
**Created:** [6 September 2019 23:40 UTC](https://forum.dynare.org/t/why-are-the-optimal-values-initial-values-when-i-run-maximize-welfare-code/14432 "2019-09-06T23:40:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![abcsk](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@abcsk](https://forum.dynare.org/u/abcsk)
#### Post date: [6 September 2019 23:40 UTC](https://forum.dynare.org/t/why-are-the-optimal-values-initial-values-when-i-run-maximize-welfare-code/14432/1 "2019-09-06T23:40:13Z")

</div>

Dear professor,  
Below attach are my code for computing optimal monetary policy rules based on welfare maximizing. When I compute the conditional welfare, the optimal reaction coefficients ‘xhat’ are not equal to initial values. But when I compute the unconditional welfare, that is, run ‘oo\_.mean(strmatch(‘value’,M\_.endo\_names,‘exact’))’, the optimal values equal to initial values.  
Could you help me, please? Thanks!!!  
[conditional\_welfare\_objective.m](https://forum.dynare.org/uploads/short-url/3s3IT9KO1YR6fMU9iILPP0xkya6.m) (1.1 KB) [policy.mod](https://forum.dynare.org/uploads/short-url/5vVTFxc5SKY1gmgOzAJ4NQeOHpG.mod) (11.5 KB) [SteadyState.mat](https://forum.dynare.org/uploads/short-url/319DpcWsIXRXvzz4JgmhD9YLCxu.mat) (389 Bytes)
