In an upcoming simulation project, I will come in a situation where I will have to draw one random element from a huge vector in a weighted sense. For most elements of the vector, the assigned weight will be zero. I also need to draw only one element, so the replacement or no replacement function is irrelevant.
This random picking step will be the bottleneck for my simulation, so getting the best efficiency and speed will be critical.
Are there any hacks/tips on what is best to do? Are there any important savings possible in the context of my project?
PS: Is randsample reliable on huge vectors?
Aucun commentaire:
Enregistrer un commentaire