由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - how to set the seed in R
相关主题
为什么不能把ABLINE加到散点图中了问关于C中调用R函数
R code questionhelp with R
Proc Surveyselect中, 当 reps >=2 时, 样本重复在SAS里面如何进行数组操作?
help rephelp in R
fixed or random model关于R的Simplex的错误信息
问个统计的问题R code 问题
请教SAS高手关于lasso...R 问题:vcov()和cov.unscaled区别在哪里?
突然对直线拟合的R不明白起来了求助,R 画图
相关话题的讨论汇总
话题: seed话题: set话题: mclapply话题: my话题: function
进入Statistics版参与讨论
1 (共1页)
w*******9
发帖数: 1433
1
Hi all, I am using the mclapply function in the multicore package in R. I am
doing a simulation study which requires 10000 replicates. How should I set
the seed so that the other people can reproduce my result? I tried the
following code but it gives me different output every time I run it.
set.seed(123)
mclapply(1:3, rnorm, mc.set.seed=T)
t*****w
发帖数: 254
2
set.seed(123)
x<-rnorm(10000)
mclapply(1:3, x, mc.set.seed=T)

am
set

【在 w*******9 的大作中提到】
: Hi all, I am using the mclapply function in the multicore package in R. I am
: doing a simulation study which requires 10000 replicates. How should I set
: the seed so that the other people can reproduce my result? I tried the
: following code but it gives me different output every time I run it.
: set.seed(123)
: mclapply(1:3, rnorm, mc.set.seed=T)

w*******9
发帖数: 1433
3
Thanks for your reply, but it doesnt work. I guess you mean I need to first
generate the data in the usual way and then pass the data to MY_FUNCTION.
That does not quite fit my need. I want to generate the random data in MY_
Function.

【在 t*****w 的大作中提到】
: set.seed(123)
: x<-rnorm(10000)
: mclapply(1:3, x, mc.set.seed=T)
:
: am
: set

l*********3
发帖数: 22
4
mc.set.seed=F

first

【在 w*******9 的大作中提到】
: Thanks for your reply, but it doesnt work. I guess you mean I need to first
: generate the data in the usual way and then pass the data to MY_FUNCTION.
: That does not quite fit my need. I want to generate the random data in MY_
: Function.

1 (共1页)
进入Statistics版参与讨论
相关主题
求助,R 画图fixed or random model
请大家说说用C/C++做统计模拟吧!问个统计的问题
R: quantcut请教SAS高手关于lasso...
在 R 里面如何循环调用变量名突然对直线拟合的R不明白起来了
为什么不能把ABLINE加到散点图中了问关于C中调用R函数
R code questionhelp with R
Proc Surveyselect中, 当 reps >=2 时, 样本重复在SAS里面如何进行数组操作?
help rephelp in R
相关话题的讨论汇总
话题: seed话题: set话题: mclapply话题: my话题: function