全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Gauss专版
4090 4
2009-11-26
我在看程序中有rndseed 1364;这是产生1364个随机数?怎么用呢?请举例?谢谢啊
二维码

扫码加我 拉你入群

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

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

全部回复
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.
二维码

扫码加我 拉你入群

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

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

2009-12-1 19:10:23
此处rndseed的作用是什么呢
二维码

扫码加我 拉你入群

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

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

2009-12-1 20:23:44
rndseed just creates a seed for the following random number generation so don’t worry about it
二维码

扫码加我 拉你入群

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

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

2009-12-1 20:24:39
你可以参考有关模拟的书,就知道这个种子是干什么用的
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群