分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
单参的情况
给定观察集D=(Fi,ei)
def log_likelihood(theta, F, e): return -.5*np.sum(np.log(2*np.pi*(theta[1]**2+e**2))+(F-theta[0])**2/(theta[1]**2+e**2))
- 1
- 2
此时,我们可以使用scipy下的最优化函数,一般是最小化目标函数(objective function),所以:
from scipy import optimizedef neg_log_likelihood(theta, F, e): return -log_likelihood(theta, F, e)theta_gauss = [900, 5]theta_est = optimize.fmin(func=neg_log_likelihood, x0=theta_gauss, args=(F, e))
- 1
- 2
- 3
- 4
- 5
- 6
- 7
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow