問題タブ [scipy-optimize]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
415 参照

python - SciPy Optimization for one and two variables

I'm writing this program where I have to do a bunch of optimizations. Some with only 1 variable, some with 2. At first I was using the basinhopping algorithm from the scipy.optimize library, but I figured that the normal minimize algorithm should do the job. The basinhopping optimization was working, more or less, but it was extremely time-consuming. Now, I'm using the normal minimize optimization and I've already figured out how to do it for 1 variable. The code for this is given below. I'm using the COBYLA method here, since this one seems to be the only one working. (Nelder-Mead and Powell also work, but sometimes they give back a negative x, which I can't have. And since both of these methods are unconstrained, I can't use them). Hence my first question: what is the difference between all the methods and why do some of the methods converge for my function and others don't?

The code that I use for the optimization for 2 variables is quite identical to the one for 1 variable, but somehow it gives me the wrong results. Does this have to do with the method I'm using? Or what could be the problem here?

For the sake of completeness, below is my code for the calculate_score function. I was maybe thinking to calculate the gradient of this function, so that given this gradient the BFGS or L-BFGS-B methods would work, but I'm not quite sure how to do this.

In short, what I would like to know is:

  • Was it a good idea to switch from basinhopping to minimize? (I just thought basinhopping was extremely slow)
  • Is the method COBYLA I'm using the best one for this specific case?
  • Why is my result for 1 variable correct, while my result for 2 variables isn't?
0 投票する
0 に答える
63 参照

python - 熱プロファイルのフィッティング データを適切に最適化するにはどうすればよいですか?

熱プロファイルの高温および低温レジームに関するデータを当てはめようとしましたが、適切に当てはめることはできませんでした。実験レポートによると、各レベルに 3 ~ 4 個の測定ポイントがあるはずですが、常にいくつかのポイントが熱プロファイル曲線の外側にあり、すべてを台無しにする可能性があるため、これまで管理できませんでした。に関するこの投稿を確認しoptimize.curve_fit()ましたが、最適化するのに役立つかどうかはわかりません。最後の図に示されているように、各高または低レジームの測定ポイントは、隣り合った各滞留時間に適合する必要があります。

画像

熱プロファイルの滞留時間に正しく適合する測定ポイントを修正するための提案はありますか?