I am tasked with randomly sampling from the following probability density function, which is a modified Erlang Function:
$$f(k,q,\nu)=\frac{(k q)^{k-1}}{[(k-1) !]^{v}} \quad \text { with } \quad q \equiv p \cdot e^{-p}$$
The ordinary Erlang function is given by
$$f(x ; k, \lambda)=\frac{\lambda^{k} x^{k-1} e^{-\lambda x}}{(k-1) !} \quad \text { for } x, \lambda \geq 0$$
Wikipedia states here that the Erlang function may be randomly sampled according to the following function:
$$E(k, \lambda)=-\frac{1}{\lambda} \ln \prod_{i=1}^{k} U_{i}$$
How is this equation derived, such that I may hopefully apply the same method to this special function? If this is not applicable, for my education, how would one sample such a distribution?