📄 m6_glossary.hlp
字号:
{c BLC} {c BRC}
{p 8 8 2}
Note that the definition {it:A}={it:A}{cmd:'} is the same as the
definition for a symmetric matrix, although usually the word symmetric is
reserved for real matrices and Hermitian, for complex matrices. In this
manual, we use the word symmetric for both; see {it:symmetric}.
{* index istmt it}{...}
{p 4 8 2}
{bf:istmt}{break}
An {it:istmt} is an interactive statement, a statement typed at
Mata's colon prompt.
{* index J()}{...}
{p 4 8 2}
{bf:J(r, c, value)}{break}
{cmd:J()} is the function that returns an {it:r} {it:x} {it:c} matrix with
all elements set to {it:value}; see
{bf:{help mf_j:[M-5] J()}}. In addition, {cmd:J()}
is often used in the documentation to describe the various types of
{it:void} matrices; see {it:void} below. Thus the documentation might
say that such-and-such returns {cmd:J(0, 0, .)} under certain conditions.
That is another way of saying the such-and-such returns a 0 {it:x} 0 real
matrix.
{p 8 8 2}
When {it:r} or {it:c} is 0, there are no elements to be filled in with
{it:value}, but even so, {it:value} is used to determine the type
of the matrix. Thus {cmd:J(0, 0, 1i)} refers to a 0 {it:x} 0 complex
matrix, {cmd:J(0, 0, "")} refers to a 0 {it:x} 0 string matrix, and
{cmd:J(0, 0, NULL)} refers to a 0 x 0 {it:pointer} matrix.
{p 8 8 2}
In the documentation, {cmd:J()} is used for more than describing 0 {it:x} 0
matrices. Sometimes, the matrices being described are {it:r} {it:x}
0 or are 0 {it:x} {it:c}. Say a function {cmd:example(}{it:X}{cmd:)}
is supposed to return a column vector; perhaps it returns the last
column of {it:X}. Now say {it:X} is 0 {it:x} 0. Function
{cmd:example()} still should return a column vector, and so it
returns a 0 {it:x} 1 matrix. This would be documented by noting that
{cmd:example()} returns {cmd:J(0, 1, .)} when {it:X} is 0 {it:x} 0.
{* index LAPACK}{...}
{p 4 8 2}
{bf:LAPACK}{break}
LAPACK stands for Linear Algebra PACKage and
forms the basis for many of Mata's linear algebra capabilities;
see {bf:{help m1_lapack:[M-1] LAPACK}}.
{* index lval it}{...}
{p 4 8 2}
{bf:lval}{break}
{it:lval} stands for left-hand-side value and is defined as the property
of being able to appear on the left-hand side of a single-equal-sign
assignment operator. Matrices are {it:lvals} in Mata, and thus
{cmd:X =} ...
{p 8 8 2}
is valid. Functions are not {it:lvals}; thus you cannot
code
{cmd:substr(mystr,1,3) = "abc"}
{p 8 8 2}
{it:lvals} would be easy to describe except that {it:pointers} can also
be lvals. Very few people ever use pointers. See
{bf:{help m2_op_assignment:[M-2] op_assignment}} for a complete definition.
{* index .mata file}{...}
{p 4 8 2}
{bf:.mata file}{break}
By convention, we store the Mata source code for function
{it:function()} in file {it:function}{cmd:.mata}; see
{bf:{help m1_source:[M-1] source}}.
{* index .mlib library files}{...}
{p 4 8 2}
{bf:.mlib library}{break}
The object code of functions can be collected together and stored in a
library. Most Mata functions, in fact, are located in the official
libraries provided with Stata. You can create your own libraries.
See {bf:{help m1_how:[M-1] how}} and {bf:{help mata_mlib:[M-3] mata mlib}}.
{* index .mo file}{...}
{p 4 8 2}
{bf:.mo file}{break}
The object code of a function can be stored in a {cmd:.mo} file, where it
can be later reused. See {bf:{help m1_how:[M-1] how}} and
{bf:{help mata_mosave:[M-3] mata mosave}}.
{* index machine precision}{...}
{p 4 8 2}
{bf:machine precision}{break}
See {it:epsilon(1)}, above.
{* index matrix}{...}
{p 4 8 2}
{bf:matrix}{break}
The most general organization of data, containing {it:r} rows and {it:c}
columns. Vectors, colvectors, rowvectors, and scalars are special cases
of matrices.
{* index norm}{...}
{p 4 8 2}
{bf:norm}{break}
A norm is a real-valued function f({it:x}) satisfying
f(0) = 0
f({it:x}) > 0 for all {it:x} != 0
f({it:c}{it:x}) = |{it:c}|*f({it:x})
f({it:x}+{it:y}) <= f({it:x}) + f({it:y})
{p 8 8 2}
The word norm applied to a vector {it:x} usually refers to its
Euclidean norm, {it:p}=2 norm, or length: the square root of the sum of its
squared elements. The are other norms, the popular ones being {it:p}=1 (the
sum of the absolute values of its elements) and {it:p}=infinity (the maximum
element). Norms can also be generalized to deal with matrices.
See {bf:{help mf_norm:[M-5] norm()}}.
{* index NULL tt}{...}
{p 4 8 2}
{bf:NULL}{break}
A special value for a {it:pointer} that means "points to nothing". If you
list the contents of a pointer variable that contains NULL, the address
will show as 0x0. See {it:pointer} below.
{* index numeric tt}{...}
{p 4 8 2}
{bf:numeric}{break}
A matrix is said to be numeric if its elements are real or complex;
see {it:type}.
{* index object code}{...}
{p 4 8 2}
{bf:object code}{break}
Object code refers to the binary code that Mata produces from the
source code you type as input. See {bf:{help m1_how:[M-1] how}}.
{p 4 8 2}
{bf:observations and variables}{break}
A dataset containing {it:n} observations on {it:k} variables in
often stored in an {it:n x k} matrix. An observation refers to a
row of that matrix; a variable refers to a column.
{* index optimization}{...}
{p 4 8 2}
{bf:optimization}{break}
Mata compiles the code that you write. After compilation, Mata
performs an {it:optimization} step, the purpose of which is to make
the compiled code execute more quickly. You can turn off the optimization
step -- see {bf:{help mata_set:[M-3] mata set}} -- but that is not
recommended.
{p 4 8 2}
{bf:orgtype}{break}
See {it:type}.
{* index orthogonal matrix}{...}
{* index unitary matrix}{...}
{p 4 8 2}
{bf:orthogonal matrix} and {bf:unitary matrix}{break}
{it:A} is orthogonal if {it:A} is {it:square} and
{it:A}{bf:'}{it:A}=={it:I}.
The word orthogonal is usually reserved for real matrices;
if the matrix is complex, it is said to be unitary (and then
transpose means conjugate-transpose). We use the word orthogonal
for both real and complex matrices.
{p 8 8 2}
If {it:A} is orthogonal, then det({it:A}) == +/- 1.
{* index p-conformability}{...}
{p 4 8 2}
{bf:p-conformability}{break}
Matrix, vector, or scalar {it:A} is said to be p-conformable with
matrix, vector, or scalar {it:B} if rows({it:A})==rows({it:B}) and
cols({it:A})==cols({it:B}). p stands for plus; p-conformability is
one of the properties necessary to be able to add matrices together.
p-conformability, however, does not imply that the matrices are of the
same type. Thus (1,2,3) is p-conformable with (4,5,6) and with
("this","that","what") but not with (4\5\6).
{* index permutation vector}{...}
{* index permutation matrix}{...}
{p 4 8 2}
{bf:permutation matrix} and {bf:permutation vector}{break}
A {it:permutation matrix} is an {it:n x n} matrix that is a row (or column)
permutation of the identity matrix. If {it:P} is a permutation matrix,
then {it:P}{cmd:*}{it:A} permutes the rows of {it:A} and
{it:A}{cmd:*}{it:P} permutes the columns of {it:A}. Permutation matrices
also have the property that {it:P}^(-1) = {it:P}{bf:'}.
{p 8 8 2}
A {it:permutation vector} is a 1 {it:x} {it:n} or {it:n} {it:x} 1
vector that contains a permutation of the integers 1, 2, ..., {it:n}.
Permutation vectors can be used with subscripting to reorder the rows or
columns of a matrix. Permutation vectors are a memory-conserving way of
recording permutation matrices; see
{bf:{help m1_permutation:[M-1] permutation}}.
{* index pointers}{...}
{p 4 8 2}
{bf:pointer}{break}
A matrix is said to be a pointer matrix if its elements are pointers.
{p 8 8 2}
A pointer is the address of a {it:variable}. For instance, say variable
{it:X} contains a matrix. Another variable {it:p} might contain
137,799,016 and, if 137,799,016 were the address at which {it:X} were
stored, then {it:p} would be said to point to {it:X}. Addresses are
seldom written in base 10, and so rather than saying {it:p} contains
137,799,016, we would be more likely to say that {it:p} contains
0x836a568, which is the way we write numbers in base 16. Regardless of
how we write addresses, however, {it:p} contains a number and that number
corresponds to the address of another variable.
{p 8 8 2}
In our program, if we refer to {it:p}, we are referring to {it:p}'s
contents, the number 0x836a568. The monadic operator {it:*} is
defined as "refer to the address" or "dereference": {cmd:*}{it:p}
means {it:X}. We could code {cmd:Y = *p} or {cmd:Y = X}, and either way,
we would obtain the same result. In our program, we could refer to
{it:X}{cmd:[}{it:i}{cmd:,}{it:j}{cmd:]} or
{cmd:(*}{it:p}{cmd:)[}{it:i}{cmd:,}{it:j}{cmd:]}, and either way, we would
obtain the {it:i}, {it:j} element of {it:X}.
{p 8 8 2}
The monadic operator {it:&} is how we put addresses into {it:p}.
To load {it:p} with the address of {it:X}, we code {it:p} {cmd:=}
{cmd:&}{it:X}.
{p 8 8 2}
The special address 0 (zero, written in hexadecimal as 0x0),
also known as NULL, is how we record that a pointer variable
points to nothing. A pointer variable contains NULL or it
contains a valid address of another variable.
{p 8 8 2}
See {bf:{help m2_pointers:[M-2] pointers}} for a complete description of
pointers and their use.
{* index pragma tt}{...}
{p 4 8 2}
{bf:pragma}{break}
"(Pragmatic information) A standardised form of comment which has meaning to
a compiler. It may use a special syntax or a specific form within the
normal comment syntax. A pragma usually conveys non-essential information,
often intended to help the compiler to optimise the program." --
{it:The Free On-line Dictionary of Computing},
{browse "http://www.foldoc.org"}, Editor Denis Howe.
In the case of Mata, see {bf:{help m2_pragma:[M-2] pragma}}.
{* index r-conformability}{...}
{p 4 8 2}
{bf:r-conformability}{break}
A set of two or more matrices, vectors, or scalars {it:A}, {it:B},
..., are said to be r-conformable if each is {it:c-conformable} with
a matrix of max(rows({it:A}), rows({it:B}), ...) rows and
max(cols({it:A}), cols({it:B}), ...) columns.
{p 8 8 2}
r-conformability is a more relaxed form of {it:c-conformability} in that,
if two matrices are c-conformable, they are r-conformable, but
not vice versa. For instance, {it:A}: 1 {it:x} 3 and
{it:B}: 3 {it:x} 1 are r-conformable but not c-conformable.
In addition, c-conformability is defined with respect to a pair
of matrices only; r-conformability can be applied to a set of
matrices.
{p 8 8 2}
r-conformability is often required of the arguments for functions that
would otherwise naturally be expected to require scalars.
See {bf:r-conformability} in {bf:{help mf_normal:[M-5] normal()}}
for an example.
{* index rank}{...}
{p 4 8 2}
{bf:rank}{break}
Terms in common use are rank, row rank, and column rank. The row rank of
a matrix {it:A}: {it:m} {it:x} {it:n} is the number of rows of {it:A} that
are linearly independent. The column rank is defined similarly, as the
number of columns that are linearly independent. The terms row rank and
column rank, however, are used merely for emphasis; the ranks are equal
and the result is simply called the rank of A.
{p 8 8 2}
In the case of a square matrix {it:A} (in the case where {it:m}=={it:n}),
the matrix is invertible if and only if rank({it:A})=={it:n}. One often
hears that A is of full rank in this case, and rank deficient in the
other. See {bf:{help mf_rank:[M-5] rank()}}.
{* index real tt}{...}
{p 4 8 2}
{bf:real}{break}
A matrix is said to be a real matrix if its elements are all reals
and it is stored in a {cmd:real} matrix.
Real is one of the two numeric types in Mata, the other being
complex. Also see {it:type}.
{p 4 8 2}
{bf:rowvector}{break}
See {it:vector}.
{* index scalar tt}{...}
{p 4 8 2}
{bf:scalar}{break}
A special case of a {it:matrix} with one row and one column.
A scalar may be substituted anywhere a matrix, vector, colvector, or
rowvector is required, but not vice versa.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -