涉及正态变量的累积分布函数的限制
Limits involving the cumulative distribution function of a normal variable
我正在做一些关于不正确积分的练习,我偶然发现了一个我无法解决的问题。我正在尝试对以下问题使用 limit() 函数:
这里N(x)是标准正态变量的累积分布函数
到目前为止,limit() 函数没有引起任何问题,包括需要应用 L'Hôpital 规则的问题。但是,我正在努力计算这个特定问题的正确答案,但无法找出原因。以下代码产生错误答案
from sympy import *
x, y = symbols('x y')
init_printing(use_unicode=False) #Print the answers in unicode characters
cum_distribution = (1/sqrt(2*pi)*(integrate(exp(-y**2/2), (y, -oo, x))))
func = (cum_distribution -(1/2)-(x/sqrt(2*pi)))/(x**3)
limit(func, x, 0)
如果我应用 L'Hôpital 的规则,我会得到正确的
l_hopital = diff((cum_distribution -(1/2)-(x/sqrt(2*pi))), x)/diff(x**3, x)
limit(l_hopital, x, 0)
我查看了 limit() 函数源代码,我的理解是不适用 L'Hôpital 规则?在这种情况下,是否可以不应用此规则而使用 limit() 函数来解决此问题?
目前,涉及函数erf
的极限(称为error function, related to normal CDF) can only be evaluated when the argument of erf
tends to positive infinity. Limits at other places are either not evaluated, or evaluated incorrectly. (Related PR)。这包括限制
limit(-(sqrt(2)*x - sqrt(pi)*erf(sqrt(2)*x/2))/(2*sqrt(pi)*x**3), x, 0)
其中 returns 未计算(尽管我不会称其为 不正确 )。作为一种解决方法,您可以使用一项(常数项)计算此函数的泰勒级数,它给出了正确的极限值:
series(func, x, 0, 1).removeO()
returns -sqrt(2)/(12*sqrt(pi))
.
与微积分实践一样,在算法计算方面,L'Hopital 法则不如幂级数技术,而 SymPy 主要依赖后者。它使用的算法由 Dominik Gruntz 在 On Computing Limits in a Symbolic Manipulation System 中设计和解释。
我正在做一些关于不正确积分的练习,我偶然发现了一个我无法解决的问题。我正在尝试对以下问题使用 limit() 函数:
这里N(x)是标准正态变量的累积分布函数
到目前为止,limit() 函数没有引起任何问题,包括需要应用 L'Hôpital 规则的问题。但是,我正在努力计算这个特定问题的正确答案,但无法找出原因。以下代码产生错误答案
from sympy import *
x, y = symbols('x y')
init_printing(use_unicode=False) #Print the answers in unicode characters
cum_distribution = (1/sqrt(2*pi)*(integrate(exp(-y**2/2), (y, -oo, x))))
func = (cum_distribution -(1/2)-(x/sqrt(2*pi)))/(x**3)
limit(func, x, 0)
如果我应用 L'Hôpital 的规则,我会得到正确的
l_hopital = diff((cum_distribution -(1/2)-(x/sqrt(2*pi))), x)/diff(x**3, x)
limit(l_hopital, x, 0)
我查看了 limit() 函数源代码,我的理解是不适用 L'Hôpital 规则?在这种情况下,是否可以不应用此规则而使用 limit() 函数来解决此问题?
目前,涉及函数erf
的极限(称为error function, related to normal CDF) can only be evaluated when the argument of erf
tends to positive infinity. Limits at other places are either not evaluated, or evaluated incorrectly. (Related PR)。这包括限制
limit(-(sqrt(2)*x - sqrt(pi)*erf(sqrt(2)*x/2))/(2*sqrt(pi)*x**3), x, 0)
其中 returns 未计算(尽管我不会称其为 不正确 )。作为一种解决方法,您可以使用一项(常数项)计算此函数的泰勒级数,它给出了正确的极限值:
series(func, x, 0, 1).removeO()
returns -sqrt(2)/(12*sqrt(pi))
.
与微积分实践一样,在算法计算方面,L'Hopital 法则不如幂级数技术,而 SymPy 主要依赖后者。它使用的算法由 Dominik Gruntz 在 On Computing Limits in a Symbolic Manipulation System 中设计和解释。