【发布时间】:2014-10-08 03:53:14
【问题描述】:
我发布这个问题是因为,我的代码没有在正确的位置停止迭代。谁能帮我确定是什么问题?
一切正常(我一直认为这是现实中的错误..)
问题:
1) 在每次迭代中,我都在最小化不幸的是,它没有正确地最小化(结果很差)。我是否在最小化过程中正确停止迭代?有什么建议吗?
只需运行以下代码:
import numpy as np
from scipy.stats import stats
def run_iter():
# Initial guess
x_new = x0
# just to pretend we have huge error
phi0 = 1e20
for i in range(iter_num):
# first solution
x_next = x_new
# FIRST WAY
# First assumption to stop the iteration...
# SECOND WAY
'''
# Second assumption to stop the iteration
'''
return x_new
def example_run():
if __name__ == '__main__':
print example_run()
【问题讨论】:
标签: least-squares