【发布时间】:2020-11-01 22:58:37
【问题描述】:
Logistic分布的概率密度函数$f(x) = e^{-x} (1+e^{-x})^{-2}$跨度>
LL_cdf <- function(x) ((1+exp(-x))^(-1) # cumulative distribution function of logistic distribution
LL_pdf <- function(x) ( (exp(-x))*(1+exp(-x))^-2 ) # Probability density function (pdf) of logistic distribution
任何发行版的 pdf 对其支持的集成都必须是一个。我们在其支持 $x \in [-\infty,\infty]$ 上集成了 logistic distribution 的 pdf,但它给出了错误消息。我们在下面的代码中提到了错误消息。为什么物流分布的 pdf 在 R 的支持 $x \in [-\infty,\infty]$ 上没有集成?
integrate( LL_pdf, lower = -Inf, upper = Inf)$value
Error in integrate(LL_pdf, lower = -Inf, upper = Inf) :
non-finite function value
【问题讨论】:
-
integrate( LL_pdf, lower = -Inf, upper = 0)也失败了。 -
我得到了 0.5,其实没用,因为我们需要集成超过 $X \in (\infty, \infty)$ @StephanKolassa 的支持
-
它并非完全没用,因为 PDF 是围绕 0 对称的。
-
integrate( LL_pdf, lower = -Inf, upper = 0)给你0.5?这很有趣,它暗示了一些奇怪的差异。我在 Windows 10 上运行 R 4.0.2。sessionInfo()告诉你什么? -
你是对的。我正在使用 R 版本 4.0.0 (2020-04-24) @StephanKolassa