Matrix Language Reference

The following entries constitute a listing of the functions and commands used in the EViews matrix language. For a description of the EViews matrix language, see
“Matrix Language”.

Matrix Command and Function Summary

Matrix Utility Commands

colplace Places column vector into matrix.

matplace Places matrix object in another matrix object.

mtos Converts a matrix object to series or group.

nrnd Fill the matrix with normal random numbers .

rmvnorm Fill the matrix with multivariate normal random numbers.

rnd Fill the matrix with uniform random numbers.

rowplace Places a rowvector in matrix object.

stom Converts series or group to vector or matrix after removing observations with NAs.

stomna Converts series or group to vector or matrix without removing observations with NAs.

ttom Fills a matrix with the numeric contents of a table.

Matrix General Functions

@capplyranks Reorder the columns of the matrix using a vector of ranks.

@cholesky Cholesky factorization of a matrix.

@colsort Sorted values of each column of a matrix.

@commute Commutation matrix.

@convert Converts series or group to a vector or matrix after removing NAs.

@columnextract Extract column from matrix.

@columns Number of columns in matrix object, series, or group.

@cond Condition number of a square matrix or sym.

@det Calculate the determinant of a square matrix or sym.

@duplic Duplication matrix.

@duplicinv Inverse of the duplication matrix.

@eigenvalues Eigenvalues of a sym.

@eigenvectors Eigenvectors of a matrix.

@elimin Elimination matrix.

@explode Create a square matrix from a sym matrix.

@fill Create and fill a vector from a list of values.

@filledmatrix Matrix filled with a scalar value.

@filledrowvector Rowvector filled with a scalar value.

@filledsym Sym filled with a scalar value.

@filledvector Vector filled with a scalar value.

@getmaindiagonal Extract main diagonal from matrix.

@makediagonal Matrix with vector placed on diagonal.

@grid Vector of an equally spaced grid of elements.

@hcat Horizontally concatenate matrix objects.

@identity Identity matrix.

@implode Sym from lower triangle of square matrix.

@inner Inner product of matrix objects or series.

@inverse Inverse of a square matrix object or sym.

@issingular Test square matrix or sym for singularity.

@kronecker Computes the Kronecker product of two matrix objects.

@mnrnd Matrix of normal random numbers .

@mrnd Matrix of uniform random numbers .

@norm Norm of a matrix object or series.

@ones Matrix of ones.

@outer Outer product of matrix objects or series.

@permute Permutes the rows of the matrix.

@pinverse Moore-Penrose pseudo-inverse of a square matrix object or sym.

@qform Quadratic form of a symmetric matrix and a matrix object.

@qr Calculate the QR decomposition of a matrix or sym.

@range Vector of sequential integers

@rank Rank of a matrix object.

@rapplyranks Reorder the rows of the matrix using a vector of ranks.

@resample Resample matrix .

@rmvnorm Matrix of multivariate normal random draws .

@rowextract Extract rowvector from matrix object.

@rows Number of rows in matrix object.

@rsweep Reverse sweep operation on the matrix.

@scale Scale the rows or columns of a matrix.

@seq Vector of an arithmetic sequence of elements.

@seqm Vector of a multiplicative sequence of elements.

@sfill Create and fill an svector from a list of string values.

@solvesystem Solve system of linear equations.

@subextract Extract submatrix from matrix object.

@svd Economy singular value decomposition.

@svdfull Full-sized singular value decomposition.

@sweep Sweep operation on the matrix.

@trace Computes the trace of a square matrix or sym.

@transpose Transpose of matrix object.

@unitvector Extract column from an identity matrix.

@unvec Unstack vector into a matrix.

@unvech Unstack vector into the lower triangle of sym.

@vcat Vertically concatenate two matrix objects.

@vec Vectorize (stack columns of) matrix object.

@vech Vectorize (stack columns of) lower triangle of matrix object.

@zeros Matrix or vector of zeros.

Matrix Element Functions

@ediv Element division of two matrices.

@eeq Element equality comparison of two matrices.

@eeqna Element equality comparison of two matrices.

@ege Element greater than or equal to tests of two matrices .

@egt Element greater than tests of two matrices .

@einv Element inversion of a matrix.

