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

Appendix G. Matrix Reference

The following entries are an alphabetical listing of the functions and commands used in the EViews matrix language. For a description of the EViews matrix language, see Chapter 3, “Matrix Language”, on page 23. For a quick summary of these entries, see “Matrix Function and Command Summary” on page 44.

@cholesky

Matrix Algebra Function

 

 

Syntax:

@cholesky(s)

Argument:

sym, s

Return:

matrix

Returns a matrix containing the Cholesky factorization of s . The Cholesky factorization finds the lower triangular matrix L such that LLis equal to the symmetric source matrix. Example:

matrix fact = @cholesky(s1)

matrix orig = fact*@transpose(fact)

colplace

Matrix Utility Command

 

 

Syntax:

colplace(m, v, n)

Argument 1:

matrix, m

Argument 2:

vector, v

Argument 3:

integer, n

Places the column vector v into the matrix m at column n. The number of rows of m and v must match, and the destination column must already exist within m. Example:

colplace(m1,v1,3)

The third column of M1 will be set equal to the vector V1.

See also rowplace (p. 626).

612—Appendix G. Matrix Reference

@columnextract

Matrix Utility Function

 

 

Syntax:

@columnextract(m, n)

Argument 1:

matrix or sym, m

Argument 2:

integer, n

Return:

vector

Extract a vector from column n of the matrix object m, where m is a matrix or sym. Example:

vector v1 = @columnextract(m1,3)

Note that while you may extract the first column of a column vector, or any column of a row vector, the command is more easily executed using simple element or vector assignment in these cases.

See also @rowextract (p. 625).

@columns

Matrix Utility Function

 

 

Syntax:

@columns(o)

Argument:

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

Return:

integer

Returns the number of columns in the matrix object o. Example:

scalar sc2 = @columns(m1) vec1(2) = @columns(s1)

See also @rows (p. 626).

@cond

Matrix Algebra Function

 

 

Syntax:

@cond(o, n)

Argument 1:

matrix or sym, o

Argument 2:

(optional) scalar n

Return:

scalar

Returns the condition number of a square matrix or sym, o. If no norm is specified, the infinity norm is used to determine the condition number. The condition number is the

@convert—613

product of the norm of the matrix divided by the norm of the inverse. Possible norms are “- 1” for the infinity norm, “0” for the Frobenius norm, and an integer “n” for the Ln norm. Example:

scalar sc1 = @cond(m1)

mat1(1,4) = @cond(s1,2)

@convert

Matrix Utility Function

 

 

Syntax:

@convert(o, smp)

Argument 1:

series or group, o

Argument 2:

(optional) sample, smp

Return:

vector or matrix

If o is a series, @convert returns a vector from the values of o using the optional sample smp or the current workfile sample. If any observation has the value “NA”, the observation will be omitted from the vector. Examples:

vector v2 = @convert(ser1) vector v3 = @convert(ser2,smp1)

If o is a group, @convert returns a matrix from the values of o using the optional sample object smp or the current workfile sample. The series in o are placed in the columns of the resulting matrix in the order they appear in the group spreadsheet. If any of the series for a given observation has the value “NA”, the observation will be omitted for all series. For example:

matrix m1=@convert(grp1)

matrix m2=@convert(grp1, smp1)

For a conversion method that preserves NAs, see stomna (p. 627).

614—Appendix G. Matrix Reference

@cor

Matrix Descriptive Statistic

 

 

Syntax: @cor(v1, v2)

Argument 1: vector, rowvector, or series, v1

Argument 2: vector, rowvector, or series, v2

Return: scalar

Syntax: @cor(o)

Argument:

matrix object or group, o

Return: sym

If used with two vector or series objects, v1 and v2, @cor returns the correlation between the two vectors or series. Examples:

scalar sc1 = @cor(v1,v2)

s1(1,2) = @cor(v1,r1)

If used with a matrix object or group, o, @cor calculates the correlation matrix between the columns of the matrix object.

scalar sc2 = @cor(v1,v2)

mat3(4,2) = 100*@cor(r1,v1)

For series and group calculations, EViews will use the current workfile sample. See also @cov (p. 614).

@cov

Matrix Descriptive Statistic

 

 

Syntax: @cov(v1, v2)

Argument 1: vector, rowvector, or series, v1

Argument 2: vector, rowvector, or series, v2

Return: scalar

Syntax: @cov(o)

Argument:

matrix object or group, o

Return: sym

If used with two vector or series objects, v1 and v2, @cov returns the covariance between the two vectors or series. Examples:

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