Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Command Ref.pdf
Скачиваний:
47
Добавлен:
23.03.2015
Размер:
5.23 Mб
Скачать

rndseed—425

Cross-references

See “Recursive Least Squares” on page 586 of the User’s Guide.

rndint

Command

 

 

Generate uniform random integers.

The rndint command fills series, vector, and matrix objects with (pseudo) random integers drawn uniformly from zero to a user specified maximum. The rndint command ignores the current sample and fills the entire object with random integers.

Syntax

Command: rndint(object_name, n)

Type the name of the series, vector, or matrix object to fill, followed by an integer value representing the maximum value n of the random integers. n should a positive integer.

Examples

series index

rndint(index,10)

fills the entire series INDEX with integers drawn randomly from 0 to 10. Note that unlike standard series assignment using genr, rndint ignores the current sample and fills the series for the entire workfile range.

sym(3) var3

rndint(var3,5)

fills the entire symmetric matrix VAR3 with random integers ranging from 0 to 5.

Cross-references

See the list of available random number generators in Appendix D, “Operator and Function Reference”, beginning on page 573.

See also nrnd (p. 569), rnd (p. 571) and rndseed (p. 425).

rndseed Command

Seed the random number generator.

Use rndseed when you wish to generate a repeatable sequence of random numbers, or to select the generator to be used.

426—Appendix B. Command Reference

Note that EViews 5 has updated the seeding routines of two of our pseudo-random number generators (backward compatible options are provided). It is strongly recommended that you use new generators.

Syntax

Command: rndseed(options) integer

Follow the rndseed keyword with the optional generator type and an integer for the seed.

Options

type=arg

Type of random number generator: improved Knuth

(default=“kn”)

generator (“kn”), improved Mersenne Twister (“mt”),

 

Knuth’s (1997) lagged Fibonacci generator used in

 

EViews 4 (“kn4)”, L’Ecuyer’s (1999) combined multiple

 

recursive generator (“le”), Matsumoto and Nishimura’s

 

(1998) Mersenne Twister used in EViews 4 (“mt4”).

 

 

When EViews starts up, the default generator type is set to the improved Knuth lagged Fibonacci generator. Unless changed using rndseed, Knuth’s generator will be used for subsequent pseudo-random number generation.

 

Knuth

L’Ecuyer

Mersenne Twister

 

(“kn4”)

(“le”)

(“mt4”)

 

 

 

 

Period

2129

2319

219937

Time (for 107 draws)

27.3 secs

15.7 secs

1.76 secs

 

 

 

 

Cases failed Diehard test

0

0

0

 

 

 

 

Examples

rndseed 123456

genr t3=@qtdist(rnd,3)

rndseed 123456

genr t30=@qtdist(rnd,30)

generates random draws from a t-distribution with 3 and 30 degrees of freedom using the same seed.

Cross-references

See the list of available random number generators in Appendix D, “Operator and Function Reference”, beginning on page 573.

rowvector—427

At press time, further information on the improved seeds may be found on the web at the following addresses:

Knuth generator: http://sunburn.stanford.edu/~knuth/news02.html#rng

Mersenne twister: http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html

See also nrnd (p. 569), rnd (p. 571) and rndint (p. 425).

rowvector

Object Declaration

 

 

Declare a rowvector object.

The rowvector command declares and optionally initializes a (row) vector object.

Syntax

Command: rowvector(n1) vector_name

Command: rowvector vector_name=assignment

You may optionally specify the size (number of columns) of the row vector in parentheses after the rowvector keyword. If you do not specify the size, EViews creates a rowvector of size 1, unless the declaration is combined with an assignment.

By default, all elements of the vector are set to 0, unless an assignment statement is provided. EViews will automatically resize new rowvectors, if appropriate.

Examples

rowvector rvec1

rowvector(20) coefvec = 2

rowvector newcoef = coefvec

RVEC1 is a row vector of size one with value 0. COEFVEC is a row vector of size 20 with all elements equal to 2. NEWCOEF is also a row vector of size 20 with all elements equal to the same values as COEFVEC.

Cross-references

See “Rowvector” on page 174 for a complete description of the rowvector object.

See also coef (p. 243) and vector (p. 529).

428—Appendix B. Command Reference

run

Command

 

 

Run a program.

The run command executes a program. The program may be located in memory or stored in a program file on disk.

Syntax

Command: run(options) [path\]prog_name [%0 %1 …]

If the program has arguments, you should list them after the filename. EViews first checks to see if the specified program is in memory. If not, it looks for the program on disk in the current working directory, or in the specified path. EViews expects that program files will have a “.PRG” extension.

Options

integer

Set maximum errors allowed before halting the pro-

(default=1)

gram.

 

 

cRun program file without opening a window for display of the program file.

verbose / quiet

Verbose mode in which messages will be sent to the

 

status line at the bottom of the EViews window (slower

 

execution), or quiet mode which suppresses workfile

 

display updates (faster execution).

 

 

v / q

Same as [verbose / quiet].

 

 

ver4 / ver5

Execute program in [version 4 / version 5] compatibility

 

mode.

 

 

Examples

run(q) simul x xhat

quietly runs a program named SIMUL from the default directory using arguments X and XHAT.

Since run is a command, it may also be placed in a program file. You should note that if you put the run command in a program file and then execute the program, EViews will stop after executing the program referred to by the run command. For example, if you have a program containing:

run simul

Соседние файлы в папке Docs