R语言 计算对数正态概率密度 – dlnorm() 函数
R语言中的 dlnorm() 函数是用来计算概率密度函数的对数正态值。它还可以创建对数正态密度图。
语法: dlnorm(vec)
参数:
vec: 正态密度的X值
例子 1 :
# R program to compute
# log normal probability density
# Creating x-values for density
x <- seq(1, 10, by = 1)
# Calling dlnorm() function
y <- dlnorm(x)
y
输出
[1] 0.398942280 0.156874019 0.072728256 0.038153457 0.021850715 0.013354538
[7] 0.008581626 0.005739296 0.003965747 0.002815902
例2 :
# R program to compute
# log normal probability density
# Creating x-values for density
x <- seq(1, 10, by = 0.1)
# Calling dlnorm() function
y <- dlnorm(x)
# Plot a graph
plot(y)
输出: