## Acessores
# $ahat
Output:     series

Must follow the estimation of a fixed-effect panel data model. Returns the
estimates of individual fixed effects (per-unit intercepts).

# $aic
Output:     scalar

Returns the Akaike Information Criterion for the last estimated model.

# $bic
Output:     scalar

Returns Schwarz's Bayesian Information Criterion for the last estimated
model.

# $coeff
Output:     scalar or matrix
Argument:   s (name of coefficient, optional)

The $coeff accessor can be used in two ways: with no arguments, it returns a
column vector containing the estimated coefficients for the last model. With
the optional argument, it returns a scalar, which is the estimated parameter
named s. See also "$stderr", "$vcv".

Example:

	  open bjg
	  arima 0 1 1 ; 0 1 1 ; lg 
	  b = $coeff 
	  macoef = $coeff(theta_1)

If the "model" in question is actually a system (a VAR or VECM, or system of
simultaneous equations), $coeff with no parameters returns the matrix of
coefficients, one column per equation.

# $compan
Output:     matrix

Must follow the estimation of a VAR or a VECM; returns the companion matrix.

# $datatype
Output:     scalar

Returns an integer value representing the sort of dataset that is currently
loaded: 0 = no data; 1 = cross-sectional (undated) data; 2 = time-series
data; 3 = panel data.

# $df
Output:     scalar

Returns the degrees of freedom of the last estimated model.

# $ess
Output:     scalar

Returns the error sum of squares of the last estimated model.

# $gmmcrit
Output:     scalar

Must follow a gmm block. Returns the value of the objective function at its
minimum.

# $h
Output:     series

Must follow a garch command. Returns the estimated conditional variance.

# $hausman
Output:     row vector

Must follow a tsls command. Returns a 1 x 3 vector, containing the value of
the Hausman test statistic, the corresponding degrees of freedom and
p-value, in this order.

# $hqc
Output:     scalar

Returns the Hannan-Quinn Information Criterion for the last estimated model.

# $jalpha
Output:     matrix

Must follow the estimation of a VECM, and returns the loadings matrix. It
has as many rows as variables in the VECM and as many columns as the
cointegration rank.

# $jbeta
Output:     matrix

Must follow the estimation of a VECM, and returns the cointegration matrix.
It has as many rows as variables in the VECM (plus the number of exogenous
variables that are restricted to the cointegration space, if any), and as
many columns as the cointegration rank.

# $jvbeta
Output:     square matrix

Must follow the estimation of a VECM, and returns the estimated covariance
matrix for the elements of the cointegration vectors.

In the case of unrestricted estimation, it has a number of rows equal to the
unrestricted elements of the cointegration space after the Phillips
normalization. If, however, a restricted system is estimated via the
restrict command with the --full option, a singular matrix with (n+m)r rows
will be returned (n being the number of endogenous variables, m the number
of exogenous variables that are restricted to the cointegration space, and r
the cointegration rank).

Example: the code

	  open denmark.gdt
	  vecm 2 1 LRM LRY IBO IDE --rc --seasonals -q
	  s0 = $jvbeta

	  restrict --full
	  b[1,1] = 1
	  b[1,2] = -1
	  b[1,3] + b[1,4] = 0
	  end restrict
	  s1 = $jvbeta

	  print s0
	  print s1

produces the following output.

	  s0 (4 x 4)

	    0.019751     0.029816  -0.00044837     -0.12227 
	    0.029816      0.31005     -0.45823     -0.18526 
	 -0.00044837     -0.45823       1.2169    -0.035437 
	    -0.12227     -0.18526    -0.035437      0.76062 

	  s1 (5 x 5)

	  0.0000       0.0000       0.0000       0.0000       0.0000 
	  0.0000       0.0000       0.0000       0.0000       0.0000 
	  0.0000       0.0000      0.27398     -0.27398    -0.019059 
	  0.0000       0.0000     -0.27398      0.27398     0.019059 
	  0.0000       0.0000    -0.019059     0.019059    0.0014180 

# $lnl
Output:     scalar

Returns the log-likelihood for the last estimated model (where applicable).

# $ncoeff
Output:     scalar

Total number of coefficients estimated in the last model.

# $nobs
Output:     scalar

Returns the number of observations in the currently selected sample.

# $nvars
Output:     scalar

Returns the number of variables in the dataset (including the constant).

# $pd
Output:     scalar

Returns the frequency or periodicity of the data (e.g. 4 for quarterly
data).

# $pvalue
Output:     scalar

Returns the p-value of the test statistic that was generated by the last
explicit hypothesis-testing command, if any (e.g. chow). See the Gretl
User's Guide for details. See also "$test".

# $rho
Output:     scalar
Argument:   n (scalar, optional)

Without arguments, returns the first-order autoregressive coefficient for
the residuals of the last model. After estimating a model via the ar
command, the syntax $rho(n) returns the corresponding estimate of rho(n).

# $rsq
Output:     scalar

Returns the unadjusted R^2 from the last estimated model.

# $sample
Output:     series

Must follow estimation of a single-equation model. Returns a dummy series
with value 1 for observations used in estimation, 0 for observations within
the currently defined sample range but not used (presumably because of
missing values), and NA for observations outside of the current range.

If you wish to compute statistics based on the sample that was used for a
given model, you can do, for example:

	  ols y 0 xlist
	  genr sdum = $sample
	  smpl sdum --dummy

# $sargan
Output:     row vector

Must follow a tsls command. Returns a 1 x 3 vector, containing the value of
the Sargan over-identification test statistic, the corresponding degrees of
freedom and p-value, in this order.

# $sigma
Output:     scalar

Returns the standard error of the residuals (or Standard Error of Estimate)
from the last model.

# $stderr
Output:     scalar or matrix
Argument:   s (name of coefficient, optional)

The $stderr accessor can be used in two ways: with no arguments, it returns
a column vector containing the standard error of the coefficients for the
last model. With the optional argument, it returns a scalar, namely the
standard error of the parameter called s. See also "$coeff", "$vcv".

# $stopwatch
Output:     scalar

Must be preceded by set stopwatch, which activates the measurement of CPU
time. The first use of this accessor yields the seconds of CPU time that
have elapsed since the set stopwatch command. At each access the clock is
reset, so subsequent uses of $stopwatch yield the seconds of CPU time since
the previous access.

# $T
Output:     scalar

Number of observations used in estimating the last model.

# $t1
Output:     scalar

The 1-based index of the first observation in the currently selected sample.

# $t2
Output:     scalar

The 1-based index of the last observation in the currently selected sample.

# $test
Output:     scalar

Returns the value of the test statistic that was generated by the last
explicit hypothesis-testing command, if any (e.g. chow). See the Gretl
User's Guide for details. See also "dpvalue".

# $trsq
Output:     scalar

Returns TR^2 (sample size times R-squared) from the last model.

# $uhat
Output:     series

Returns the residuals from the last model. This may have different meanings
for different estimators. For example, after an ARMA estimation $uhat will
contain the one-step-ahead forecast error; after a probit model, it will
contain the generalized residuals.

If the "model" in question is actually a system (a VAR or VECM, or system of
simultaneous equations), $uhat with no parameters retrieves the matrix of
residuals, one column per equation.

# $unit
Output:     series

Valid for panel datasets only. Returns a series with value 1 for all
observations on the first unit or group, 2 for observations on the second
unit, and so on.

# $vcv
Output:     scalar or matrix
Arguments:  s1 (name of coefficient, optional)
            s2 (name of coefficient, optional)

The $stderr accessor can be used in two ways: with no arguments, it returns
a square matrix containing the estimated covariance matrix for the
coefficients of the last model. With the optional arguments, it returns a
scalar, which is the estimated covariance between the parameters named s1
and s2. See also "$coeff", "$stderr".

If the "model" in question is actually a system (a VAR or VECM, or system of
simultaneous equations), $vcv with no parameters returns the cross-equation
covariance matrix.

# $version
Output:     scalar

Returns an integer value that codes for the program version. The gretl
version string takes the form x.y.z (for example, 1.7.6). The return value
from this accessor is formed as 10000*x + 100*y + z, so that 1.7.6
translates as 10706.

# $windows
Output:     scalar

Returns 1 if gretl is running on MS Windows, otherwise 0. By conditioning on
the value of this variable you can write shell calls that are portable
across different operating systems.

Also see the "shell" command.

# $xlist
Output:     list

Returns the list of regressors from the last model (for single-equation
models only).

# $yhat
Output:     series

Returns the fitted values from the last regression.

## Funcoes
# abs
Output:     same type as input
Argument:   x (scalar, series or matrix)

Absolute value.

# acos
Output:     same type as input
Argument:   x (scalar, series or matrix)

The arc cosine of x, that is, the value whose cosine is x. The result is in
radians; the input should be in the range -1 to 1.

# asin
Output:     same type as input
Argument:   x (scalar, series or matrix)

The arc sine of x, that is, the value whose sine is x. The result is in
radians; the input should be in the range -1 to 1.

# atan
Output:     same type as input
Argument:   x (scalar, series or matrix)

The arc tangent of x, that is, the value whose tangent is x. The result is
in radians.

# BFGSmax
Output:     scalar
Arguments:  b (vector)
            s (string)

Numerical maximization via the method of Broyden, Fletcher, Goldfarb and
Shanno. The vector b should hold the initial values of a set of parameters,
and the string s should specify a call to a function that calculates the
(scalar) criterion to be maximized, given the current parameter values and
any other relevant data. If the object is in fact minimization, this
function should return the negative of the criterion. On successful
completion, BFGSmax returns the maximized value of the criterion, and b
holds the parameter values which produce the maximum.

For more details and examples see the chapter on special functions in genr
in the Gretl User's Guide. See also "fdjac".

# bkfilt
Output:     series
Argument:   y (series)

Extracts the cyclical component of series y via the Baxter-King bandpass
filter, a two-sided symmetric filter. See the Gretl User's Guide for
details. See also "hpfilt".

# cdemean
Output:     matrix
Argument:   X (matrix)

Centers the columns of matrix X around their means.

# cdf
Output:     same type as input
Arguments:  c (character)
            ... (see below)
            x (scalar, series or matrix)
Examples:   p1 = cdf(N, -2.5)
            p2 = cdf(X, 3, 5.67)
            p3 = cdf(D, 0.25, -1, 1)

Cumulative distribution function calculator. Returns P(X < x), where the
distribution X is determined by the character c. Between the arguments c and
x, zero or more additional arguments are required to specify the parameters
of the distribution, as follows.

  Standard normal (c = z, n, or N): no extra arguments

  Bivariate normal (D): correlation coefficient

  Student's t (t): degrees of freedom

  Chi square (c, x, or X): degrees of freedom

  Snedecor's F (f or F): df (num.); df (den.)

  Gamma (g or G): shape; scale

  Binomial (b or B): probability; number of trials

  Poisson (p or P): Mean

  Weibull (w or W): shape; scale

Note that most cases have aliases to help memorizing the codes. The
bivariate normal case is special: the syntax is x = cdf(D, rho, z1, z2)
where rho is the correlation between the variables z1 and z2.

See also "pdf", "critical", "invcdf", "pvalue".

# cdiv
Output:     matrix
Arguments:  X (matrix)
            Y (matrix)

Complex division. The two arguments must have the same number of rows, n,
and either one or two columns. The first column contains the real part and
the second (if present) the imaginary part. The return value is an n x 2
matrix or, if the result has no imaginary part, an n-vector. See also
"cmult".

# ceil
Output:     same type as input
Argument:   x (scalar, series or matrix)

Ceiling function: returns the smallest integer greater than or equal to x.
See also "floor", "int".

# cholesky
Output:     square matrix
Argument:   A (square matrix)

Peforms a Cholesky decomposition of the matrix A, which is assumed to be
symmetric and positive definite. The result is a lower-triangular matrix K
which satisfies A = KK'. The function will fail if A is not symmetric or not
positive definite.

# cmult
Output:     matrix
Arguments:  X (matrix)
            Y (matrix)

Complex multiplication. The two arguments must have the same number of rows,
n, and either one or two columns. The first column contains the real part
and the second (if present) the imaginary part. The return value is an n x 2
matrix, or, if the result has no imaginary part, an n-vector. See also
"cdiv".

# cnorm
Output:     same type as input
Argument:   x (scalar, series or matrix)

Returns the cumulative distribution function for a standard normal. See also
"dnorm", "qnorm".

# colnames
Output:     scalar
Arguments:  M (matrix)
            s (named list or string)

Attaches names to the columns of the T x k matrix M. If s is a named list,
the column names are copied from the names of the variables; the list must
have k members. If s is a string, it should contain k space-separated
sub-strings. The return value is 0 on successful completion, non-zero on
error.

# cols
Output:     scalar
Argument:   X (matrix)

The number of columns of X. See also "mshape", "rows", "unvech", "vec",
"vech".

# corr
Output:     scalar
Arguments:  y1 (series)
            y2 (series)

Computes the correlation coefficient between y1 and y2. See also "cov",
"mcov", "mcorr".

# cos
Output:     same type as input
Argument:   x (scalar, series or matrix)

Cosine.

# cov
Output:     scalar
Arguments:  y1 (series)
            y2 (series)

Computes the covariance between y1 and y2. See also "corr", "mcov", "mcorr".

# critical
Output:     same type as input
Arguments:  c (character)
            ... (see below)
            p (scalar, series or matrix)
Examples:   c1 = critical(t, 20, 0.025)
            c2 = critical(F, 4, 48, 0.05)

Critical value calculator. Returns x such that P(X > x) = p, where the
distribution X is determined by the character c. Between the arguments c and
p, zero or more additional arguments are required to specify the parameters
of the distribution, as follows.

  Standard normal (c = z, n, or N): no extra arguments

  Student's t (t): degrees of freedom

  Chi square (c, x, or X): degrees of freedom

  Snedecor's F (f or F): df (num.); df (den.)

  Binomial (b or B): probability; trials

See also "cdf", "invcdf", "pvalue".

# cum
Output:     same type as input
Argument:   x (series or matrix)

Cumulates x. When x is a series, produces a series y each of whose elements
is the sum of the values of x to date; the starting point of the summation
is the first non-missing observation in the currently selected sample. When
x is a matrix, its elements are cumulated by columns.

See also "diff".

# det
Output:     scalar
Argument:   A (square matrix)

Returns the determinant of A, computed via the LU factorization. See also
"ldet", "rcond".

# diag
Output:     matrix
Argument:   X (matrix)

Returns the principal diagonal of X in a column vector. Note: if X is an m x
n marix, the number of elements of the output vector is min(m, n). See also
"tr".

# diff
Output:     same type as input
Argument:   y (series, matrix or list)

Computes first differences. If y is a series, or a list of series, starting
values are set to NA. If y is a matrix, differencing is done by columns and
starting values are set to 0.

When a list is returned, the individual variables are automatically named
according to the template d_varname where varname is the name of the
original series. The name is truncated if necessary, and may be adjusted in
case of non-uniqueness in the set of names thus constructed.

See also "cum", "ldiff", "sdiff".

# dnorm
Output:     same type as input
Argument:   x (scalar, series or matrix)

Returns the density of the standard normal distribution at x. To get the
density for a non-standard normal distribution at x, pass the z-score of x
to the dnorm function and multiply the result by the Jacobian of the z
transformation, namely 1 over sigma, as illustrated below:

	  mu = 100
	  sigma = 5
	  x = 109
	  fx = (1/sigma) * dnorm((x-mu)/sigma)

See also "cnorm", "qnorm".

# dsort
Output:     same type as input
Argument:   x (series or vector)

Sorts x in descending order, skipping observations with missing values when
x is a series. See also "sort", "values".

# dummify
Output:     list
Argument:   x (series or list)

The argument x should be a discrete series, or list of such series. This
function creates a set of dummy variables coding for the distinct values in
the series; the smallest value is taken as the omitted category and is not
explicitly represented.

The generated variables are automatically named according to the template
Dvarname_i where varname is the name of the original series and i is a
1-based index. The original portion of the name is truncated if necessary,
and may be adjusted in case of non-uniqueness in the set of names thus
constructed.

# eigengen
Output:     matrix
Arguments:  A (square matrix)
            &U (reference to matrix, or null)

Computes the eigenvalues, and optionally the right eigenvectors, of the n x
n matrix A. If all the eigenvalues are real, an n x 1 matrix is returned;
otherwise, the result is an n x 2 matrix, the first column holding the real
components and the second column the imaginary components.

The second argument must be either the name of an existing matrix preceded
by & (to indicate the "address" of the matrix in question), in which case an
auxiliary result is written to that matrix, or the keyword null, in which
case the auxiliary result is not produced.

If a non-null second argument is given, the specified matrix will be
over-written with the auxiliary result. (It is not required that the
existing matrix be of the right dimensions to receive the result.) It will
be organized as follows:

  If the i-th eigenvalue is real, the i-th column of U will contain the
  corresponding eigenvector;

  If the i-th eigenvalue is complex, the i-th column of U will contain the
  real part of the corresponding eigenvector and the next column the
  imaginary part. The eigenvector for the conjugate eigenvalue is the
  conjugate of the eigenvector.

In other words, the eigenvectors are stored in the same order as the
eigenvalues, but the real eigenvectors occupy one column, whereas complex
eigenvectors take two (the real part comes first); the total number of
columns is still n, because the conjugate eigenvector is skipped.

See also "eigensym", "qrdecomp", "svd".

# eigensym
Output:     column vector
Arguments:  A (square matrix)
            &U (reference to matrix, or null)

Computes the eigenvalues, and optionally the right eigenvectors, of the n x
n symmetrix matrix A; the second argument must be either the name of an
existing matrix preceded by & (to indicate the "address" of the matrix in
question), in which case an auxiliary result is written to that matrix, or
the keyword null, in which case the auxiliary result is not produced.

If the second argument is not null, the specified matrix will be
over-written with the auxiliary result. (It is not required that the
existing matrix be of the right dimensions to receive the result.)

See also "eigengen", "qrdecomp", "svd".

# exp
Output:     same type as input
Argument:   x (scalar, series or matrix)

Exponential. Note: in case of matrices, the function acts element by
element. For the matrix exponential function, see "mexp".

# fdjac
Output:     matrix
Arguments:  b (column vector)
            s (string)

Calculates the (forward-difference approximation to the) Jacobian associated
with the vector b and the transformation function defined by the function
call in the string s. For more details and examples see the chapter on
special functions in genr in the Gretl User's Guide.

See also "BFGSmax".

# fft
Output:     matrix
Argument:   X (matrix)

Discrete real Fourier transform. If the input matrix X has n columns, the
output has 2n columns, where the real parts are stored in the odd columns
and the complex parts in the even ones.

Should it be necessary to compute the Fourier transform on several vectors
with the same number of elements, it is numerically more efficient to group
them into a matrix rather than invoking fft for each vector separately. See
also "ffti".

# ffti
Output:     matrix
Argument:   X (matrix)

Inverse discrete real Fourier transform. It is assumed that X contains n
complex column vectors, with the real part in the odd columns and the
imaginary part in the even ones, so the total number of columns should be
2n. A matrix with n columns is returned.

Should it be necessary to compute the inverse Fourier transform on several
vectors with the same number of elements, it is numerically more efficient
to group them into a matrix rather than invoking ffti for each vector
separately. See also "fft".

# firstobs
Output:     scalar
Argument:   y (series)

First non-missing observation for the variable y. Note that if some form of
subsampling is in effect, the value returned may be smaller than the dollar
variable "$t1". See also "lastobs".

# floor
Output:     same type as input
Argument:   y (scalar, series or matrix)

Floor function: returns the greatest integer less than or equal to x. Note:
"int" and floor differ in their effect for negative arguments: int(-3.5)
gives -3, while floor(-3.5) gives -4.

# fracdiff
Output:     series
Arguments:  y (series)
            d (scalar)

Returns the fractional difference of order d for the series y.

Note that in theory fractional differentiation is an infinitely long filter.
In practice, presample values of y_t are assumed to be zero.

# gammafun
Output:     same type as input
Argument:   x (scalar, series or matrix)

Returns the gamma function of x.

# genpois
Output:     series
Argument:   mu (scalar or series)

Generates a series of Poisson pseudo-random variates. If mu is a scalar, all
the elements are drawn from the same distribution; if mu is a series, the
appropriate value mu_t is used at each observation.

See also "randgen", "normal", "uniform", "mnormal", "muniform".

# getenv
Output:     string
Argument:   s (string)

If an environment variable by the name of s is defined, returns the value of
that variable, otherwise returns an empty string.

# gini
Output:     scalar
Argument:   y (series)

Returns Gini's inequality index for the series y.

# ginv
Output:     matrix
Argument:   A (matrix)

Returns A^+, the Moore-Penrose or generalized inverse of A, computed via the
singular value decomposition.

This matrix has the properties A A^+ A = A and A^+ A A^+ = A^+ . Moreover,
the products A A^+ and A^+ A are symmetric by construction.

See also "inv", "svd".

# hpfilt
Output:     series
Argument:   y (series)

Returns the cycle from the Hodrick-Prescott filter applied to series y. See
the Gretl User's Guide for details. See also "bkfilt".

# I
Output:     square matrix
Argument:   n (scalar)

Returns an identity matrix with n rows and columns.

# imaxc
Output:     row vector
Argument:   X (matrix)

Returns the row indices of the maxima of the columns of X.

See also "imaxr", "iminc", "maxc".

# imaxr
Output:     column vector
Argument:   X (matrix)

Returns the column indices of the maxima of the rows of X.

See also "imaxc", "iminr", "maxr".

# iminc
Output:     row vector
Argument:   X (matrix)

Returns the row indices of the minima of the columns of X.

See also "iminr", "imaxc", "minc".

# iminr
Output:     column vector
Argument:   X (matrix)

Returns the column indices of the mimima of the rows of X.

See also "iminc", "imaxr", "minr".

# infnorm
Output:     scalar
Argument:   X (matrix)

Returns the infinity-norm of X, that is, the maximum across the rows of X of
the sum of absolute values of the row elements.

See also "onenorm".

# int
Output:     same type as input
Argument:   x (scalar, series or matrix)

Truncates the fractional part of x. Note: int and "floor" differ in their
effect for negative arguments: int(-3.5) gives -3, while floor(-3.5) gives
-4. See also "ceil".

# inv
Output:     matrix
Argument:   A (square matrix)

Returns the inverse of A. If A is singular or not square, an error message
is produced and nothing is returned. Note that gretl checks automatically
the structure of A and uses the most efficient numerical procedure to
perform the inversion.

The matrix types gretl checks for are: identity; diagonal; symmetric and
positive definite; symmetric but not positive definite; and triangular.

See also "ginv", "invpd".

# invcdf
Output:     same type as input
Arguments:  c (character)
            ... (see below)
            p (scalar, series or matrix)

Inverse cumulative distribution function calculator. Returns x such that P(X
< x) = p, where the distribution X is determined by the character c; Between
the arguments c and p, zero or more additional arguments are required to
specify the parameters of the distribution, as follows.

  Standard normal (c = z, n, or N): no extra arguments

  Student's t (t): degrees of freedom

  Chi square (c, x, or X): degrees of freedom

  Snedecor's F (f or F): df (num.); df (den.)

  Binomial (b or B): probability; trials

See also "cdf", "critical", "pvalue".

# invpd
Output:     square matrix
Argument:   A (symmetric matrix)

Returns the inverse of the symmetric, positive definite matrix A. This
function is slightly faster than "inv" for large matrices, since no check
for symmetry is performed; for that reason it should be used with care.

# islist
Output:     scalar
Argument:   s (string)

Returns 1 if s is the identifier for a currently defined list, otherwise 0.
See also "isnull", "isseries", "isstring".

# isnull
Output:     scalar
Argument:   s (string)

Returns 0 if s is the identifier for a currently defined object, be it a
scalar, a series, a matrix, list or string; otherwise returns 1. See also
"islist", "isseries", "isstring".

# isseries
Output:     scalar
Argument:   s (string)

Returns 1 if s is the identifier for a currently defined series, otherwise
0. See also "islist", "isnull", "isstring".

# isstring
Output:     scalar
Argument:   s (string)

Returns 1 if s is the identifier for a currently defined string, otherwise
0. See also "islist", "isnull", "isseries".

# lags
Output:     list
Arguments:  p (scalar)
            y (series or list)

Generates lags 1 to p of the series y, or if y is a list, of all variables
in the list. If p = 0, the maximum lag defaults to the periodicity of the
data; otherwise p must be positive.

The generated variables are automatically named according to the template
varname_i where varname is the name of the original series and i is the
specific lag. The original portion of the name is truncated if necessary,
and may be adjusted in case of non-uniqueness in the set of names thus
constructed.

# lastobs
Output:     scalar
Argument:   y (series)

Last non-missing observation for the variable y. Note that if some form of
subsampling is in effect, the value returned may be larger than the dollar
variable "$t2". See also "firstobs".

# ldet
Output:     scalar
Argument:   A (square matrix)

Returns the natural log of the determinant of A, computed via the LU
factorization. See also "det", "rcond".

# ldiff
Output:     same type as input
Argument:   y (series or list)

Computes log differences; starting values are set to NA.

When a list is returned, the individual variables are automatically named
according to the template ld_varname where varname is the name of the
original series. The name is truncated if necessary, and may be adjusted in
case of non-uniqueness in the set of names thus constructed.

See also "diff", "sdiff".

# lincomb
Output:     series
Arguments:  L (list)
            b (vector)

Computes a new series as a linear combination of the series in the list L.
The coefficients are given by the vector b, which must have length equal to
the number of series in L.

See also "wmean".

