Weighted sampling without replacement

前端 未结 5 1932
没有蜡笔的小新
没有蜡笔的小新 2021-01-16 14:23

I have a population p of indices and corresponding weights in vector w. I want to get k samples from this population without repla

5条回答
  •  攒了一身酷
    2021-01-16 15:22

    I think you should keep using the for, but I suggest to reduce the corresponding weight by one.

    w(p == J(i)) = w(p == J(i)) -1;
    

提交回复
热议问题