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

stomna—627

Returns the vector x that solves the equation Mx = p where the matrix or sym M is given by the argument o. Example:

vector v2 = @solvesystem(m1,v1)

See also @inverse (p. 620).

stom

Matrix Utility Command

 

 

Syntax:

stom(o1, o2, smp)

Argument 1:

series or group, o1

Argument 2:

vector or matrix, o2

Argument 3:

(optional) sample smp

Series-TO-Matrix Object. If o1 is a series, stom fills the vector o2 with data from the o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. If any observation has the value “NA”, the observation will be omitted from the vector. Example:

stom(ser1,v1)

stom(ser1,v2,smp1)

If o1 is a group, stom fills the matrix o2 with data from o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. The series in o1 are placed in the columns of o2 in the order they appear in the group spreadsheet. If any of the series in the group has the value “NA” for a given observation, the observation will be omitted for all series. Example:

stom(grp1,m1)

stom(grp1,m2,smp1)

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

stomna

Matrix Utility Command

 

 

Syntax: stomna(o1, o2, smp)

Argument 1: series or group, o1

Argument 2: vector or matrix, o2

Argument 3: (optional) sample smp

628—Appendix G. Matrix Reference

Series-TO-Matrix Object with NAs. If o1 is a series, stom fills the vector o2 with data from o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. All “NA” values in the series will be assigned to the corresponding vector elements.

Example:

stom(ser1,v1)

stom(ser1,v2,smp1)

If o1 is a group, stom fills the matrix o2 with data from o1 using the optional sample object smp or the workfile sample. o2 will be resized accordingly. The series in o1 are placed in the columns of o2 in the order they appear in the group spreadsheet. All NAs will be assigned to the corresponding matrix elements. Example:

stomna(grp1,m1)

stomna(grp1,m2,smp1)

For conversion methods that automatically remove observations with NAs, see @convert (p. 613) and stom (p. 627).

@subextract

Matrix Utility Function

 

 

Syntax:

@subextract(o, n1, n2, n3, n4)

Argument 1:

vector, rowvector, matrix or sym, o

Argument 2:

integer, n1

Argument 3:

integer, n2

Argument 4:

(optional) integer, n3

Argument 5:

(optional) integer, n4

Return:

matrix

Returns a submatrix of a specified matrix, o. n1 is the row and n2 is the column of the upper left element to be extracted. The optional arguments n3 and n4 provide the row and column location of the lower right corner of the matrix. Unless n3 and n4 are provided this function returns a matrix containing all of the elements below and to the right of the starting element.

Examples:

matrix m2 = @subextract(m1,5,9,6,11)

matrix m2 = @subextract(m1,5,9)

@trace—629

@svd

Matrix Algebra Function

 

 

Syntax:

@svd(m1, v1, m2)

Argument 1:

matrix or sym, m1

Argument 2:

vector, v1

Argument 3:

matrix or sym, m2

Return:

matrix

Performs a singular value decomposition of the matrix m1. The matrix U is returned by the function, the vector v1 will be filled (resized if necessary) with the singular values and the matrix m2 will be assigned (resized if necessary) the other matrix, V , of the decomposition. The singular value decomposition satisfies:

m1 = UWV

(G.1)

UU = VV = I

where W is a diagonal matrix with the singular values along the diagonal. Singular values close to zero indicate that the matrix may not be of full rank. See the @rank (p. 624) function for a related discussion.

Examples:

matrix m2

vector v1

matrix m3 = @svd(m1,v1,m2)

@trace

Matrix Algebra Function

 

 

Syntax:

@trace(m)

Argument:

matrix or sym, m

Return:

scalar

Returns the trace (the sum of the diagonal elements) of a square matrix or sym, m. Example:

630—Appendix G. Matrix Reference

scalar sc1 = @trace(m1)

@transpose

Matrix Algebra Function

 

 

Syntax:

@transpose(o)

Argument:

matrix, vector, rowvector, or sym, o

Return:

matrix, rowvector, vector, or sym

Forms the transpose of a matrix object, o. o may be a vector, rowvector, matrix, or a sym. The result is a matrix object with a number of rows equal to the number of columns in the original matrix and number of columns equal to the number of rows in the original matrix. This function is an identity function for a sym, since a sym by definition is equal to its transpose. Example:

matrix m2 = @transpose(m1)

rowvector r2 = @transpose(v1)

@unitvector

Matrix Utility Function

 

 

Syntax:

@unitvector(n1, n2)

Argument 1:

integer, n1

Argument 2:

integer, n2

Return:

vector

Creates an n1 element vector with a “1” in the n2-th element, and “0” elsewhere. Example:

vec v1 = @unitvector(8, 5)

creates an 8 element vector with a “1” in the fifth element and “0” for the other 7 elements. Note: if you wish to create an n1 element vector of ones, you should use a declaration statement of the form:

vector(n1) v1=1

@vec

Matrix Utility Function

 

 

Syntax:

@vec(o)

Argument:

matrix, sym, o

Return:

vector

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