在 R 编程中计算柯西分位数函数的值 – qcauchy()函数
R语言中的qcauchy()
函数用于计算柯西分位数函数的值。它还创建了柯西分位数函数的密度图。
Syntax: qcauchy(vec, scale)
Parameters:
vec: x-values for cauchy function
scale: Scale for plotting
示例 1:
# R Program to compute value of
# cauchy quantile function
# Creating vector for x-values
x <- seq(0, 1, by = 0.2)
# Apply qcauchy() Function
y <- qcauchy(x, scale = 4)
y
输出:
[1] -Inf -5.505528 -1.299679 1.299679 5.505528 Inf
示例 2:
# R Program to compute value of
# cauchy quantile function
# Creating vector for x-values
x <- seq(0, 1, by = 0.02)
# Apply qcauchy() Function
y <- qcauchy(x, scale = 1)
# Plotting the graph
plot(y)
输出: