I am trying to use the Stan function lkj_corr_rng inside of my c++ code. I can execute the c++ code available in the section “Using Higher-Order Functions in the StanHeaders Package” of the documentation in Using the Stan Math C++ Library. But I am failing when I try to adapt that code to use the lkj_corr_rng function. For example, when I execute the code bellow
This constructs a new RNG for each function call from a fixed seed so it produces the same pseudorandom matrix every time. For more random results you need to either pass a different seed every time or store the RNG between calls.