在 R 编程中对 t 分布执行概率密度分析 – dt()函数
R 语言中的dt()
函数用于返回具有随机变量x和自由度df的学生 t 分布的概率密度分析。
Syntax: dt(x, df)
Parameters:
x: Random Variable
df: Degree of Freedom
示例 1:
# R Program to perform
# Probability Density Analysis
# Calling dt() Function
dt(0, 10)
dt(1, 15)
dt(3, 40)
输出:
[1] 0.3891084
[1] 0.2341248
[1] 0.006185947
示例 2:
# R Program to perform
# Probability Density Analysis
# Creating a vector
x <- seq(1, 10, by = 1)
# Calling dt() Function
y <- dt(x, 2)
# Plotting probability distribution graph
plot(x, y, type ="l")
输出: