楼主: wjl20072008
3788 4

rndseed 怎么用啊 [推广有奖]

  • 1关注
  • 0粉丝

大专生

61%

还不是VIP/贵宾

-

威望
0
论坛币
18 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
520 点
帖子
20
精华
0
在线时间
73 小时
注册时间
2009-11-13
最后登录
2021-12-3
毕业学校
华中科技大学

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我在看程序中有rndseed 1364;这是产生1364个随机数?怎么用呢?请举例?谢谢啊
二维码

扫码加我 拉你入群

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

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

关键词:rndseed seed NDS see 随机数 rndseed

沙发
xuelida 在职认证  发表于 2009-11-27 12:09:27 |只看作者 |坛友微信交流群
rndseed 345346;
x = rndn(100,5);
y = rndu(100,1);
output file = ols_output.txt reset;
call ols("",y,x);
output off;
print;
print "Results of this run stored in ols_output.txt file";
print "The file will be found in your working directory";

The first thing to notice is that each line ends with a semi-colon (;), like the C language does, which serves the same function as the dollar sign ($) does in LIMDEP. To run any statistical routine, we need data, and in this example we create a random data set. rndseed just creates a seed for the following random number generation so don’t worry about it. The next two lines create two matrices of (pseudo) random standard Normally distributed numbers. x = rndn(100,5); creates a 100 random observations of five normal variables, while y = rndu(100,1); does so for one random variable. Thus for the command rndn, the first element in the parenthesis tells GAUSS how many rows (observations) to create and the second element tells it how many columns (variables) to make. The next line, output file = ols_output.txt reset;, tells GAUSS where to put the output (in this case the present working directory) command). The main part of this program is call ols("",y,x); tells GAUSS to get its routine for estimating ordinary least squares, the call ols part, while the stuff in the parentheses tells GAUSS what dataset to use (the “” says that it should use the stuff that was just created), what is the response variable (y), and what are the predictor variables (x). output off; tells GAUSS not to send the output of the regression to a another auxiliary file (using on instead of off and putting a file = directory path after output will create such a file). The print commands are self-explanatory.

使用道具

藤椅
wjl20072008 发表于 2009-12-1 19:10:23 |只看作者 |坛友微信交流群
此处rndseed的作用是什么呢

使用道具

板凳
xuelida 在职认证  发表于 2009-12-1 20:23:44 |只看作者 |坛友微信交流群
rndseed just creates a seed for the following random number generation so don’t worry about it

使用道具

报纸
xuelida 在职认证  发表于 2009-12-1 20:24:39 |只看作者 |坛友微信交流群
你可以参考有关模拟的书,就知道这个种子是干什么用的

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-22 16:57