# ljungbox
Output:     scalar
Arguments:  y (series)
            p (scalar)

Computes the Ljung-Box Q' statistic for the series y using lag order p. The
currently defined sample range is used. The lag order must be greater than
or equal to 1 and less than the number of available observations.

This statistic may be referred to the chi-square distribution with p degrees
of freedom as a test of the null hypothesis that the series y is serially
independent. See also "pvalue".

# lngamma
Output:     same type as input
Argument:   x (scalar, series or matrix)

Log of the gamma function of x.

# log
Output:     same type as input
Argument:   x (scalar, series, matrix or list)

Natural logarithm; produces NA for non-positive values. Note: ln is an
acceptable alias for log.

When a list is returned, the individual variables are automatically named
according to the template l_varname where varname is the name of the
original series. The name is truncated if necessary, and may be adjusted in
case of non-uniqueness in the set of names thus constructed.

# log10
Output:     same type as input
Argument:   x (scalar, series or matrix)

Base-10 logarithm; produces NA for non-positive values.

# log2
Output:     same type as input
Argument:   x (scalar, series or matrix)

Base-2 logarithm; produces NA for non-positive values.

# lower
Output:     square matrix
Argument:   A (matrix)

Returns an n x n lower triangular matrix: the elements on and below the
diagonal are equal to the corresponding elements of A; the remaining
elements are zero.

See also "upper".

# lrvar
Output:     scalar
Arguments:  y (series)
            k (scalar)

Returns the long-run variance of y, calculated using a Bartlett kernel with
window size k. If k is negative, int(T^(1/3)) is used.

# makemask
Output:     column vector
Argument:   y (series)

Produces a column vector containing the observation numbers corresponding to
the non-zero entries in the series y. This function is typically useful for
filtering out rows of a matrix built from data series.

# max
Output:     scalar or series
Argument:   y (series or list)

If the argument y is a series, returns the (scalar) maximum of the
non-missing observations in the series. If the argument is a list, returns a
series each of whose elements is the maximum of the values of the listed
variables at the given observation.

# maxc
Output:     row vector
Argument:   X (matrix)

Returns the maxima of the columns of X.

See also "imaxc", "maxr", "minc".

# maxr
Output:     column vector
Argument:   X (matrix)

Returns the maxima of the rows of X.

See also "imaxc", "maxc", "minr".

# mcorr
Output:     matrix
Argument:   X (matrix)

Computes a correlation matrix treating each column of X as a variable. See
also "corr", "cov", "mcov".

# mcov
Output:     matrix
Argument:   X (matrix)

Computes a covariance matrix treating each column of X as a variable. See
also "corr", "cov", "mcorr".

# mean
Output:     scalar or series
Argument:   x (series or list)

If x is a series, returns the (scalar) sample mean, skipping any missing
observations.

If x is a list, returns a series y such that y_t is the mean of the values
of the variables in the list at observation t, or NA if there are any
missing values at t.

# meanc
Output:     row vector
Argument:   X (matrix)

Returns the means of the columns of X. See also "meanr", "sumc", "sdc".

# meanr
Output:     column vector
Argument:   X (matrix)

Returns the means of the rows of X. See also "meanc", "sumr".

# median
Output:     scalar
Argument:   y (series)

The median of the non-missing observations in series y. See also "quantile".

# mexp
Output:     square matrix
Argument:   A (square matrix)

Computes the matrix exponential of A, using algorithm 11.3.1 from Golub and
Van Loan (1996).

# min
Output:     scalar or series
Argument:   y (series or list)

If the argument y is a series, returns the (scalar) minimum of the
non-missing observations in the series. If the argument is a list, returns a
series each of whose elements is the minimum of the values of the listed
variables at the given observation.

# minc
Output:     row vector
Argument:   X (matrix)

Returns the minima of the columns of X.

See also "iminc", "maxc", "minr".

# minr
Output:     column vector
Argument:   X (matrix)

Returns the minima of the rows of X.

See also "iminr", "maxr", "minc".

# missing
Output:     same type as input
Argument:   x (scalar or series)

Returns a binary variable holding 1 if x is NA. If x is a series, the
comparison is done element by element. See also "misszero", "ok",
"zeromiss".

# misszero
Output:     same type as input
Argument:   x (scalar or series)

Converts NAs to zeros. If x is a series, the conversion is done element by
element. See also "missing", "ok", "zeromiss".

# mlag
Output:     matrix
Arguments:  X (matrix)
            p (scalar)

For p > 0, returns a matrix in which the columns of X are shifted down by p
rows and the first p rows are filled with zeros. If p is a negative number,
X is shifted up and the last rows are filled with zeros.

# mnormal
Output:     matrix
Arguments:  r (scalar)
            c (scalar)

Returns a matrix with r rows and c columns, filled with standard normal
pseudo-random variates. See also "normal", "muniform".

# mols
Output:     matrix
Arguments:  Y (matrix)
            X (matrix)
            &U (reference to matrix, or null)

Returns a k x n matrix of parameter estimates obtained by OLS regression of
the T x n matrix Y on the T x k matrix X. The Cholesky decomposition is
used. If the third argument is not null, the T x n matrix U will contain the
residuals.

# movavg
Output:     series
Arguments:  x (series)
            p (scalar)

Computes the p-term moving average for the series x, that is the average of
x(t) to x(t-p+1).

Note that the result is not centered. If you want a centered moving average,
you can use the lead operator on the returned series. Example:

	    tmp = movavg(x,3)
	    y = tmp(+1)

# mread
Output:     matrix
Argument:   s (string)

Reads a matrix from a text file. The string s must contain the name of the
(plain text) file from which the matrix is to be read. The file in question
must conform to the following rules:

  The columns must be separated by spaces or tab characters.

  The decimal separator must be the dot character, ".".

  The first line in the file must contain two integers, separated by a space
  or a tab, indicating the number of rows and columns, respectively.

Should an error occur (such as the file being badly formatted or
inaccessible), an empty matrix is returned.

See also "mwrite".

# mshape
Output:     matrix
Arguments:  X (matrix)
            r (scalar)
            c (scalar)

Rearranges the elements of X into a matrix with r rows and c columns.
Elements are read from X and written to the target in column-major order. If
X contains fewer than k = rc elements, the elements are repeated cyclically;
otherwise, if X has more elements, only the first k are used.

See also "cols", "rows", "unvech", "vec", "vech".

# msortby
Output:     matrix
Arguments:  X (matrix)
            j (scalar)

Returns a matrix in which the rows of X are reordered by increasing value of
the elements in column j.

