Using parfor with fminsearch

Hi everybody. I would like to generate a distribution of parameter vectors using different subsamples. The estimates are produced using my self-defined function criterion. I have B samples, so Bsamples{b} picks out the b-th saple.
parfor b=1:B
Bresults(b,:)=fminsearch(@criterion,x,options,nsimu,Bsamples{b},0,ss);
% find estimator, x=starting parameter vector
end
While this works fine with a "for" loop, when using "parfor" it always returns the starting parameter vector as result. It seems not to recognize the different inputs Bsamples{b}. Is it in general not possible to parfor with optimization routines? Other operations, like mean(Bsample{b}) in the loop work fine.
Many thanks! Philipp

1 comentario

Sean de Wolski
Sean de Wolski el 29 de En. de 2013
Can you provide some values? I see no reason why what you have above would not work with a parfor() loop.
Also, I would recommend using an anonymous function do pass the extra parameters:

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Parallel Computing Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de En. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by