If your problem is only that you cannot calculate the deriative (and not that it does not exist), then you can use a numerical derivative (such as the Scilab function derivative). To that end, if your function is func, then create a function newf:<br>
<br> function [f,g,ind] =newf(param,ind)<br>f=func(param)<br>g=derivative(func,param)<br>endfunction<br> <br><br><div class="gmail_quote">2009/8/16 Sebastian Urban <span dir="ltr"><<a href="mailto:urban@stoch.uni-karlsruhe.de">urban@stoch.uni-karlsruhe.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello everybody,<br>
<br>
is there a way to optimize a function, whose gradient I don't know /<br>
cannot compute? The command 'optim' seems to require the cost function<br>
to provide the gradient...<br>
<br>
Thanks for help, suggestions and comments!<br>
<font color="#888888">Sebastian<br>
</font></blockquote></div><br>