# muniform
Output:     matrix
Arguments:  r (scalar)
            c (scalar)

Returns a matrix with r rows and c columns, filled with uniform (0,1)
pseudo-random variates. Note: the preferred method for generating a scalar
uniform r.v. is recasting the output of muniform to a scalar, as in

	  scalar x = muniform(1,1)

See also "mnormal", "uniform".

# mwrite
Output:     scalar
Arguments:  X (matrix)
            s (string)

Writes the matrix X to a plain text file named s. The file will contain on
the first line two integers, separated by a tab character, with the number
of rows and columns; on the next lines, the matrix elements in scientific
notation, separated by tabs (one line per row).

If file s already exists, it will be overwritten. The return value is 0 on
successful completion; if an error occurs, such as the file being
unwritable, the return value will be non-zero.

Matrices stored via the mwrite command can be easily read by other programs;
see the Gretl User's Guide for details.

See also "mread".

# mxtab
Output:     matrix
Arguments:  x (series or vector)
            y (series or vector)

Returns a matrix holding the cross tabulation of the values contained in x
(by row) and y (by column). The two arguments should be of the same type
(both series or both column vectors), and because of the typical usage of
this function, are assumed to contain integer values only.

See also "values".

# nelem
Output:     scalar
Argument:   L (list)

Returns the number of items in list L.

# nobs
Output:     scalar
Argument:   y (series)

Returns the number of non-missing observations for the variable y in the
currently selected sample.

# normal
Output:     series
Arguments:  mu (scalar)
            sigma (scalar)

Generates a series of Gaussian pseudo-random variates with mean mu and
standard deviation sigma. If no arguments are supplied, standard normal
variates N(0,1) are produced.

See also "randgen", "normal", "genpois", "mnormal", "muniform".

# nullspace
Output:     matrix
Argument:   A (matrix)

Computes the right nullspace of A, via the singular value decomposition: the
result is a matrix B such that the product AB is a zero matrix, except when
A has full column rank, in which case an empty matrix is returned.
Otherwise, if A is m x n, B will be n by (n - r), where r is the rank of A.

See also "rank", "svd".

# obs
Output:     series

Returns a series of consecutive integers, setting 1 at the start of the
dataset. Note that the result is invariant to subsampling. This function is
especially useful with time-series datasets. Note: you can write t instead
of obs with the same effect.

See also "obsnum".

# obsnum
Output:     scalar
Argument:   s (string)

Returns an integer corresponding to the observation specified by the string
s. Note that the result is invariant to subsampling. This function is
especially useful with time-series datasets. For example, the following code

	  open denmark 
	  k = obsnum(1980:1)

yields k = 25, indicating that the first quarter of 1980 is the 25th
observation in the denmark dataset.

See also "obs".

# ok
Output:     same type as input
Argument:   x (scalar, series or list)

Returns a binary variable holding 1 if x is not NA. If x is a series, the
comparison is done element by element. If x is a list of series, the output
is a series with 0 at the observations for which at least one series in the
list is missing, and 1 otherwise.

See also "missing", "misszero", "zeromiss".

# onenorm
Output:     scalar
Argument:   X (matrix)

Returns the 1-norm of the matrix X, that is, the maximum across the columns
of X of the sum of absolute values of the column elements.

See also "infnorm", "rcond".

# ones
Output:     matrix
Arguments:  r (scalar)
            c (scalar)

Outputs a matrix with r rows and c columns, filled with ones.

See also "seq", "zeros".

# orthdev
Output:     series
Argument:   y (series)

Only applicable if the currently open dataset has a panel structure.
Computes the forward orthogonal deviations for variable y.

This transformation is sometimes used instead of differencing to remove
individual effects from panel data. For compatibility with first
differences, the deviations are stored one step ahead of their true temporal
location (that is, the value at observation t is the deviation that,
strictly speaking, belongs at t - 1). That way one loses the first
observation in each time series, not the last.

See also "diff".

# pdf
Output:     same type as input
Arguments:  c (character)
            ... (see below)
            x (scalar, series or matrix)
Examples:   f1 = pdf(N, -2.5)
            f2 = pdf(X, 3, y)
            f3 = pdf(W, shape, scale, y)

Probability density function calculator. Returns the density at x of the
distribution identified by the code c. See "cdf" for details of the required
arguments. The distributions supported by the pdf function are the normal,
Student's t, chi-square, F, Gamma and Weibull.

For the normal distribution, see also "dnorm".

# pmax
Output:     series
Argument:   y (series)

Only applicable if the currently open dataset has a panel structure. Returns
the per-unit maximum for variable y.

Missing values are skipped. See also "pmin", "pmean", "pnobs", "psd".

# pmean
Output:     series
Argument:   y (series)

Only applicable if the currently open dataset has a panel structure.
Computes the per-unit mean for variable y; that is, the sum of the valid
observations for each unit divided by the number of valid observations for
each unit.

Missing values are skipped. See also "pmax", "pmin", "pnobs", "psd".

# pmin
Output:     series
Argument:   y (series)

Only applicable if the currently open dataset has a panel structure. Returns
the per-unit mimimum for variable y.

Missing values are skipped. See also "pmax", "pmean", "pnobs", "psd".

# pnobs
Output:     series
Argument:   y (series)

Only applicable if the currently open dataset has a panel structure. Returns
for each unit the number of non-missing cases for the variable y.

Missing values are skipped. See also "pmax", "pmin", "pmean", "psd".

# polroots
Output:     matrix
Argument:   a (vector)

Finds the roots of a polynomial. If the polynomial is of degree p, the
vector a should contain p + 1 coefficients in ascending order, i.e. starting
with the constant and ending with the coefficient on x^p.

If all the roots are real they are returned in a column vector of length p,
otherwise a p x 2 matrix is returned, the real parts in the first column and
the imaginary parts in the second.

# princomp
Output:     matrix
Arguments:  X (matrix)
            p (scalar)

Let the matrix X be T x k, containing T observations on k variables. The
argument p must be a positive integer less than or equal to k. This function
returns a T x p matrix, P, holding the first p principal components of X.

The elements of P are computed as the sum from i to k of Z_ti times v_ji,
where Z_ti is the standardized value of variable i at observation t and v_ji
is the jth eigenvector of the correlation matrix of the X_is, with the
eigenvectors ordered by decreasing value of the corresponding eigenvalues.

See also "eigensym".

# psd
Output:     series
Argument:   y (series)

Only applicable if the currently open dataset has a panel structure.
Computes the per-unit sample standard deviation for variable y. The
denominator used is the sample size for each unit minus 1, unless the number
of valid observations for the given unit is 1 (in which case 0 is returned)
or 0 (in which case NA is returned).

