samedi 1 mai 2021

How to generate gamma distributed random number in C++? [duplicate]

I am trying to convert some R codes into C++ in order to use in Rcpp package. I am a complete beginner in C++.

I am trying to understand how to generate gamma distributed random number in C++ for a given set of shape and scale parameter.

For example, in R I can use:

rgamma(n = 1, shape = a, scale = b)

What is an equivalent code in C++?




Aucun commentaire:

Enregistrer un commentaire