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 commentaire

Sean de Wolski
Sean de Wolski le 29 Jan 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:

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Parallel Computing Toolbox dans Centre d'aide et File Exchange

Question posée :

le 29 Jan 2013

Community Treasure Hunt

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

Start Hunting!

Translated by