Note: this function makes it possible to check whether a given variable
(say, X) is time-invariant via the condition max(psd(X)) = 0.

See also "pmax", "pmin", "pmean", "pnobs".

# pvalue
Output:     same type as input
Arguments:  c (character)
            ... (see below)
            x (scalar, series or matrix)
Examples:   p1 = pvalue(z, 2.2)
            p2 = pvalue(X, 3, 5.67)
            p2 = pvalue(F, 3, 30, 5.67)

P-value calculator. Returns P(X > x), where the distribution X is determined
by the character c. Between the arguments c and x, zero or more additional
arguments are required to specify the parameters of the distribution; see
"cdf" for details. The distributions supported by the pval function are the
standard normal, t, Chi square, F, gamma, binomial, Poisson and Weibull.

See also "critical", "invcdf".

# qform
Output:     matrix
Arguments:  x (matrix)
            A (symmetric matrix)

Computes the quadratic form Y = xAx'. Using this function instead of
ordinary matrix multiplication guarantees more speed and better accuracy. If
x and A are not conformable, or A is not symmetric, an error is returned.

# qnorm
Output:     same type as input
Argument:   x (scalar, series or matrix)

Returns quantiles for the standard normal distribution. If x is not between
0 and 1, NA is returned. See also "cnorm", "dnorm".

# qrdecomp
Output:     matrix
Arguments:  X (matrix)
            &R (reference to matrix, or null)

Computes the QR decomposition of an m x n matrix X, that is X = QR where Q
is an m x n orthogonal matrix and R is an n x n upper triangular matrix. The
matrix Q is returned directly, while R can be retrieved via the optional
second argument.

See also "eigengen", "eigensym", "svd".

# quantile
Output:     scalar or row vector
Arguments:  y (series or matrix)
            p (scalar between 0 and 1)

Given a series argument, returns the p-quantile for the series. For example,
when p = 0.5, the median is returned. Given a matrix argument, returns a row
vector containing the p-quantiles for the columns of y; that is, each column
is treated as a series.

# rank
Output:     scalar
Argument:   X (matrix)

Returns the rank of X, numerically computed via the singular value
decomposition. See also "svd".

# ranking
Output:     series
Argument:   y (series)

Returns a series with the ranks of y. The rank for observation i is the
number of elements in the series that are less than y_i plus one half the
number of elements in the series that are equal to y_i. (Intuitively, you
may think of chess points, where victory gives you one point and a draw
gives you half a point.) One is added so the lowest rank is 1 instead of 0.

See also "sort", "sortby".

# randgen
Output:     series
Arguments:  c (character)
            a (scalar)
            b (scalar)
Examples:   series x = randgen(u, 0, 100)
            series t14 = randgen(t, 14)
            series y = randgen(B, 0.6, 30)
            series g = randgen(G, 1, 1)

All-purpose random number generator. The parameter c is a character, which
specifies from which distribution the pseudo-random numbers should be drawn;
a and, in some cases, b gauge the shape of the distribution.

  Uniform (continuous) (c = u or U): minimum; maximum

  Standard normal (c = z, n, or N): mean; standard deviation

  Student's t (t): degrees of freedom

  Chi square (c, x, or X): degrees of freedom

  Snedecor's F (f or F): df (num.); df (den.)

  Gamma (g or G): shape; scale

  Binomial (b or B): probability; number of trials

  Poisson (p or P): Mean

  Weibull (w or W): shape; scale

See also "normal", "uniform", "genpois".

# rcond
Output:     scalar
Argument:   A (square matrix)

Returns the reciprocal condition number for A with respect to the 1-norm. In
many circumstances, this is a better measure of the sensitivity of A to
numerical operations such as inversion than the determinant.

The value is computed as the reciprocal of the product, 1-norm of A times
1-norm of A-inverse.

See also "det", "ldet", "onenorm".

# readfile
Output:     string
Argument:   fname (string)

If a file by the name of fname exists and is readable, returns a string
containing the content of this file, otherwise flags an error.

Also see the "sscanf" command.

# resample
Output:     same type as input
Argument:   x (series or matrix)

Resamples from x with replacement. In the case of a series argument, each
value of the returned series, y_t, is drawn from among all the values of x_t
with equal probability. When a matrix argument is given, each row of the
returned matrix is drawn from the rows of x with equal probability.

# round
Output:     same type as input
Argument:   x (scalar, series or matrix)

Rounds to the nearest integer. Note that when x lies halfway between two
integers, rounding is done "away from zero", so for example 2.5 rounds to 3,
but round(-3.5) gives -4. This is a common convention in spreadsheet
programs, but other software may yield different results. See also "ceil",
"floor", "int".

# rows
Output:     scalar
Argument:   X (matrix)

Number of rows of the matrix X. See also "cols", "mshape", "unvech", "vec",
"vech".

# sd
Output:     scalar or series
Argument:   x (series or list)

If x is a series, returns the (scalar) sample standard deviation, skipping
any missing observations.

If x is a list, returns a series y such that y_t is the sample standard
deviation of the values of the variables in the list at observation t, or NA
if there are any missing values at t.

See also "var".

# sdc
Output:     row vector
Argument:   X (matrix)

Returns the standard deviations of the columns of X (with no degrees of
freedom correction). See also "meanc", "sumc".

# sdiff
Output:     same type as input
Argument:   y (series or list)

Computes seasonal differences: y(t) - y(t-k), where k is the periodicity of
the current dataset (see "$pd"). Starting values are set to NA.

When a list is returned, the individual variables are automatically named
according to the template sd_varname where varname is the name of the
original series. The name is truncated if necessary, and may be adjusted in
case of non-uniqueness in the set of names thus constructed.

See also "diff", "ldiff".

# selifc
Output:     matrix
Arguments:  A (matrix)
            b (row vector)

Selects from A only the columns for which the corresponding element of b is
non-zero. b must be a row vector with the same number of columns as A.

See also "selifr".

# selifr
Output:     matrix
Arguments:  A (matrix)
            b (column vector)

Selects from A only the rows for which the corresponding element of b is
non-zero. b must be a column vector with the same number of rows as A.

See also "selifc", "trimr".

# seq
Output:     row vector
Arguments:  a (scalar)
            b (scalar)

Returns a row vector filled with consecutive integers, with a as first
element and b last. If a is greater than b the sequence will be decreasing.
If either argument is not integral its fractional part is discarded.

See also "ones", "zeros".

# sin
Output:     same type as input
Argument:   x (scalar, series or matrix)

