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 件のコメント
Sean de Wolski
2013 年 1 月 29 日
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:
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Parallel for-Loops (parfor) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!