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

@outer—623

series col1

series col2

group g1 col1 col2

sample s1 1951 1990

mtos(m1,g1,s1)

The first two lines declare series objects, the third line declares a group object, the fourth line declares a sample object, and the fifth line converts the columns of the matrix M1 to series in group G1 using sample S1. This command will generate an error if M1 is not a 40 × 2 matrix.

Cross-references

See Chapter 3, “Matrix Language”, on page 23 for further discussions and examples of matrices.

See also stom (p. 627) and stomna (p. 627).

@norm

Matrix Algebra Function

 

 

Syntax: @norm(o, n)

Argument 1: matrix, vector, rowvector, sym, scalar, or series, o

Argument 2: (optional) integer, n

Return: scalar

Returns the value of the norm of any matrix object, o. Possible choices for the norm type n include “–1” for the infinity norm, “0” for the Frobenius norm, and an integer “n” for the Ln norm. If no norm type is provided, this function returns the infinity norm.

Examples:

scalar sc1 = @norm(m1)

scalar sc2 = @norm(v1,1)

@outer

Matrix Algebra Function

 

 

Syntax: @outer(v1, v2)

Argument 1: vector, rowvector, or series, v1

Argument 2: vector, rowvector, or series, v2

Return: matrix

624—Appendix G. Matrix Reference

Calculates the cross product of v1 and v2. Vectors may be either row or column vectors. The outer product is the product of v1 (treated as a column vector) and v2 (treated as a row vector), and is a square matrix of every possible product of the elements of the two inputs. Example:

matrix m1=@outer(v1,v2) matrix m4=@outer(r1,r2)

See also @inner (p. 619).

@permute

Matrix Utility Function

 

 

Syntax:

@permute(m1)

Input:

matrix m1

Return:

matrix

This function returns a matrix whose rows are randomly drawn without replacement from rows of the input matrix m1. The output matrix has the same size as the input matrix.

matrix xp = @permute(x)

To draw with replacement from rows of a matrix, use @resample (p. 625).

@rank

Matrix Algebra Function

 

 

Syntax: @rank(o, n)

Argument 1: vector, rowvector, matrix, sym, or series, o

Argument 2: (optional) integer, n

Return: integer

Returns the rank of the matrix object o. The rank is calculated by counting the number of singular values of the matrix which are smaller in absolute value than the tolerance, which is given by the argument n. If n is not provided, EViews uses the value given by the largest dimension of the matrix multiplied by the norm of the matrix multiplied by machine epsilon (the smallest representable number).

scalar rank1 = @rank(m1) scalar rank2 = @rank(s1)

See also @svd (p. 629).

@rowextract—625

@resample

Matrix Utility Function

 

 

Syntax: @resample(m1, n2, n3, v4)

Input 1:

matrix m1

Input 2: (optional) integer n2

Input 3: (optional) positive integer n3

Input 4: (optional) vector v4

Output: matrix

This function returns a matrix whose rows are randomly drawn with replacement from rows of the input matrix.

n2 represents the number of “extra” rows to be drawn from the matrix. If the input matrix has r rows and c columns, the output matrix will have r + n2 rows and c columns. By default, n2=0 .

n3 represents the block size for the resample procedure. If you specify n3 > 1 , then blocks of consecutive rows of length n3 will be drawn with replacement from the first r n3 + 1 rows of the input matrix.

You may provide a name for the vector v4 to be used for weighted resampling. The weighting vector must have length r and all elements must be non-missing and non-nega- tive. If you provide a weighting vector, each row of the input matrix will be drawn with probability proportional to the weights in the corresponding row of the weighting vector. (The weights need not sum to 1. EViews will automatically normalize the weights).

matrix xb = @bootstrap(x)

To draw without replacement from rows of a matrix, use @permute (p. 624).

@rowextract

Matrix Utility Function

 

 

Syntax:

@rowextract(m, n)

Argument 1:

matrix or sym, m

Argument 2:

integer, n

Return:

rowvector

Extracts a rowvector from row n of the matrix object m. Example:

626—Appendix G. Matrix Reference

rowvector r1 = @rowextract(m1,3)

See also @columnextract (p. 612).

rowplace

Matrix Utility Command

 

 

Syntax:

rowplace(m, r, n)

Argument 1:

matrix, m

Argument 2:

rowvector, r

Argument 3:

integer

Places the rowvector r into the matrix m at row n. The number of columns in m and r must match, and row n must exist within m. Example:

rowplace(m1,r1,4)

See also colplace (p. 611).

@rows

Matrix Utility Function

 

 

Syntax:

@rows(o)

Argument:

matrix, vector, rowvector, sym, series, or group, o

Return:

scalar

Returns the number of rows in the matrix object, o.

Example:

scalar sc1=@rows(m1)

scalar size=@rows(m1)*@columns(m1)

For series and groups @rows (p. 626) returns the number of observations in the workfile range. See also @columns (p. 612).

@solvesystem

Matrix Algebra Function

 

 

Syntax:

@solvesystem(o, v)

Argument 1:

matrix or sym, o

Argument 2:

vector, v

Return:

vector

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