Message Boards Message Boards

Stochastic root finding with Mathematica

Posted 10 years ago
POSTED BY: Szabolcs Horvát
2 Replies

It appears that NMinimize uses BlockRandom with a fixed seed, so any stochastic function passed to NMinimize will always produce exactly the same result. I can work around this, just observing how NMinimize works. Example:

In[20]:= f[x_?NumericQ] := (Sow@RandomReal[]; x^2)

In[21]:= Last@Reap@NMinimize[f[x], x] == Last@Reap@NMinimize[f[x], x]
Out[21]= True
POSTED BY: Szabolcs Horvát

I'd try NMinimize[f[x,...]^2, x,...] to see if that gives anything useful. Probably would go with Method->"DifferentialEvolution" as the first method to try.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract