小编Jac*_*rde的帖子

python 中 rnorm 的模拟

早上好!

我正在寻找在 R 中创建一些代码的模拟

基本上,我有一个函数,除其他外,它采用用户提供的种子(默认为 NULL)以及特定分布(默认为 rnorm),并输出 9 个随机数,保存为向量“e”。这就是它在 R 中的样子...

function (...other variables..., seed=NULL, dist=rnorm)

...other code...

e <- dist(9,...)

Run Code Online (Sandbox Code Playgroud)

现在我正在将函数转换为 Python,但我似乎无法找到一个可以工作的模拟,用户可以在其中替换基本种子和分发。

这是我到目前为止...

def (...other variables..., seed=None, dist=?):

...other code...

e = dist(9)
Run Code Online (Sandbox Code Playgroud)

python r function distribution normal-distribution

4
推荐指数
1
解决办法
3543
查看次数

标签 统计

distribution ×1

function ×1

normal-distribution ×1

python ×1

r ×1