Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRcppArmadillo sample with different probabilities #275
Comments
|
@helmingstay Are you around and able to take a look? |
* Fix issue RcppCore#275: const input prob (workers modify copy)
|
Ouch. Thanks for @emanuelegdepaoli for the lovely bug report. The input prob vector is now passed as const and copied inside sample_main. |
|
Thank you @helmingstay |
I've found a problem with RcppArmadillo sample function when the sampling probabilities are not constant.
The code is:
and the output when the function is called in R:
Apparently the function is sampling from a discrete distribution with uniform probabilities.