Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Java中是否有类似randsampleMatlab中的函数可以返回加权样本(随机均匀采样并替换,并且w[i]每个数字都有一个权重。选择数字i的概率是w(i)/sum(w) .)?
randsample
w[i]
我想用这样的东西
randsample([0 1],1,true,[0.2 0.8]);
您可以查看Apache Commons Math库。具体来说,您似乎对Binomial Distribution感兴趣。
希望有帮助!