在学生 t 分布累积分布函数的上下文中,R 版本 4.3.1 的?dt
文档强调了以下结果:
然而,在尝试验证该公式的准确性时,出现了不一致的情况,如以下代码片段所示:
v <- 5
t <- -1
## Student's t-distribution cumulative distribution function
pt(q = t, df = v, lower.tail = TRUE, ncp = 0)
#> [1] 0.1816087
## Application of the theorical result where there is a discrepancy
## based on what is mentioned in R Version 4.3.1's ?dt documentation
1 - pbeta(q = v / (v + t^2), shape1 = v/2, shape2 = 1/2,
ncp = 0,lower.tail = TRUE)
#> …
Run Code Online (Sandbox Code Playgroud)