我只想优化函数的两个参数alpha
和beta
,我正在使用scipy.optimize.minimize
函数和TNC
算法。目标函数为观测值与预测值的均方误差。在优化过程中,alpha和beta可以在0.1和0.99之间变化。我观察到scipy.minimize只探索有限的样本空间。
在优化过程中,错误函数表现如下
这是否意味着算法陷入局部极小
优化参数如下:
anfangwerte = np.array([0.9, 0.6]) # initial values of alpha and beta
grenze = (
(0.1, 0.99), # bounds for alpha
(0.1, 0.99) # bounds for beta
)
res = minimize(model.objective_function, # it returns mean square error
x0=anfangwerte,
method='TNC', # 'TNC',
tol=0.002, #
bounds=grenze,
options={
'eps': 1e-2, # default 1e-8
'scale': None,
'stepmax': 15,
'disp': True,
'maxiter': 100,
'accuracy': 0.00004,
'gtol': 0.00002,
'ftol': 0.00002
}
)
为什么算法只探索有限的样本空间?我应该为此更改哪个参数
通过稍微改变初始值和优化参数,该模型确实探索了更多的样本空间。我使用0.1和0.99作为参数和样本空间的初始值,如下所示
我仍然看到许多样本空间未被探索。我们怎么能假设函数已经找到了全局极小值
目前没有回答
相关问题 更多 >
编程相关推荐