楼主: 1155ys
2063 4

[问答] rnorm的函数中加入sample应该如何理解 [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

小学生

28%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
56 点
帖子
4
精华
0
在线时间
4 小时
注册时间
2015-2-4
最后登录
2016-8-16

楼主
1155ys 发表于 2016-8-10 10:28:31 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
mixn <- function (n, a=-1, b=1)
{rnorm(n, sample(c(a,b),n,replace=T))}

请问在rnorm中,又加入了sample函数,应该怎么理解呢?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Sample 如何理解 AMPL Norm MPL 如何

沙发
waterhorse 发表于 2016-8-10 11:24:46
The random number is generated n times, each element in n has a mean of +1 or -1.

藤椅
1155ys 发表于 2016-8-10 11:49:59
waterhorse 发表于 2016-8-10 11:24
The random number is generated n times, each element in n has a mean of +1 or -1.
thx a lot!

板凳
1155ys 发表于 2016-8-10 15:45:04
waterhorse 发表于 2016-8-10 11:24
The random number is generated n times, each element in n has a mean of +1 or -1.
btw, what about the variance of the random number?

报纸
waterhorse 发表于 2016-8-11 00:04:42
By default the variance (standard deviation) is set to 1; rnorm(n, mean, sd).

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-17 14:46