贤者vs沃尔夫拉姆冲突评估的极限?

时间:2018-08-29 03:06:03

标签: wolfram-mathematica sage wolframalpha

  

以下计算出的限制为何不同(Sage为1,Wolfram为0),哪个(如果有)是正确的?

编辑:根据@Bill的建议进行了修改,以提高Wolfram中的数值精度。 (我不知道如何在Sage中执行相同的操作。)Wolfram图强烈建议,该限制确实为$ 0 $,并且问题完全与数值精度有关。

鼠尾草 :(您可以剪切/粘贴/执行此代码here

#in()=
f(x) = exp(-x^2/2)/sqrt(2*pi)
F(x) = (1 + erf(x/sqrt(2)))/2
num1(a,w) = (a+w)*f(a+w) - a*f(a)
num2(a,w) = f(a+w) - f(a) 
den(a,w) = F(a+w) - F(a)
V(a,w) = 1 - num1(a,w)/den(a,w) - (num2(a,w)/den(a,w))^2
assume(w>0); print(limit(V(a,w), a=oo))
plot(V(a,1),a,0,8)

#out()=
1        #<--------- computed limit = 1      

enter image description here

Wolfram :(您可以执行此代码here

#in()=
f[x_]:=Exp[-x^2/2]/Sqrt[2*Pi]
F[x_]:=(1 + Erf[x/Sqrt[2]])/2 
num1[a_,w_] := (a+w)*f[a+w] - a*f[a]
num2[a_,w_] := f[a+w] - f[a]  
den[a_,w_] := F[a+w] - F[a]
V[a_,w_] := 1 - num1[a,w]/den[a,w] - (num2[a,w]/den[a,w])^2 
Assuming[w>0, Limit[V[a,w], a -> Infinity]]
Plot[V[a, 10], {a, 0, 100}, WorkingPrecision -> 128] 

#out()=
0        (* <--------- computed limit = 0 *)      

enter image description here

(这应该计算variance of a standard normal distribution when truncated to the interval (a,a+w)的限制,以-> oo表示。)

0 个答案:

没有答案
相关问题