R语言 计算随机抽取的Logistic密度 – rlogis()函数
R语言中的 rlogis() 函数是用来计算一系列输入中的随机Logistic密度。
语法: rlogis(N)
参数:
N: 样本大小
例子1 :
# R program to generate
# random logistic density points
# Setting seed for
# random number generation
set.seed(1000)
# Set sample size
N <- 20
# Calling rlogis() Function
y <- rlogis(N)
y
输出
[1] -0.71779506 1.14636578 -2.05114837 0.80365206 0.06563317 -2.62196720
[7] 1.03929969 0.33730220 -1.29048105 -1.06622107 -0.61931410 1.12795649
[13] -0.76720400 1.86443303 1.17562774 -2.54319669 -0.02953117 0.55442681
[19] -2.37810163 0.33889069
例2 :
# R program to generate
# random logistic density points
# Setting seed for
# random number generation
set.seed(1000)
# Set sample size
N <- 500
# Calling rlogis() Function
y <- rlogis(N)
# Plot a graph
plot(y)
输出: