已知高斯分布公式

求最大的f(x)?

#For this problem, you aren't writing any code.
#Instead, please just change the last argument 
#in f() to maximize the output.

from math import *

def f(mu, sigma2, x):
    return 1/sqrt(2.*pi*sigma2) * exp(-.5*(x-mu)**2 / sigma2)

print f(10.,4.,10.) #Change the 8. to something else!

当 x的值等于mu的值时,f(x)最大。

posted on 2018-04-25 08:36  未完代码  阅读(224)  评论(0编辑  收藏  举报