@ele Element less than or equal to tests of two matrices .

@elt Element less than tests of two matrices .

@emax Element maximums of two matrices .

@emin Element maximums of two matrices .

@emult Element maximums of two matrices.

@eneq Element inequality comparison of two matrices.

@eneqna Element inequality comparison of two matrices.

@epow Elements raised to a power in a matrix.

@erecode Element recode of a matrix.

Additional Matrix Functions

In addition, EViews also supports matrix versions of the following categories of functions:

Category | Matrix Element Support |

addition, subtraction, multiplication, and comparison operators (note that the comparison operators perform the comparison for every element of the matrix object and return a 1 if true for all elements, and a 0 if the comparison fails for any element). | |

All, except for “@inv” and “@recode”. | |

All | |

All | |

All |

Matrix Statistics Functions

You may use any of the descriptive statistics functions that are described in
“Descriptive Statistics”.

These statistics will be applied to the matrix object as a whole (the vectorized matrix) so that, for example, using @mean computes the mean taken over all non NA values in the matrix.

In addition, the following functions have special forms that apply to matrix objects:

@cor Correlation between two vectors, or between the columns of a matrix.

@cov Covariance between two vectors, or between the columns of a matrix (no d.f. correction).

@covp Computes covariance between two vectors, or between the columns of a matrix (no d.f. correction).

@covs Computes covariance between two vectors, or between the columns of a matrix (d.f. corrected).

@intercept Intercept from trend regression.

@maxes Vector of maximal values.

@mins Vector of minimal values.

@ranks Ranks of the elements of a matrix or vector.

@regress Matrix of results from an OLS regression on the first column of a matrix versus the remaining columns
(here).

@trendcoef Trend coefficient from trend regression.

@uniquevals Vector or svector of unique values in the object

Matrix Column Statistics Functions

There are a number of column functions that return summary statistics computed for each column of the matrix:

@cfirst First non-missing value in each column of a matrix.

@cifirst Index of the first non-missing value in each column of a matrix.

@cilast Index of the last non-missing value in each column of a matrix.

@cimax Index of the maximal value in each column of a matrix.

@cimin Index of the minimal value in each column of a matrix.

@cintercept Intercept from a trend regression performed on each column of a matrix.

@clast Last non-missing value in each column of the matrix.

@cmax Maximal value in each column of a matrix.

@cmean Mean in each column of a matrix.

@cmedian Median of each column of a matrix.

@cmin Minimal value for each column of the matrix.

@cnas Number of NA values in each column of a matrix.

@cobs Number of non-NA values in each column of a matrix.

@cprod Product of elements in each column of a matrix.

@cquantile Quantile of each column of a matrix.

@cstdev Standard deviation (sample) of each column of a matrix.

@cstdevp Standard deviation (population) of each column of a matrix.

@cstdevs Standard deviation (sample) of each column of a matrix.

@csum Sum of the values in each column of a matrix.

@csumsq Sum of the squared values in each column of a matrix.

@ctrendcoef Slope from a trend regression on each column of a matrix.

@ctrmean Trimmed mean of each column of a matrix .

@cvar Variance(population) of each column of a matrix .

@cvarp Variance (population) of each column of a matrix .

@cvars Variance (sample) of each column of a matrix.

Matrix Transformation Functions

@colcumprod Matrix of cumulative products of the elements of the columns of the matrix.

@colcumsum Matrix of cumulative sums of the elements of the columns of the matrix.

@coldemean Matrix translated to have mean zero for each column.

@coldetrend Matrix of residuals of an OLS regression of each column of the matrix versus an implicit time trend.

@colpctiles Matrix where each column contains percentiles of the values of the corresponding column matrix .

@colranks Matrix where each column contains the ranks of the values of the corresponding column.

@colsort Sorted values of each column of a matrix.

@colstdize Matrix translated to have mean zero and variance 1 for each column .

@colstdizep Matrix translated to have mean zero and population variance 1 for each column .

@lag n-th order lag function for rows of the matrix .

@rowranks Matrix where each row contains the ranking of the values of the corresponding row.

@rowsort Sorted values of each row of a matrix.

@sort Sorts elements of a matrix or vector.