# Error of cmaes optimizer

**URL:** https://forum.dynare.org/t/error-of-cmaes-optimizer/13084
**Category:** Optimal Policy
**Created:** [12 January 2019 12:55 UTC](https://forum.dynare.org/t/error-of-cmaes-optimizer/13084 "2019-01-12T12:55:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jiang](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@jiang](https://forum.dynare.org/u/jiang)
#### Post date: [12 January 2019 12:55 UTC](https://forum.dynare.org/t/error-of-cmaes-optimizer/13084/1 "2019-01-12T12:55:44Z")

</div>

Dear jpfeifer, I saw you used the optimizer cmaes to solve some optimal question. I use you code such as follwing,  
%set CMAES options  
H0=0.2\*ones(size(x\_start,1),1)  
cmaesOptions = options\_.cmaes;  
cmaesOptions.LBounds = [-1000;-1000];  
cmaesOptions.UBounds = [1000;1000];  
[x\_opt\_hat, fhat, COUNTEVAL, STOPFLAG, OUT, BESTEVER] = cmaes(‘welfare\_objective’,x\_start,H0,cmaesOptions,x\_opt\_name);  
x\_opt\_hat=BESTEVER.x;

but, I get error like this:  
undefined functions or variables ‘startseed’。  
error Fun\_cmaes (line 27)  
startseed(‘default’);  
Would you give me some help? Thanks a lot.

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [13 January 2019 09:05 UTC](https://forum.dynare.org/t/error-of-cmaes-optimizer/13084/2 "2019-01-13T09:05:43Z")

</div>

In my code I am using the `cmaes`-version delivered with Dynare. There, the random seed has been fixed to make results replicable. You seem to be using the original `cmaes.m`, in which case you need to specify more options.
