【发布时间】:2021-07-28 17:51:44
【问题描述】:
我被赋予了一个函数(beta 分布的混合):
f(x) = beta(1,6)/3 + beta(3,6)/3 + beta(10,6)/3
我的任务是绘制 f(x) 的密度。
这是我的代码:
par(mfrow=c(1,1))
x <- seq(0,1,0.001)
plot(x,dbeta(x, shape1 = 1, shape2 = 6)/3 + dbeta(x, shape1 = 3, shape2 = 6)/3 + dbeta(x, shape1 = 10, shape2 = 6)/3,col="blue",lwd=2)
只是想知道这是否是正确的方法吗?我怎样才能使用密度函数来做到这一点?谢谢!
【问题讨论】:
标签: r density-plot beta-distribution mixture