Sine. See also "cos", "tan", "atan".

# sort
Output:     same type as input
Argument:   x (series or vector)

Sorts x in ascending order, skipping observations with missing values when x
is a series. See also "dsort", "values". For matrices specifically, see
"msortby".

# sortby
Output:     series
Arguments:  y1 (series)
            y2 (series)

Returns a series containing the elements of y2 sorted by increasing value of
the first argument, y1. See also "sort", "ranking".

# sqrt
Output:     same type as input
Argument:   x (scalar, series or matrix)

Square root of x; produces NA for negative values.

# sst
Output:     scalar
Argument:   y (series)

Sum of squared deviations from the mean for the non-missing observations in
series y. See also "var".

# strlen
Output:     scalar
Argument:   s (string)

Returns the number of characters in s.

# strstr
Output:     string
Arguments:  s1 (string)
            s2 (string)

Searches s1 for an occurrence of the string s2. If a match is found, returns
a copy of the portion of s1 that starts with s2, otherwise returns an empty
string.

# sum
Output:     scalar
Argument:   y (series)

Sum of the non-missing observations in series y.

# sumc
Output:     row vector
Argument:   X (matrix)

Returns the sums of the columns of X. See also "meanc", "sumr".

# sumr
Output:     column vector
Argument:   X (matrix)

Returns the sums of the rows of X. See also "meanr", "sumc".

# svd
Output:     row vector
Arguments:  X (matrix)
            &U (reference to matrix, or null)
            &V (reference to matrix, or null)

Performs the singular values decomposition of the matrix X.

The singular values are returned in a row vector. The left and/or right
singular vectors U and V may be obtained by supplying non-null values for
arguments 2 and 3, respectively. For any matrix A, the code

	  s = svd(A, &U, &V) 
	  B = (U .* s) * V

should yield B identical to A (apart from machine precision).

See also "eigengen", "eigensym", "qrdecomp".

# tan
Output:     same type as input
Argument:   x (scalar, series or matrix)

Tangent.

# tr
Output:     scalar
Argument:   A (square matrix)

Returns the trace of the square matrix A, namely the sum of its diagonal
elements. See also "diag".

# transp
Output:     matrix
Argument:   X (matrix)

Matrix transposition. Note: this is rarely used; in order to get the
transpose of a matrix, in most cases you can just use the prime operator:
X'.

# trimr
Output:     matrix
Arguments:  X (matrix)
            ttop (scalar)
            tbot (scalar)

Returns a matrix that is a copy of X with ttop rows trimmed at the top and
tbot rows trimmed at the bottom. The latter two arguments must be
non-negative, and must sum to less than the total rows of X.

See also "selifr".

# uniform
Output:     series
Arguments:  a (scalar)
            b (scalar)

Generates a series of uniform pseudo-random variates in the interval (a, b),
or, if no arguments are supplied, in the interval (0,1). The algorithm used
is the Mersenne Twister by Matsumoto and Nishimura (1998).

See also "randgen", "normal", "genpois", "mnormal", "muniform".

# unvech
Output:     square matrix
Arguments:  v (vector)
            b (scalar)

Returns an n x n symmetric matrix obtained by rearranging the elements of v.
The number of elements in v must be a triangular integer -- i.e., a number k
such that an integer n exists with the property k = n(n+1)/2. This is the
inverse of the function "vech".

See also "mshape".

# upper
Output:     square matrix
Argument:   A (square matrix)

Returns an n x n upper triangular matrix: the elements on and above the
diagonal are equal to the corresponding elements of A; the remaining
elements are zero.

See also "lower".

# values
Output:     column vector
Argument:   x (series or vector)

Returns a vector containing the distinct elements of x sorted in ascending
order. If you wish to truncate the values to integers before applying this
function, use the expression values(int(x)).

See also "dsort", "sort".

# var
Output:     scalar or series
Argument:   x (series or list)

If x is a series, returns the (scalar) sample variance, skipping any missing
observations.

If x is a list, returns a series y such that y_t is the sample variance of
the values of the variables in the list at observation t, or NA if there are
any missing values at t.

In each case the sum of squared deviations from the mean is divided by (n -
1) for n > 1. Otherwise the variance is given as zero if n = 1, or as NA if
n = 0.

See also "sd".

# varname
Output:     string
Argument:   i (scalar)

Returns the name of the variable with ID number i, or generates an error if
there is no such variable.

# varnum
Output:     scalar
Argument:   varname (string)

Returns the ID number of the variable called varname, or NA is there is no
such variable.

# vec
Output:     column vector
Argument:   X (matrix)

Stacks the columns of X as a column vector. See also "mshape", "unvech",
"vech".

# vech
Output:     column vector
Argument:   A (square matrix)

Returns in a column vector the elements of A on and above the diagonal.
Typically, this function is used on symmetric matrices; in this case, it can
be undone by the function "unvech". See also "vec".

# wmean
Output:     series
Arguments:  Y (list)
            W (list)

Returns a series y such that y_t is the weighted mean of the values of the
variables in list Y at observation t, the respective weights given by the
values of the variables in list W at t. The weights can therefore be
time-varying. The lists Y and W must be of the same length and the weights
must be non-negative.

See also "wsd", "wvar".

# wsd
Output:     series
Arguments:  Y (list)
            W (list)

Returns a series y such that y_t is the weighted sample standard deviation
of the values of the variables in list Y at observation t, the respective
weights given by the values of the variables in list W at t. The weights can
therefore be time-varying. The lists Y and W must be of the same length and
the weights must be non-negative.

See also "wmean", "wvar".

# wvar
Output:     series
Arguments:  X (list)
            W (list)

Returns a series y such that y_t is the weighted sample variance of the
values of the variables in list X at observation t, the respective weights
given by the values of the variables in list W at t. The weights can
therefore be time-varying. The lists Y and W must be of the same length and
the weights must be non-negative.

See also "wmean", "wsd".

# xpx
Output:     list
Argument:   L (list)

Returns a list that references the squares and cross-products of the
variables in list L. Squares are named on the pattern sq_varname and
cross-products on the pattern var1_var2. The input variable names are
truncated if need be, and the output names may be adjusted in case of
duplication of names in the returned list.

# zeromiss
Output:     same type as input
Argument:   x (scalar or series)

Converts zeros to NAs. If x is a series, the conversion is done element by
element. See also "missing", "misszero", "ok".

# zeros
Output:     matrix
Arguments:  r (scalar)
            c (scalar)

Outputs a zero matrix with r rows and c columns. See also "ones", "seq".

