在 R 编程中计算累积柯西密度 – pcauchy()函数
R语言中的pcauchy()
函数用于计算累积柯西密度。它还创建了柯西累积分布的密度图。
Syntax: pcauchy(vec, scale)
Parameters:
vec: x-values for cauchy function
scale: Scale for plotting
示例 1:
# R Program to compute cumulative cauchy density
# Creating vector for x-values
x <- seq(0, 2, by = 0.2)
# Apply pcauchy() Function
y <- pcauchy(x, scale = 5)
y
输出:
[1] 0.5000000 0.5127256 0.5254107 0.5380154 0.5505015 0.5628330 0.5749763
[8] 0.5869014 0.5985815 0.6099938 0.6211189
示例 2:
# R Program to compute cumulative cauchy density
# Creating vector for x-values
x <- seq(0, 2, by = 0.2)
# Apply pcauchy() Function
y <- pcauchy(x, scale = 5)
# Plotting a graph
plot(y)
输出: