使用 hmatrix-gsl-stats 对随机分布进行采样时如何推进 RNG 状态?

How to advance the RNG state when sampling random distributions using hmatrix-gsl-stats?

当我从随机分布中抽样时,如何在 hmatrix-gsl-stats 中推进 RNG: 例如:

λ> CN.random_1p Exponential 235252 1.0
0.8742160459331277
λ> CN.random_1p Exponential 235252 1.0
0.8742160459331277

我在https://hackage.haskell.org/package/hmatrix-gsl-stats-0.2.1/docs/Numeric-GSL-Distribution-Continuous.html

中没有看到维护 RNG 状态的明显界面

那个包中的 API 似乎没有提供任何 return 更新种子的操作(这在纯语言中做随机性时显然是一个很大的禁忌)。您必须将软件包修补到 return 更新的种子或使用不同的软件包。