Contents Index Summary Citation Doornik

Ox Function Reference

Contents:

acf
acos
any
va
arma0
armaforc
armagen
armavar
asin
atan
bessel
betafunc
binand
binor
cabs
cdiv
ceil
choleski
cmul
columns
constant
correlation
cos
cosh
countc
countr
csqrt
cumprod
cumsum
cumulate
date
decldl
decldlband
declu
decsvd
deletec
deleter
deleteifc
deleteifr
densbeta
denschi
densf
densgamma
densmises
densn
denst
determinant
diag
diagonal
diagonalize
diff0
diff0pow
double
eigen
eigensym
eprint
exit
exp
fabs
fclose
feof
fft
floor
fmod
fopen
format
fprint
fread
fscan
fsize
fseek
fuzziness
fwrite
gammafunc
idiv
imod
int
invert
inverteps
invertsym
isarray
isclass
isdotfeq
isdotnan
isdouble
isfeq
a
ismatrix
isnan
lag0
limits
loadmat
log
log10
logdet
loggamma
lower
matrix
max
MaxBFGS
MaxControl
MaxControlEps
MaxConvergenceMsg
MaxSimplex
meanc
meanr
min
nullspace
Num1Derivative
Num2Derivative
NumJacobian
ols2c
ols2r
olsc
olsr
ones
oxversion
pacf
periodogram
polydiv
polygamma
polymake
polymul
polyroots
print
probbeta
probchi
probf
probgamma
probmises
probn
probt
prodc
prodr
quanbeta
quanchi
quanf
quangamma
quanmises
quann
quant
quantilec
quantiler
ranbeta
ranbinomial
ranchi
ranexp
ranf
rangamma
range
rank
ranmises
rann
ranpoisson
ranseed
rant
ranu
reflect
reshape
reversec
reverser
round
rows
savemat
scan
selectc
selectr
selectifc
selectifr
setdiagonal
setlower
setupper
shape
sin
sinh
sizeof
solveldl
solveldlband
solvelu
solvetoeplitz
sortbyc
sortbyr
sortc
sortr
spikes
spline
sprint
sprintbuffer
sqr
sqrt
sscan
standardize
strfind
string
strlwr
strupr
submat
sumc
sumr
sumsqrc
sumsqrr
tailchi
tailf
tailn
tailt
tan
tanh
thinc
thinr
time
timer
timespan
toeplitz
trace
trunc
truncf
unit
upper
va
varc
variance
varr
vec
vech
vecindex
vecr
zeros

Tables:

Formatting types for scanning
Formatting flags for doubles and integers
Formatting types for printing


acf

acf(const ma, const ilag);
ma
in: arithmetic type, T x n matrix
ilag
in: int, the highest lag, if >= T then T-1 is used
Return value
Returns a (ilag+1) by n matrix with the autocorrelation function of the columns of ma up to lag ilag. Returns 0 if ilag <= 0. If any variance is <= 1e-20, then the corresponding autocorrelations are set to 0.
See also
DrawCorrelogram, pacf


acos

acos(const ma);
ma
in: arithmetic type
Return value
Returns the arccosine of ma, of double or matrix type.
See also
asin, atan, cos, cosh, sin, sinh, tan, tanh


any

any(const ma);
ma
in: arithmetic type
Return value
Returns TRUE if any element of ma is TRUE, of integer type.
See also
equality expressions


arglist

arglist();
Return value
Returns an array of strings holding the command line arguments passed to the Ox program. The first entry is always "Ox".
Example
Running the following program as oxlw prog.ox a 12 c (the arguments before prog.ox are passed to oxlw, those after to prog.ox) #include <oxstd.h> main() { decl args = arglist(), s, i, j; for (i = 0; i < sizeof(args); ++i) { sscan(args[i], "%d", &j); print("argument ", i, ": ", args[i], " integer value:", j, "\n"); } } will produce: argument 0: Ox integer value:0 argument 1: a integer value:0 argument 2: 12 integer value:12 argument 3: c integer value:0



arma0

arma0(const ma, const vp, const cp, const cq);
ma
in: T x n matrix A
vp
in: 1 x s matrix with AR coefficients \phi1, \phi2, ..., \phip followed by MA coefficients \theta1, \theta2, ..., \thetaq, s >= p+q
cp
in: int, no of AR coefficients (could be 0)
cq
in: int, no of MA coefficients (could be 0)
Return value
Returns the residual from applying the ARMA(p,q) filter to each column of A. The result has the same dimensions as ma. The first p rows of the return value will be zero.

For example when p = 1 and q = 2:

e0 = 0,
e1 = a1 - \phi1 a0 - \theta1 e0,
e2 = a2 - \phi1 a1 - \theta1 e1 - \theta 1 e0, etc.
See also
armagen, armaforc, armavar, diff0, diff0pow


armaforc

armaforc(const mx, const vp, const cp, const cq); armaforc(const mx, const vp, const cp, const cq, const ma); armaforc(const mx, const vp, const cp, const cq, const ma, const me);
mx
in: H x n matrix X, fixed part of forecasts
vp
in: 1 x s matrix with AR coefficients \phi1, \phi2, ..., \phip followed by MA coefficients \theta1, \theta2, ..., \thetaq, s >= p+q
cp
in: int, no of AR coefficients (could be 0)
cq
in: int, no of MA coefficients (could be 0)
ma
in: (optional argument) T x n matrix A, pre-forecast data values (default is zero)
me
in: (optional argument) T x n matrix E, pre-forecast residual values (default is zero)
Return value
Returns the forecasts from an ARMA(p,q) model as an H x n matrix. The same model is applied to each column of mx.

For example when p = 2 and q = 2:

ahat0 = x0 + \phi1 aT-1 + \phi2 aT-2 + \theta1 eT-1 + \theta2 eT-2,
ahat1 = x1 + \phi1 ahat0 + \phi2 aT-1 + \theta2 eT-1,
ahat2 = x2 + \phi1 ahat1 + \phi2 ahat0, etc.
See also
arma0, armavar, cumulate


armagen

armagen(const mx, const me, const vp, const cp, const cq);
mx
in: T x n matrix of known components X
me
in: T x n matrix of errors E
vp
in: 1 x s matrix with AR coefficients \phi1, \phi2, ..., \phip followed by MA coefficients \theta1, \theta2, ..., \thetaq, s >= p+q
cp
in: int, no of AR coefficients (could be 0)
cq
in: int, no of MA coefficients (could be 0)
Return value
Generates a an ARMA(p,q) series from an error term (me) and a mean term (mx) The result has the same dimensions as mx. The first p rows of the return value will be identical to those of mx; the recursion will be applied from the pth term onward (missing lagged errors are set to zero).

For example when p = 1 and q = 2:

a0 = x0,
a1 = x1 + \phi1 a0 + e1 + \theta1 e0,
a2 = x2 + \phi1 a1 + e2 + \theta1 e1 + \theta2 e0, etc.
See also
arma0, armaforc, armavar, cumsum, cumulate


armavar

armavar(const vp, const cp, const cq, const dvar, const ct);
vp
in: 1 x s matrix with AR coefficients \phi1, \phi2, ..., \phip followed by MA coefficients \theta1, \theta2, ..., \thetaq, s >= p+q
cp
in: int, no of AR coefficients (could be 0)
cq
in: int, no of MA coefficients (could be 0)
dvar
in: double, variance of disturbance, \sigma2 \epsilon.
ct
in: int, number of autocovariance terms required, T
Return value
Returns a 1 x T matrix with the autocovariances of the ARMA(p,q) process. Or 0 if the computations failed (e.g. when all AR coefficients are zero).
See also
arma0, pacf


asin

asin(const ma);
ma
in: arithmetic type
Return value
Returns the arcsine of ma, of double or matrix type.
See also
acos, atan, cos, cosh, sin, sinh, tan, tanh


atan

atan(const ma);
ma
in: arithmetic type
Return value
Returns the arctangent of ma, of double or matrix type.
See also
acos, asin, cos, cosh, sin, sinh, tan, tanh


betafunc

betafunc(const mx, const ma, const mb);
mx
in: x, arithmetic type
ma
in: a, arithmetic type
mb
in: b, arithmetic type
Return value
Returns the incomplete beta integral Bx(a,b). Returns 0 if a <= 0, b <= 0 or x <= 0. The accuracy is to about 10 digits. The return type is derived as follows:
See also
gammafunc, probbeta, probf, tailf


bessel

bessel(const mx, const type, const n01);
mx
in: x, arithmetic type
type
in: character, type of Bessel function: 'J', 'Y', 'I', 'K'
n01
in: integer, 0 or 1: order of Bessel function
Return value
Returns an m x n matrix, when mx is an m x n matrix, or a double when x is scalar. The following are available: J0(x), Y0(x), J1(x), Y1(x), and the modified Bessel functions I0(x), K0(x), I1(x), K1(x). The accuracy is to about 15 digits.
See also
probmises


binand, binor

binand(const ma, ...); binor(const ma, ...);
ma
in: int
...
in: additional integers
Return value
binand returns the result from and-ing all arguments (the & operator in C,C++ ). binor returns the result from or-ing all arguments (the | operator in C,C++ ).


cabs, cdiv, cmul, csqrt

cabs(const ma); cdiv(const ma, const mb); cmul(const ma, const mb); csqrt(const ma);
ma, mb
in: 2 x n matrix (first row is real part, second row imaginary part), or 1 x n matrix (real part only)
Return value
cabs returns a 1 x n matrix with the absolute value of the vector of complex numbers.

cdiv returns a 2 x n matrix with the result of the division of the two vectors of complex numbers. If both ma and mb have no imaginary part, the return value will be 1 x n.

cmul returns a 2 x n matrix with the result of the multiplication of the two vectors of complex numbers. If both ma and mb have no imaginary part, the return value will be 1 x n.

csqrt returns a 2 x n matrix with the square root of the vector of complex numbers.


ceil

ceil(const ma);
ma
in: arithmetic type
Return value
Returns the ceiling of each element of ma, of double or matrix type. The ceiling is the smallest integer larger than or equal to the argument
See also
floor, round, trunc


choleski

choleski(const ma);
ma
in: symmetric, positive definite m x m matrix A
Return value
Returns the Choleski decomposition of a symmetric positive definite matrix A: A=PP'; P is lower triangular (has zero's above the diagonal). Returns 0 if the decomposition failed.
See also
decldl, invertsym


columns

columns(const ma);
ma
in: any type
Return value
Returns an integer value with the number of columns in the argument ma:
  • m x n matrix: n;
  • string: number of characters in the string;
  • array: number of elements in the array;
  • file: number of columns in the file; (only if opened with f format, see fopen);
  • other: 0.
See also
rows


constant

constant(const dval, const r, const c);
dval
in: double
r
in: int
c
in: int
Return value
Returns an r by c matrix filled with dval.
See also
ones, unit, zeros


correlation

correlation(const ma);
ma
in: T x n matrix A
Return value
Returns a n x n matrix holding the correlation matrix of ma. If any variance is <= 1e-20, then the corresponding row and column of the correlation matrix are set to 0.
See also
acf, meanc, meanr, standardize, varc, varr, variance


cos, cosh

cos(const ma); cosh(const ma);
ma
in: arithmetic type
Return value
cos returns the cosine of ma, of double or matrix type. cosh returns the cosine hyperbolicus of ma, of double or matrix type.
See also
acos, asin, atan, cosh, sin, sinh, tan, tanh


countc

countc(const ma, const va);
ma
in: m x n matrix
va
in: 1 x q matrix
Return value
Returns a matrix r which counts of the number of elements in each column of ma which is between the corresponding values in va:
r[0][0] = # elements in column 0 of ma <= va[0][0]
r[1][0] = # elements in column 0 of ma > va[0][0] and <= va[0][1]
r[2][0] = # elements in column 0 of ma > va[0][1] and <= va[0][2]
r[q][0] = # elements in column 0 of ma > va[0][q-1]
...
r[0][1] = # elements in column 1 of ma <= va[0][0]
r[1][1] = # elements in column 1 of ma > va[0][0] and <= va[0][1]
r[2][1] = # elements in column 1 of ma > va[0][1] and <= va[0][2]
r[q][1] = # elements in column 1 of ma > va[0][q-1]
...

If ma is m x n, and va is 1 x q the returned matrix is (q+1) x n (any remaining columns of va are ignored).

See also
countr


countr

countr(const ma, const va);
ma
in: m x n matrix
va
in: 1 x q matrix
Return value
Returns a matrix r which counts of the number of elements in each row of ma which is between the corresponding values in va:
r[0][0] = # elements in row 0 of ma <= va[0][0]
r[0][1] = # elements in row 0 of ma > va[0][0] and <= va[0][1]
r[0][2] = # elements in row 0 of ma > va[0][1] and <= va[0][2]
r[0][q] = # elements in row 0 of ma > va[0][q-1]
...
r[1][0] = # elements in row 1 of ma <= va[0][0]
r[1][1] = # elements in row 1 of ma > va[0][0] and <= va[0][1]
r[1][2] = # elements in row 1 of ma > va[0][1] and <= va[0][2]
r[1][q] = # elements in row 1 of ma > va[0][q-1]
...

If ma is m x n, and va is 1 x q the returned matrix is m x (q+1) (any remaining columns of va are ignored).

See also
countc


cumprod

cumprod(const mfac); cumprod(const mfac, const cp); cumprod(const mfac, const cp, const mz);
mfac
in: T x n or 1 x n matrix of multiplication factors S
cp
in: int, autoregressive order p (optional argument; default is 1)
mstart
in: T x n or 1 x n matrix of known components Z (optional argument; default is 0)
Return value
Returns a T x n matrix with the cumulated autoregressive product. The first p rows of the return value will be identical to the sum of those in mz and mfac; the recursion will be applied from the pth term onward. If either mz or mfac is 1> x n, the same values are used for every t.

cumprod computes:

at = zt + st for t = 0,...,p-1,
at = zt + st (\phi1 at-1 x ... x \phip at-p) for t = p,...,T-1.
See also
armagen, cumsum cumulate


cumsum

cumsum(const mx, const vp); cumsum(const mx, const vp, const mstart);
mx
in: T x n matrix of known components X
vp
in: 1 x p or n x p or T x p matrix with AR coefficients \phi1, \phi2, ..., \phip
mstart
in: s x n matrix of starting values S, s >= p; (optional argument; default is mx)
Return value
Returns a T x n matrix with the cumulated autoregressive sum. The first p rows of the return value will be identical to those of mstart; the recursion will be applied from the pth term onward.

If vp is 1 x p, the same coefficients are applied to each column.

If vp is n x p, each row will have coefficients specific to each column of the recursive series.

Finally, if vp is T x p, the same coefficients are applied to each column, but the coefficients are specific to each row (time-varying coefficients).

cumsum computes:

at = st for t = 0,...,p-1,
at = xt + \phi1 at-1 ... + \phip at-p for t = p,...,T-1.
When \phi is T by p (and p is not equal to the number of columns in X), the AR coefficients are time-varying:
at = st for t = 0,...,p-1,
at = xt + \phit,1 at-1 ... + \phit,p at-p for t = p,...,T-1.
See also
armagen, cumprod cumulate


cumulate

cumulate(const ma); cumulate(const ma, const m1, ...);
ma
in: T x n matrix A
m1
in: n x n matrix, coefficients of first lags (optional argument)
...
in: n x n matrix, coefficients of lags 2, ...
Return value
Returns a T x n matrix. The simplest version returns a matrix which holds the cumulated (integrated) columns of ma. The second form cumulates (integrates) the (vector) autoregressive process with current values ma using the specified coefficient matrices. The function has a variable number of arguments, and the number of arguments determines the autoregressive order (minimum 2 arguments, which is an AR(1) process). Note that cumulate(m) corresponds to cumulate(m, unit( columns(m) )).
See also
arma0, cumsum, lag0


date

date();
Return value
A string holding the current date.
See also
time


decldl

decldl(const ma, const aml, const amd);
ma
in: symmetric, positive definite m x m matrix A
aml
in: address of variable
out: m x m lower diagonal matrix L, LDL'=A
amd
in: address of variable
out: 1 x m matrix with reciprocals of D
Return value
Returns the result of the Choleski decomposition:
  • 1: no error;
  • 0: the Choleski decomposition failed: the matrix is negative definite or the matrix is (numerically) singular.
See also
choleski, decldlband, solveldl


decldlband

decldlband(const ma, const aml, const amd);
ma
in: p x n vector specifying the Ab matrix
aml
in: address of variable
out: holds p x n lower diagonal matrix L
amd
in: address of variable
out: 1 x m matrix with reciprocals of D
Return value
Returns the result of the Choleski decomposition:
  • 1: no error;
  • 0: the Choleski decomposition failed: the matrix is negative definite or the matrix is (numerically) singular.

For example, if the original matrix has bandwidth p=3, it is stored in ma as:

0 0 [0][2] ... [m-3][m-1] 0 [0][1] [1][2] ... [m-2][m-1] [0][0] [1][1] [2][2] ... [m-1][m-1]
See also
solveldlband, solvetoeplitz


declu

declu(const ma, const aml, const amu, const amp);
ma
in: square m x m matrix A
aml
in: address of variable
out: m x m matrix lower diagonal matrix L, has ones on the diagonal
amu
in: address of variable
out: m x m matrix upper diagonal matrix U, LU=PA
amp
in: address of variable
out: 2 x m matrix, the first row holds the permutation matrix P', A=(LU)[P'][], the second row holds the interchange permutations
Return value
Returns the result of the LU decomposition:
  • 1: no error;
  • 2: the decomposition could be unreliable;
  • 0: the LU decomposition failed: the matrix is (numerically) singular.
See also
determinant, invert, solvelu


decsvd

decsvd(const ma, const amu, const amw); decsvd(const ma, const amu, const amw, const amv);
ma
in: m x n matrix A, m >= n
amu
in: address of variable
out: m x n matrix U, U'U = In
amw
in: address of variable
out: 1 x n matrix with diagonal of W
amv
in: (optional argument) address of variable
out: if not 0 on input: n x n matrix V, UWV'=A, V'V = In
Return value
Returns the result of the singular value decomposition:
  • 0: no error;
  • k: if the k-th singular value (with index k-1) has not been determined after 50 iterations.

Note that the singular values are in decreasing order, with the columns of U,V sorted accordingly.

See also multiplicative expressions


deletec, deleter, deleteifc, deleteifr

deletec(const ma); deletec(const ma, const mval); deleter(const ma); deleter(const ma, const mval); deleteifc(const ma, const mifc); deleteifr(const ma, const mifr);
ma
in: m x n matrix to delete from
mval
in: p x q matrix with values to use for deletion
mifc
in: p x n matrix specifying columns to delete
mifr
in: m x q matrix specifying rows to delete
Return value
The deletec function with one argument returns an m x s matrix, deleting columns from ma which have a missing value (NaN: not a number).
The deleter function with one argument returns an s x n matrix, deleting rows from ma which have a missing value (NaN).
The remaining forms expect matrices without missing values.
The deletec function with two arguments returns an m x s matrix, deleting the columns from ma which have at least one element in the matrix mval.
The deleter function with two arguments returns an s x n matrix, deleting the rows from ma which have at least one element in the matrix mval.
The deleteifc function returns an m x s matrix, deleting only those columns from ma which have at least one non-zero element in the corresponding column of mifc.
The deleteifr function returns an s x n matrix, deleting only those rows from ma which have at least one non-zero element in the corresponding row of mifr.
All functions return an integer 0 if the deletion is empty.
See also
selectc, selectr, selectifc, selectifr, isdotnan, vecindex


densbeta, denschi, densf, densgamma, densmises, densn, denst

densbeta(const ma, const a, const b); denschi(const ma, const df); densf(const ma, const df1, const df2); densgamma(const ma, const dr, const da); densmises(const ma, const mu, const kappa); densn(const ma); denst(const ma, const idf);
ma
in: arithmetic type
a,b
in: arithmetic type, arguments for Beta distribution
df
in: arithmetic type, degrees of freedom
df1
in: arithmetic type, degrees of freedom in the numerator
df2
in: arithmetic type, degrees of freedom in the denominator
dr
in: arithmetic type
da
in: arithmetic type
idf
in: int, degrees of freedom
mu
in: arithmetic type, mean direction
kappa
in: arithmetic type, dispersion parameter
Return value
Returns the requested density at ma (the returned densities are between positive):
  • densbeta: Beta(a,b) density,
  • denschi: chi2(df) density,
  • densf: F(df1, df2) density,
  • densgamma: Gamma(r, a) density,
  • densmises: VM(mu, kappa) density (von Mises),
  • densn: standard normal density,
  • denst: student-t(df) density.
The return type is derived as follows:
  • m x n matrix, when ma is an m x n matrix, and the rest is scalar (int for denst);
  • m x n matrix, when ma is a scalar, and the rest are m x n matrices;
  • m x n matrix, when ma is an m x n matrix, and the rest are m x n matrices;
  • double, when ma is scalar, and the rest is also scalar (int for denst).
See also
prob..., quan..., tail...


determinant

determinant(const ma);
ma
in: m x m matrix
Return value
Returns the determinant of ma. Return type is double.
See also
declu, invert, logdet


diag

diag(const ma);
ma
in: double, or m x 1 or 1 x m matrix
Return value
Returns a m x m matrix with ma on the diagonal.
See also
diagonal, diagonalize, toeplitz


diagonal

diagonal(const ma);
ma
in: arithmetic type
Return value
A matrix with the diagonal from the specified matrix in the first row. Note that the diagonal is returned as a row vector, not a column. If ma is m x n, the returned matrix is min(m,n) by min(m,n); if ma is scalar, the returned matrix is 1 x 1.
See also
diag, diagonalize, setdiagonal


diagonalize

diagonalize(const ma);
ma
in: arithmetic type
Return value
Returns a matrix with the diagonal of ma on its diagonal, and zeros in off-diagonal elements. If ma is m x n, the returned matrix is m x n; if ma is scalar, the returned matrix is 1 x 1.
See also
diag, diagonal, setdiagonal


diff0

diff0(const ma, const ia); diff0(const ma, const ia, const dmisval);
ma
in: T x n matrix A
ilag
in: int, lag length of difference
dmisval
in: (optional argument) double, value to set missing observations to (default is 0)
Return value
Returns a T x n matrix with the ilagth difference of the specified matrix, whereby missing values are replaced by zero. The result has the same dimensions as ma.
See also
lag0, diff0pow


diff0pow

diff0pow(const ma, const d); diff0pow(const ma, const d, const dmisval);
ma
in: T x n matrix A
d
in: double, length of difference d, |d| <= 10000
dmisval
in: (optional argument) double, value to set missing observations to (default is 0)
Return value
Returns a T x n matrix with (1-L)dA. The result has the same dimensions as ma.
See also
arma0, diff0


double

double(const ma);
ma
in: arithmetic type
Return value
Casts the argument to a double:
  • integer: converted to a double;
  • double: unchanged;
  • matrix: element 0,0;
  • string: element 0 as a double;
  • other types: error.
See also
int, matrix explicit type conversion


eigen, eigensym

eigen(const ma, const amval); eigen(const ma, const amval, const amvec); eigensym(const ms, const amsval); eigensym(const ms, const amsval, const amsvec);
ma
in: m x m matrix A
amval
in: address of variable
out: 2 x m matrix with eigenvalues of A first row is real part, second row imaginary part The eigenvalues are not sorted.
amvec
in: address of variable
out: n x m matrix with eigenvectors of A in columns
ms
in: symmetric m x m matrix As
amsval
in: address of variable
out: 1 x m matrix with eigenvalues of As, sorted in decreasing order
amsvec
in: address of variable
out: n x m matrix with eigenvectors of As in columns
Return value
Solves the general eigenproblem Ax = \lambda Bx. returning the result of the eigenvalue decomposition:
  • 0: no error;
  • 1: maximum no of iterations (50) reached.
See also
decldl, eigensym


eprint

eprint(const a, ...);
a
in: any type
...
in: any type
Return value
Returns the number of arguments supplied to the function. Prints to stderr. See print for a further description.
See also
fprint, print, sprint


exit

exit(const iexit);
ma
in: integer, exit code
No return value.
Exits Ox, with the specified exit code.

exp

exp(const ma);
ma
in: arithmetic type
Return value
Returns the exponent of each element of ma, of double or matrix type.
See also
log


fabs

fabs(const ma);
ma
in: int, double, matrix
Return value
Returns the absolute value of each element of ma, of the same type as ma.


fclose

fclose(const file);
file
in: an open file which is to be closed
Return value
Returns 0.
See also
fopen


feof

feof(const file);
file
in: an open file
Return value
Checks for end of file; returns 0 if not at end of file, a non-zero value otherwise.


fft

fft(const ma); fft(const ma, const inverse);
ma
in: 2 x n matrix (first row is real part, second row imaginary part), or 1 x n matrix (real part only, imaginary part is zero)
inverse
in: (optional argument), int: if equal to 1 a inverse FFT is done
Return value
If only one argument is used, the return value is a 2 x s matrix which holds the Fourier transform; s is the smallest power of 2 which is >= n.

If inverse equals 1, the return value is a 2 x s matrix which holds the inverse Fourier transform; s is the smallest power of 2 which is >= n.


floor

floor(const ma);
ma
in: arithmetic type
Return value
Returns the floor of each element of ma, of double or matrix type. The floor is the largest integer less than or equal to the argument.
See also
ceil, round, trunc


fmod

fmod(const da, const db);
ma
in: arithmetic type
mb
in: arithmetic type
Return value
Returns the floating point remainder of ma / mb. The sign of the result is that of ma. The return type is double if both ma and mb are int or double. If ma is a matrix, the return type is a matrix of the same size, holding the floating point remainders ma[i][j] / db, etc. The return type is derived as follows:
  • m x n matrix, when ma is an m x n matrix, and mb is scalar;
  • m x n matrix, when ma is a scalar, and mb is an m x n matrix;
  • m x n matrix, when ma is an m x n matrix, and mb is an m x n matrix;
  • double, when ma and mb are scalar.
See also
imod


fopen

fopen(const filename); fopen(const filename, const smode);
filename
in: name of file to open
smode
in: text with open mode
Return value
Returns the opened file if successful, otherwise the value 0.
Description
Opens a file. The first form, without the smode argument opens a file for reading (equivalent to using "r"). The smode argument can be:
  • "w" open for writing;
  • "a" open for appending;
  • "r" open for reading;

In addition, the following letters can be used in the smode argument:

b
Opens the file in binary mode. This makes a difference under MS-DOS and Windows, but only for the treatment of end-of-line characters. Binary leaves a \n as \n, whereas non-binary translates \n to \r\n on output (and vice versa on input). On Windows/MS-DOS systems, it is customary to open text files without the b, and binary files (when using fread and fwrite) with the b.
f
When the file has a .fmt extension, and the letter f is appended to the format (as e.g. "rbf"), the matrix file is opened in formatted mode. In that case, reading and writing can occur by blocks of rows. When writing, the file must be explicitly closed through a call to fclose.
e
Forces the file reading and writing (using fread and fwrite) to be in little-endian mode. This allows Ox on Unix (not Linux on Intel) to handle files which use the MS-DOS byte ordering (which is little-endian).
E
Forces the file reading and writing (using fread and fwrite) to be in big-endian mode. This allows Ox on Windows/MS-DOS to handle files which use the Unix (not Linux on Intel) byte ordering (which is big-endian).
See also
fclose, fprint, fread, fscan, fseek, fwrite


format

format(const sfmt);
sfmt
in: string: new default format for double or int
int: new line length for matrix printing
No return value.
Description
Use this function to specify the default format for double and int types. The function automatically recognizes whether the format string is for int or double (otherwise it is ignored). The specified double format will also be used for printing matrices. See under the print function for a complete description of the formatting strings. Use an integer argument to set the line length for matrix printing (default is 80, the maximum is 1024). The default format strings are:
  • int: "%d"
  • double: "%g"
  • matrix: each element "%#12.5g", 6 elements on a line (depending on the line length).
See also
fprint, print, sprint


fprint

fprint(const file, const a, ...);
file
in: file which is open for writing
a
in: any type
...
in: any type
Return value
Returns the number of arguments supplied to the function. Prints to the specified file, see print for a further description.


fread

fread(const file, const am); fread(const file, const am, const type); fread(const file, const am, const type, const r); fread(const file, const am, const type, const r,const c);
file
in: file which is open for writing
am
in: address, address for storing read item
type
in: (optional argument), type of object to read, see below
r
in: (optional argument), number of rows to read; default is 1 if argument is omitted
c
in: (optional argument), number of columns to read; default is 1 if argument is omitted, unless file is opened with f, in which case the number of columns is read from the file
Return value
Returns an integer:
-1 nothing read, because end-of-file was reached;
0 nothing read, unknown error;
>0 object read, return value is size which was actually read:
  • type: 'i', 'd', reads: integer, returns: 1;
  • type: 'e', 'f', reads: double, returns: 1 (r and c omitted, or both equal to 1);
  • type: 'e', 'f', reads: matrix, returns: r x c;
  • type: 'e', 'f', reads: matrix, returns: r (number of complete columns read; file opened with f in format);
  • type: 'c', reads: integer, returns: 1 (r=1: just one byte read);
  • type: 'c', reads: string, returns: r (r>1: r bytes read).
When reading a matrix, for example as fread(file,&x,'f',r,c), the size of x will always be r by c. If less than rc elements could be read, the matrix is padded with zeros. If no elements could be read at all, because the end of the file was reached, the return value is -1.
Description
Reads binary data from the specified file. The byte ordering is the platform specific ordering, unless the f format was used (also see fopen and fwrite).
See also
fclose, fopen, fscan, fseek, fwrite


fscan

fscan(const file, const a, ...);
file
in: file which is open for writing
a
in: any type
...
in: any type
Return value
Returns the number of arguments successfully scanned and assigned, or -1 when the end of the file was encountered and nothing was read.
Description
Reads text from a file. The arguments are a list of scanning strings and the addresses of variables. A scanning string consists of text, optionally with a format specifier which starts with a % symbol. The string is truncated after the format. Any text which preceeds the format, is skipped in the file. A space character will skip any white space in the file. If the scanning string holds a format (and assignment is not suppressed in the format), the string must be followed by the address of a variable. The format specification is similar to that for the scanf function of the C language:

%[* or #][width]type

The width argument specifies the width of the input field. A * suppresses assignment. A # can only be used with m and M.


Table std.1: Formatting types for scanning

double type: e,f,g field is scanned as a double value, le,lf,lg field is scanned as a double value, integer type: d signed decimal notation, i signed decimal notation, o unsigned octal notation, x unsigned hexadecimal notation, u unsigned decimal notation, c (no width) scan a single character (i.e. one byte), string type: s scan a string up to the next white space, z scan a whole line, c (width &gt; 1) scan a number of characters, matrix type: m,M scan a matrix row by row.
Notes:
  • The "%m" and "%M" formats can be used to read a matrix from a file. They first read the number of rows and columns, and then the matrix row by row; this corresponds to the format used by loadmatloadmat. No dimensions are read by "%#m" and "%#M", in that case the scanning string has to be followed by two integers indicating the number of rows and columns to be read.
  • The "%z" format reads a whole line up to \n, the \n (and \r) are removed from the return value. The line can be up to 2048 characters long (or whatever buffer size is set with sprintbuffer). If the line in the file is too long, the remainder is skipped. When scanning a string, the maximum string length which can be read is 2048. The sprintbuffer function can be used to enlarge the buffer size.
See also
fprint, fread, scan, sscan


fseek

fseek(const file); fseek(const file, const type); fseek(const file, const type, const r);
file
in: file which is open for writing
type
in: (optional argument), type of object use in seeking, see below
r
in: (optional argument), number of rows to read; default is 1 if argument is omitted
Return value
The first form, with only the file argument, tells the current position in the file as an offset from that start of the file (as the standard C function ftell. The second and third form return 0 if the seek was successful, else a non-zero number,
Description
Repositions the file pointer. The type argument is interpreted as follows:
  • type: 'i', 'd', seeks: integer, byte equivalent: 4r;
  • type: 'e', 'f', seeks: double, byte equivalent: 8r;
  • type: 'e', 'f', seeks: matrix rows, byte equivalent: 16+8rc (file opened with f in format);
  • type: 'c', seeks: character, byte equivalent: r.

So when a file is opened as "rbf", fseek(file, 'f', r) moves the file pointer to row r in the .fmt file.

See also
fclose, fopen


fsize

fsize(const file);
file
in: an open file
Return value
Returns the size of the file in bytes (an integer).


fwrite

fwrite(const file, const a);
file
in: file which is open for writing
a
in: int, double, matrix or string
Return value
Returns 0 if failed to write, or the number of items written to the file:
  • integer: 1;
  • double: 1;
  • m x n matrix: number of elements written (normally m x n);
  • m x n matrix: opened with f format: no of rows written (normally m);
  • string: number of characters written.
Description
Writes binary data to the specified file. The byte ordering is the platform specific ordering, unless the f format was used (also see fopen), in which case writing is to a .fmt file in little endian mode (also see savemat). When data is written to a .fmt file, the number of columns must match that already in the file (use columns(file) to ask for the number of columns in the file).
See also
fclose, fopen, fread, fseek


fuzziness

fuzziness(const deps);
deps
in: double, 0 or new fuzziness value
Return value
Sets and returns the new fuzziness parameter if deps >0. If deps <= 0, no new fuzziness value is set, but the current one is returned. The default fuzziness is 1e-15.
See also
isfeq


gammafunc

gammafunc(const dx, const dr);
mx
in: x, arithmetic type
mr
in: r, arithmetic type
Return value
Returns the incomplete gamma function Gx(r). Returns 0 if r <= 0 or x <= 0. The accuracy is to about 10 digits. The return type is derived as follows:
  • m x n matrix, when mx is an m x n matrix, and mr is scalar;
  • m x n matrix, when mx is a scalar, and mr is an m x n matrix;
  • m x n matrix, when mx is an m x n matrix, and mr is an m x n matrix;
  • double, when mx and mx are scalar.


idiv, imod

idiv(const ia, const ib); imod(const ia, const ib);
ia
in: int
ib
in: int
Return value
The imod function returns the integer remainder of int(ia) / int(ib). The sign of the result is that of ia. The return type is int. The idiv function returns the result of the integer division int(ia) / int(ib). The return type is int.
See also
fmod


int

int(const ma);
ma
in: arithmetic type
Return value
Casts the argument to an integer:
  • integer: unchanged;
  • double: rounded towards zero;
  • matrix: element 0,0 rounded towards zero;
  • string: element 0;
  • other types: error.
See also
ceil, double , matrix , trunc, explicit type conversion


invert, invertsym

invert(const ma); invert(const ma, const alogdet, const asign); invertsym(const mas);
ma
in: m x m real matrix A
alogdet
in: (optional argument) address of variable
out: double, the logarithm of the absolute value of the determinant of A
asign
in: (optional argument) address of variable
>out: int , the sign of the determinant of A; 0: singular; -1,-2: negative determinant; +1,+2: positive determinant; -2,+2: result is unreliable
mas
in: symmetric, positive definite m x m matrix As
Return value
Returns the inverse of A, or the value 0 if the decomposition failed.
See also
decldl, declu, logdet


inverteps

inverteps(const dEps);
dEps
in: sets the inversion epsilon epsinv to dEps if dEps > 0, to the default if dEps < 0; leaves the value unchanged if dEps == 0
Return value
Returns the inversion epsilon (the new value if dEps != 0).


isarray, isclass, isdouble, isfile, isfunction, ismatrix

isarray(const a); isclass(const a); isdouble(const a); isfile(const a); isfunction(const a); isint(const a); ismatrix(const a); isstring(const a);
a
in: any type
Return value
Returns TRUE (i.e. the value 1) if the argument is of the correct type, FALSE (0) otherwise.


isdotfeq, isfeq

isdotfeq(const ma, const mb); isfeq(const ma, const mb);
ma
in: arithmetic type
mb
in: arithmetic type
Return value
isfeq always returns an integer: it returns 1 if the argument ma is fuzzy equal to mb, 0 otherwise.

isdotfeq returns a matrix if either argument is a matrix; the matrix consists of 0's and 1's: 1 if the comparison holds, 0 otherwise. If both arguments are scalar, isdotfeq is equal to isfeq. In both cases the current fuzziness value is used.

See also
fuzziness


isdotnan, isnan

isdotnan(const ma); isnan(const ma);
ma
in: arithmetic type
Return value
isnan always returns an integer: it returns 1 if {\em any} element in ma is a NaN (not a number), 0 otherwise. NaN can be used to indicate a missing value.
isdotnan returns a matrix of the same dimensions if the input is a matrix; the returned matrix consists of 0's and 1's: 1 if the element is NaN, 0 otherwise. If the arguments is a double, isdotnan returns 1 if the double is NaN.
See also
deletec, deleter, selectc, selectr


lag0

lag0(const ma, const ia); lag0(const ma, const ia, double dmisval);
ma
in: T x n matrix
ia
in: int
dmisval
in: (optional argument) double, value to set missing observations to (default is 0)
Return value
Returns the lags of the specified matrix, whereby missing values are replaced by zero. The result has the same dimensions as ma.
See also
diff0


limits

limits(const ma);
ma
in: m x n matrix
Return value
Returns a 4 x n matrix:
  • 1st row: minimum of each column of ma;
  • 2nd row: maximum of each column of ma;
  • 3rd row: row index of minimum (lowest index if more than one exists);
  • 4th row: row index of maximum (lowest index if more than one exists).
See also
min, max, spikes


loadmat

loadmat(const sname); loadmat(const sname, const iFormat);
sname
in: string containing an existing file name
iFormat
in: (optional argument, .mat matrix file only) 1: file has no matrix dimensions; then the matrix is returned as a column vector, and shape could be used to create a differently shaped matrix.
Return value
Returns the matrix which was read, or 0 if the operation failed.
Description
The type of file read depends on the extension of the file name:
  • .mat: ASCII matrix file, described below,
  • .dat: ASCII data file with load information,
  • .in7: PcGive 7 data file (with corresponding .bn7: file),
  • .xls: Excel version 4 spread sheet file,
  • .wks and .wk1: Lotus spread sheet file,
  • .dht: Gauss data file (with corresponding .dat: file),
  • .fmt: Gauss matrix file;
  • any other: as :.mat: file. A matrix file holds a matrix, preceded by two integers which specify the number of rows and columns of the matrix.
A matrix file holds a matrix, preceded by two integers which specify the number of rows and columns of the matrix. It will normally have the {\tt .mat} extension. If a symbol is found which is not a number, then the rest of the line will be skipped (so, e.g. everything following ; or // is treated as comments). The exception to this is an isolated dot, or the letter m or M. These are interpreted as a missing element with value NaN (Not a Number).
See also
Database class, savemat, shape


log, log10

log(const ma); log10(const ma);
ma
in: arithmetic type
Return value
The log function returns the natural logarithm of each element of ma, of double or matrix type.

The log10 function returns the logarithm (base 10) of each element of ma, of double or matrix type.

See also
exp


logdet

logdet(const ma, const asign);
ma
in: m x m real matrix A
asign
in: address of variable
>out: int, the sign of the determinant of A; 0: singular; -1,-2: negative determinant; +1,+2: positive determinant; -2,+2: result is unreliable
Return value
Returns a double: the logarithm of the absolute value of the determinant of A (1.0 if the matrix is singular).
See also
determinant, invert


loggamma

loggamma(const ma);
ma
in: arithmetic type
Return value
Returns the logarithm of the complete gamma function at the value of each element of ma, of double or matrix type. Returns zero for any argument less than or equal to zero. Note that exp(loggamma(n+1)) equals n!.
See also
gammafunc, polygamma


lower

lower(const ma);
ma
in: m x n matrix
Return value
Returns the lower diagonal (including the diagonal) of a matrix, the strict upper diagonal elements are set to zero.
See also
setdiagonal, setupper, setlower, upper


matrix

matrix(const ma);
ma
in: arithmetic type
Return value
Casts the argument to a matrix:
  • integer: a 1 x 1 matrix,
  • double: a 1 x 1 matrix,
  • matrix: unchanged,
  • string: a 1 x 1 matrix,
  • other types: error.
See also
int, double, explicit type conversion


max

max(const a, ...);
a
in: arithmetic type
...
in: arithmetic type
Return value
Returns the maximum value in all the arguments. The return type is int if all arguments are of type int; otherwise the return type is double.
See also
limits, min


MaxBFGS

#include <maximize.h> MaxBFGS(const func, const avP, const adFunc, const amHessian, const fNumDer);
func
in: a function computing the function value, optionally with derivatives
avP
in: address of p x 1 matrix with starting values
out: p x 1 matrix with final coefficients
adFunc
in: address
out: double, final function value
amHessian
in: address of p x p matrix, initial quasi-Hessian; a possible starting value is the identity matrix
out: final quasi-Hessian (not reliable as estimate of actual Hessian)
fNumDer
in: 0: func provides analytical first derivatives 1: use numerical first derivatives
The supplied func argument should have the following format:
func(const vP, const adFunc, const avScore, const amHessian);
vP
in: p x 1 matrix with coefficients
adFunc
in: address
out: double, function value at vP
avScore
in: 0, or an address
out: if !0 on input: p x 1 matrix with first derivatives at vP
amHessian
in: always 0 for MaxBFGS, as it does not need the Hessian;
returns
1: successful, 0: function evaluation failed

Return value
Returns the status of the iterative process:
MAX_CONV
Strong convergence Both convergence tests were passed, using tolerance eps = eps1.
MAX_WEAK_CONV
Failed to improve in line search: weak convergence The step length si has become too small. The convergence test ) was passed, using tolerance eps = eps2.
MAX_MAXIT
Maximum number of iterations reached: no convergence!
MAX_LINE_FAIL
Failed to improve in line search: no convergence! The step length si has become too small. The convergence test was not passed, using tolerance eps = eps2.
MAX_FUNC_FAIL
Function evaluation failed: no convergence!

The chosen default values for the tolerances are:

eps1=1e-4, eps2=5e-3.

See also
MaxControl, MaxConvergenceMsg, Num1Derivative, Num2Derivative


MaxControl, MaxControlEps

#include <maximize.h> MaxControl(const mxIter, const iPrint); MaxControlEps(const dEps1, const dEps2);
mxIter
in: int, maximum number of iterations; default is 1000, use -1 to leave the current value unchanged
dEps1
in: double, eps1, default is 1e-4
dEps2
in: double, eps2, default is 5e-3
iPrint
in: int, print results every iPrint'th iteration; default is 0, use -1 to leave the current value unchanged
Return value
No return value.
See also
MaxBFGS, MaxSimplex


MaxConvergenceMsg

#include <maximize.h> MaxConvergenceMsg(const iCode);
iCode
in: int, code returned by MaxBFGS or MaxSimplex
Return value
Returns the text corresponding to the convergence code listed under the return values of MaxBFGS.
See also
MaxBFGS, MaxSimplex


MaxSimplex

#include <maximize.h> MaxSimplex(const func, const avP, const adFunc, vDelta);
func
in: a function computing the function value
avP
in: address of p x 1 matrix with starting values
out: p x 1 matrix with coefficients at convergence
adFunc
in: address
out: double, function value at convergence
vDelta
in: 0, or the initial simplex

The supplied func argument should have the same format as in MaxBFGS.

Return value
Returns the status of the iterative process, as documented under MaxBFGS.


meanc, meanr

meanc(const ma); meanr(const ma);
ma
in: T x n matrix A
Return value
The meanc function returns a 1 x n matrix holding the means of the columns of ma.

The meanr function returns a T x 1 matrix holding the means of the rows of ma.

See also
sumc, sumr, varc, variance, varr


min

min(const a, ...);
a
in: arithmetic type
...
in: arithmetic type
Return value
Returns the minimum value in all the arguments. The return type is int if all arguments are of type int; otherwise the return type is double.
See also
limits, max


nullspace

nullspace(const ma);
ma
in: m x n matrix A, m >= n
Return value
Returns the null space of ma, or 0 (ma is square and full rank), -1 (SVD failed).
See also
decsvd, inverteps


Num1Derivative, Num2Derivative

#include <maximize.h> Num1Derivative(const func, vP, const avScore); Num2Derivative(const func, vP, const amHessian);
func
in: a function computing the function value, optionally with derivatives
vP
in: p x 1 matrix with parameter values
mHessian
in: p x p matrix, initial Hessian
avScore
in: an address
out: p x 1 matrix with 1st derivatives at vP
amHessian
in: an address
out: p x p matrix with 2nd derivatives at vP

The supplied func argument should have the format as documented under MaxBFGS.

Return value
Returns 1 if successful, 0 otherwise.
See also
MaxBFGS


NumJacobian

#include <maximize.h> NumJacobian(const func, vU, const amJacobian);
func
in: function mapping from restricted to unrestricted parameters
vU
in: of u x 1 matrix with parameters
amJacobian
in: address
out: r x u Jacobian matrix corresponding to mapping

The supplied func argument should have the following format:

func(const avR, const vU);
avR
in: address
out: r x 1 matrix with restricted coefficients
vU
in: u x 1 matrix with unrestricted coefficients returns 1: successful, 0: function evaluation failed
Return value
Returns 1 if successful, 0 otherwise.
See also
Num1Derivative


ols2c, ols2r, olsc, olsr

ols2c(const my, const mx, const amb); ols2c(const my, const mx, const amb, const amxtxinv); ols2c(const my, const mx, const amb, const amxtxinv, const amxtx); olsc(const my, const mx, const amb); olsc(const my, const mx, const amb, const amxtxinv); olsc(const my, const mx, const amb, const amxtxinv, const amxtx);
my
in: T x n matrix Y
mx
in: T x k matrix X
amb
in: address of variable
out: k x n matrix of OLS coefficients, B
amxtxinv
in: (optional argument) address of variable
out: k x k matrix (X'X)-1,
amxtx
in: (optional argument) address of variable
out: k x k matrix (X'X),
ols2r(const my, const mx, const amb); ols2r(const my, const mx, const amb, const amxtxinv); ols2r(const my, const mx, const amb, const amxtxinv, const amxtx); olsr(const my, const mx, const amb); olsr(const my, const mx, const amb, const amxtxinv); olsr(const my, const mx, const amb, const amxtxinv, const amxtx);
my
in: n x T matrix Y'
mx
in: k x T matrix X', T >= k
amb
in: address of variable
out: n x k OLS coefficient matrix, B'
amxtxinv
in: (optional argument) address of variable
out: k x k matrix (X'X)-1,
amxtx
in: (optional argument) address of variable
out: k x k matrix (X'X),
Return value
  • 0: out of memory,
  • 1: success,
  • 2: ratio of diagonal elements of X'X is large, rescaling is advised,
  • -1: (X'X) is (numerically) singular,
  • -2: combines 2 and -1.


ones

ones(const r, const c);
r
in: int
c
in: int
Return value
Returns an r by c matrix filled with ones.
See also
constant, unit, zeros


oxversion

oxversion();
Return value
Returns an integer with the version of Ox multiplied by 100. So for version 1.10 the return value is 110.


pacf

pacf(const macf);
macf
in: arithmetic type, (m+1) x n matrix of autocovariances or autocorrelations
Return value
Returns a m x n matrix with the partial autocorrelation function of the columns of macf. Returns 0 if the computations fail (the stochastic process has a root on the unit circle).
See also
acf, armavar


periodogram

periodogram(const ma, const itrunc, const cpoints, const imode);
ma
in: arithmetic type, T x n matrix
itrunc
in: int, truncation parameter m, if >= T then T-1 is used
cpoints
in: int, no of points N at which to evaluate periodogram, resulting in evaluation at frequencies: 0, \pi/(N-1), ..., \pi.
imode
in: 0: (truncated) periodogram, 1: smoothed periodogram using Parzen window, 2: estimated spectral density using Parzen window (as option 1, but divided by c0).
Return value
Returns a (cpoints) by n matrix with the periodogram of the columns of ma using autocovariances up to lag itrunc. Returns 0 if ilag <= 0.
See also
DrawSpectrum.


polydiv

polydiv(const ma, const mb, const cp);
ma
in: 1 x m matrix A = (a0 ... am-1) specifying the A polynomial (see below)
mb
in: 1 x n matrix B = (b0 ... bn-1) specifying the B polynomial (see below)
cp
in: int, required length, p, of polynomial resulting from division
Return value
Returns a 1 x p matrix with the coefficients of polynomial resulting from dividing the A polynomial by the B polynomial. The integer 0 is returned when b0 is 0, or p=0.
See also
polymake, polymul, polyroots


polygamma

polygamma(const ma, const mn);
ma
in: arithmetic type
mn
in: arithmetic type, order of derivative: 0 = first derivative, 1 = second derivative, etc.
Return value
Returns the derivative of the logarithm of the complete gamma function at the value of each element of ma, of double or matrix type. The second argument specifies the order of the derivative. Returns zero for any argument less than or equal to zero, or derivative order less than 0. The return type is derived as follows:
  • m x n matrix, when ma is an m x n matrix, and the rest is scalar (int);
  • m x n matrix, when ma is a scalar, and the rest are m x n matrices;
  • m x n matrix, when ma is an m x n matrix, and the rest are m x n matrices;
  • double, when ma is scalar, and the rest is also scalar (int).
See also
loggamma


polymake

polymake(const roots);
roots
in: 2 x m matrix with (inverse) roots of the polynomial, first row is real part, second row imaginary part (or 1 x m matrix if all roots are real).
Return value
Returns the coefficients of the polynomial (a0 = 1) as a 2 x (m+1) matrix if the roots had a complex part, else 1 x (m+1).
See also
polyroots


polymul

polymul(const ma, const mb);
ma
in: 1 x m matrix A = (a0 ... am-1) specifying the A polynomial (see below)
mb
in: 1 x n matrix B = (b0 ... bn-1) specifying the B polynomial (see below)
Return value
Returns a 1 x (m+n-1) matrix with the coefficients of the product of the polynomials.
See also
polydiv, polymake, polyroots


polyroots

polyroots(const ma, const amroots);
ma
in: 1 x (m+1) matrix A = (a0 ... am) specifying the polynomial of order m (see below)
amroots
in: address of variable
out: 2 x m matrix with roots of the polynomial first row is real part, second row imaginary part (all zeros if the roots are real). The roots are not sorted.
Return value
Returns the result of the eigenvalue decomposition:
  • 0: no error;
  • 1: maximum no of iterations (50) reached.
See also
eigen, polydiv, polymake, polymul


print

print(const a, ...);
a
in: any type
...
in: any type
Return value
Returns the number of arguments supplied to the function.
Description
Each argument is printed to stdout using default formatting. A formatting string can be input in the input stream: a formatting string starts with a % symbol, and is followed by one or more characters. If a formatting string is encountered, it is not printed, but applied to the next argument. There is an additional option to add column and row labels for a matrix:

    %r the next argument contains row labels (array of strings), %c the next argument contains column labels (array of strings).

The default format strings are:

  • no value: "null",
  • int: "%d",
  • double: "%g",
  • matrix: "\n", then each element "%#12.5g", 6 elements on a line (5 if row is labelled), no labels,
  • string: "%s",
  • array: "&0x%p",
  • function: "&%d",
  • class: "&0x%p",
  • library function: "&0x%p". The format function may be used to set a different default format; it also lists the format options.

    The format specification is similar to that for the printf function of the C language:

    %[flag][width][.precision]type


    Table std.2: Formatting flags for doubles and integers

    - left adjust in output field, + always print a sign, space prefix space if first character is not a sign 0 pad with leading zeros, # alternate output form: type is o: first digit will be 0, type is xX: prefix with 0x or 0X (unless value is 0), type is eEfgG: always print decimal point, type is gG: keep trailing zeros. type is mM: omit dimensions.

    The width argument specifies the width of the output field. The precision argument specifies the number of significant digits (type is gG) number of digits after the decimal point (type is eEf); the default is 6 if precision is absent.


    Table std.3: Formatting types for printing

    double type, also used for matrices: g,G %e or %E if the exponent is <-4 or >= precision; else use %f, e,e scientific notation: with exponent, f print without exponent, integer type: d,i signed decimal notation, o unsigned octal notation, x,X unsigned hexadecimal notation, u unsigned decimal notation, c print as a single character (i.e. one byte), string type: s string format. matrix type: m print matrix row by row using %25.26e. M print matrix row by row with the default format.
    See also
    eprint, format, fprint, fscan, fwrite, sprint

  • probbeta, probchi, probf, probgamma, probmises, probn, probt

    probbeta(const ma, const a, const b); probchi(const ma, const df); probchi(const ma, const df, const nc); probf(const ma, const df1, const df2); probgamma(const ma, const dr, const da); probmises(const ma, const mu, const kappa); probn(const ma); probt(const ma, const idf);
    ma
    in: arithmetic type
    a,b
    in: arithmetic type, arguments for Beta distribution
    df
    in: arithmetic type, degrees of freedom
    df1
    in: arithmetic type, degrees of freedom in the numerator
    df2
    in: arithmetic type, degrees of freedom in the denominator
    dr, da
    in: arithmetic type
    idf
    in: int, degrees of freedom
    mu
    in: arithmetic type, mean location (use M_PI for symmetric between 0 and 2pi)
    kappa
    in: arithmetic type, dispersion parameter
    nc
    in: arithmetic type, non-centrality parameter
    Return value
    Returns the requested probabilities at ma (the returned probabilities are between zero and one):
    • probbeta: probabilities from Beta(a,b) distribution,
    • probchi: probabilities from chi2(df) distribution,
    • probchi: probabilities from non-central chi2(df) distribution,
    • probf: probabilities from F(df1, df2) distribution,
    • probgamma: probabilities from the Gamma distribution,
    • probmises: probabilities from the VM(mu, kappa) distribution (von Mises),
    • probn: one-sided probabilities from the standard normal N(0,1),
    • probt: one-sided probabilities from student-t(df) distribution.

    The probabilities are accurate to about 10 digits. The return type is derived as follows:

    • m x n matrix, when ma is an m x n matrix, and the rest is scalar (int for probt);
    • m x n matrix, when ma is a scalar, and the rest are m x n matrices;
    • m x n matrix, when ma is an m x n matrix, and the rest are m x n matrices;
    • double, when ma is scalar, and the rest is also scalar (int for probt). Note that the von Mises distribution runs from 0 to 2pi, with mean direction mu (i.e. what tends to be written as VM(0,k) is VM(pi,k) here).
    See also
    bessel, betafunc, gammafunc, dens..., quan..., tail...


    prodc, prodr

    prodc(const ma); prodr(const ma);
    ma
    in: T x n matrix A
    Return value
    The prodc function returns a 1 x n matrix r which holds the product of all column elements of ma.

    The prodr function returns a T x 1 matrix which holds the product of all row elements of ma.

    See also
    sumc, sumr


    quanbeta, quanchi, quanf, quangamma, quanmises, quann, quant

    quanbeta(const ma, const a, const b); quanchi(const ma, const df); quanf(const ma, const df1, const df2); quangamma(const ma, const dr, const da); quanmises(const ma, const mu, const kappa); quann(const ma); quant(const ma, const idf);
    ma
    in: arithmetic type, probabilities: all values must be between 0 and 1
    a,b
    in: arithmetic type, arguments for Beta distribution
    df
    in: arithmetic type, degrees of freedom
    df1
    in: arithmetic type, degrees of freedom in the numerator
    df2
    in: arithmetic type, degrees of freedom in the denominator
    dr, da
    in: arithmetic type
    idf
    in: int, degrees of freedom
    kappa
    in: arithmetic type, dispersion parameter
    Return value
    Returns the requested quantiles (inverse probability function; percentage points) at ma:
    • quanbeta: quantiles from Beta(a,b) distribution,
    • quanchi: quantiles from chi2(df) distribution,
    • quanf: quantiles from F(df1, df2) distribution,
    • quangamma: quantiles from the Gamma distribution,
    • quanmises: quantiles from the VM(mu, kappa) distribution (von Mises),
    • quann: standard normal quantiles,
    • quant: quantiles from student-t(df) distribution.

    The quantiles are accurate to about 10 digits. The return type is derived as follows:

    • m x n matrix, when ma is an m x n matrix, and the rest is scalar (int for quant);
    • m x n matrix, when ma is a scalar, and the rest are m x n matrices;
    • m x n matrix, when ma is an m x n matrix, and the rest are m x n matrices;
    • double, when ma is scalar, and the rest is also scalar (int for quant).
    See also
    dens..., prob..., tail...


    quantilec, quantiler

    quantilec(const ma); quantiler(const ma); quantilec(const ma, const mq); quantiler(const ma, const mq);
    ma
    in: T x n matrix A
    mq
    in: (optional argument) 1 x q matrix of quantiles
    Return value
    The quantilec function returns a q x n matrix holding the requested quantiles of the columns of ma. If no second argument is used the return value is a 1 x n matrix holding the medians.

    The quantiler function returns a T x q matrix holding the requested quantiles of the rows of ma. If no second argument is used the return value is a T x 1 matrix holding the medians.

    See also
    meanc, meanr, varc, varr


    ranbeta, ranbinomial, ranchi, ranexp, ranf, rangamma, rann, ranpoisson, rant

    ranbeta(const r, const c, const a, const b); ranbinomial(const r, const c, const n, const p); ranchi(const r, const c, const df); ranexp(const r, const c, const lambda); ranf(const r, const c, const df1, const df2); rangamma(const r, const c, const dr, const da); ranmises(const r, const c, const kappa); rann(const r, const c); ranpoisson(const r, const c, const mu); rant(const r, const c, const idf);
    r
    in: int, number of rows
    c
    in: int, number of columns
    a,b
    in: arithmetic type, arguments for Beta distribution
    n
    in: int, number of trials
    p
    in: double, probability of success
    lambda
    in: double
    df
    in: double, degrees of freedom
    df1
    in: double, degrees of freedom in the numerator
    df2
    in: double, degrees of freedom in the denominator
    dr
    in: double
    da
    in: double
    mu
    in: double, mean of poisson
    idf
    in: int, degrees of freedom
    kappa
    in: arithmetic type, dispersion parameter (mean direction is pi)
    Return value
    Returns a r by c matrix of random numbers from the selected distribution:
    • ranbeta : Beta(a,b) distribution,
    • ranbinomial: Binomial(n,p) distribution,
    • ranchi : chi2(df) distribution,
    • ranexp : exp(\lambda) distribution with mean 1 / \lambda,
    • ranf : F(df1, df2) distribution,
    • rangamma : Gamma(r,a) distribution,
    • ranmises: VM(pi, kappa) distribution (von Mises),
    • rann : standard normal distribution,
    • ranpoisson : Poisson(mu) distribution,
    • rant : Student t(df) distribution.

    The matrix is filled by row. Note that, if both r and c are 1, the return value is a scalar of type double!

    The von Mises is generated between 0 and 2pi, with mean direction pi, corresponding to probmises(.,M_PI,kappa). To use a different mean:

    y = fmod(ranmises(r, c, kappa) + mu, M_2PI); M_PI and M_2PI require oxfloat.h.
    See also
    ranseed, ranu


    range

    range(const min, const max); range(const min, const max, const step);
    min
    in: int or double, first value m
    max
    in: int or double, last value n
    step
    in: int or double, (optional argument) increment
    Return value
    Returns a 1 x (n-m+1) matrix with the values with values m, m+1, ..., n. If n<<m, range returns a 1 x (n-m+1) matrix with the values with values m, m-1, ..., n. The version which uses the step argument uses that as the incrementor (rather than the default +1 or -1), the returned matrix is a row vector of the required length.
    See also
    constant


    rank

    rank(const ma);
    ma
    in: arithmetic type
    Return value
    Returns the rank of a matrix, of type int. The rank of a scalar is 1.
    See also
    decsvd, inverteps


    ranseed

    ranseed(const iseed);
    iseed
    in: int
    Return value
    Returns the current seed of the random number generator, of type int, after setting the seed to iseed. A call to ranseed(0) only returns the current seed, without changing it; ranseed(-1) resets to the initial seed and returns the initial seed.
    See also
    ran..., ranu


    ranu

    ranu(const r, const c);
    r
    in: int
    c
    in: int
    Return value
    Returns a r by c matrix of uniform random numbers. The matrix is filled by row.
    See also
    ran..., ranseed


    reflect

    reflect(const ma);
    ma
    in: square m x m matrix
    Return value
    Returns the reflected version of ma.
    See also
    transpose operator '


    reshape

    reshape(const ma, const r, const c);
    ma
    in: arithmetic type
    r
    in: int
    c
    in: int
    Return value
    Returns an r by c matrix, filled by row from vec(ma). If there are less than rc elements in ma, the input matrix is repeated.
    See also
    shape


    reversec, reverser

    reversec(const ma); reverser(const ma);
    ma
    in: m x n matrix A
    Return value
    The reversec function returns an m x n matrix which has the columns of ma in reverse order.

    The reverser function returns an m x n matrix which has the rows of ma in reverse order.

    See also
    sortc, sortr


    round

    round(const ma);
    ma
    in: arithmetic type
    Return value
    Returns the rounded elements of ma, of double or matrix type. Rounds to the nearest integer.
    See also
    ceil, floor, trunc


    rows

    rows(const ma);
    ma
    in: any type
    Return value
    Returns an integer value which is the number of rows in the argument:
    • m x n matrix: m;
    • string: number of characters in the string;
    • array: number of elements in the array;
    • file: number of columns in the file; (only if opened with f format, see fopen);
    • other: 0.
    See also
    columns


    savemat

    savemat(const sname, const ma); savemat(const sname, const ma, const iFormat);
    sname
    in: string containing an existing file name
    ma
    in: matrix
    iFormat
    in: (optional argument) 1: omit the matrix dimensions, for matrix file only.
    Return value
    Returns 0 if the operation failed, 1 otherwise.
    Description
    The type of file saved depends on the extension of the file name:
    • .mat: ASCII matrix file,
    • .dat: ASCII data file with load information,
    • .in7: PcGive 7 data file (with corresponding .bn7 file),
    • .xls: Excel version 4 spread sheet file,
    • .wks and .wk1: Lotus spread sheet file,
    • .fmt: Gauss matrix file (32 bit),
    • any other: as .mat file.
    See also
    Database class, loadmat


    scan

    scan(const a, ...);
    a
    in: any type
    ...
    in: any type
    Return value
    Returns the number of arguments successfully scanned and assigned.
    Description
    This function works as fscan, but reading from the console, not a file. Any text in the scanning string which is not an input is echoed to the console (this is different from the standard C scanf function).
    See also
    fscan, fwrite, sscan


    selectc, selectr, selectifc, selectifr

    selectc(const ma); selectc(const ma, const mval); selectr(const ma); selectr(const ma, const mval); selectifc(const ma, const mifc); selectifr(const ma, const mifr);
    ma
    in: m x n matrix to select from
    mval
    in: p x q matrix with values to use for selection
    mifc
    in: p x n matrix specifying columns to select
    mifr
    in: m x q matrix specifying rows to select
    Return value
    The selectc function with one argument returns an m x s matrix, selecting columns from ma which have a missing value (NaN: not a number).
    The selectr function with one argument returns an s x n matrix, selecting rows from ma which have a missing value (NaN).
    The remaining forms expect matrices without missing values.
    The selectc function with two arguments returns an m x s matrix, selecting the columns from ma which have at least one element in the matrix mval.
    The selectr function with two arguments returns an s x n matrix, selecting the rows from ma which have at least one element in the matrix mval.
    The selectifc function returns an m x s matrix, selecting only those columns from ma which have at least one non-zero element in the corresponding column of mifc.
    The selectifr function returns an s x n matrix, selecting only those rows from ma which have at least one non-zero element in the corresponding row of mifr.
    All functions return an integer 0 if the selection is empty.
    See also
    deletec, deleter, deleteifc, deleteifr, isdotnan, vecindex


    setdiagonal, setlower, setupper

    setdiagonal(const ma, const mdiag); setlower(const ma, const ml); setupper(const ma, const mu); setlower(const ma, const ml, const mdiag); setupper(const ma, const mu, const mdiag);
    ma
    in: m x n matrix
    mdiag
    in: 1 by min(m,n) or min(m,n) by 1 or matrix m x n matrix or scalar
    ml
    in: scalar or m x n matrix with new strict lower diagonal
    mu
    in: scalar m x n matrix with new strict upper diagonal
    Return value
    setdiagonal returns a matrix with the diagonal replaced by mdiag, which is either a vector with the new diagonal elements, or a matrix from which the diagonal is copied. If mdiag is scalar, all diagonal elements of the returned matrix have that value.

    setlower returns ma with the strict lower diagonal replaced by that of ml. setlower(ma, ml, mdiag) corresponds to setdiagonal( setlower(ma, ml), mdiag).

    setupper returns ma with the strict upper diagonal replaced by that of ml. setupper(ma, ml, mdiag) corresponds to setdiagonal( setupper(ma, ml), mdiag).

    See also
    diag, diagonal, diagonalize, lower, upper


    shape

    shape(const ma, const r, const c);
    ma
    in: arithmetic type
    r
    in: int
    c
    in: int
    Return value
    Returns an r by c matrix, filled by column from vec(ma). If there are fewer than rc elements in ma, the value 0 is used for padding.
    See also
    reshape, vec


    sin, sinh

    sin(const ma);
    ma
    in: arithmetic type
    Return value
    sin returns the sine of ma, of double or matrix type.

    sinh returns the sine hyperbolicus of ma, of double or matrix type.

    See also
    acos, asin, atan, cos, cosh, sinh, tan, tanh


    sizeof

    sizeof(const ma);
    Description
    This function is identical to rows.
    See also
    columns, rows


    solveldl

    solveldl(const ml, const md, const mb);
    ml
    in: m x m lower diagonal matrix L, LDL'=A
    md
    in: 1 x m matrix with reciprocals of D
    mb
    in: m x n matrix B, the right-hand side
    Return value
    Returns the m x n matrix X from solving AX=B.
    See also
    decldl, invertsym


    solveldlband

    solveldlband(const ml, const md, const mb);
    ml
    in: p x n vector specifying the Lb matrix
    md
    in: 1 x m matrix with reciprocals of D
    mb
    in: m x n matrix B, the right-hand side
    Return value
    Returns the m x n matrix X from solving AX=B.
    See also
    decldlband, solvetoeplitz


    solvelu

    solvelu(const ml, const mu, const mp, const mb);
    ml
    in: m x m lower diagonal matrix L
    mu
    in: m x m upper diagonal matrix U
    mp
    in: 2 x m matrix with interchange permutations in the second row
    mb
    in: m x n matrix B, the right-hand side
    Return value
    Returns the m x n matrix X from solving AX=B.
    See also
    declu, invert


    solvetoeplitz

    solvetoeplitz(const mr, const cm, const mb); solvetoeplitz(const mr, const cm, const mb, alogdet);
    mr
    in: double, or r x 1 or 1 x r matrix, specifying the positive definite (band) Toeplitz matrix
    cm
    in: dimension of complete Toeplitz matrix: m x m, m >= r
    mb
    in: m x n matrix B, the right-hand side
    alogdet
    in: (optional argument) address of variable
    out: double, the logarithm of (the absolute value of) the determinant of A
    Return value
    Returns the m x n matrix X from solving AX=B, or 0 if the Toeplitz matrix is singular.
    See also
    toeplitz


    sortbyc, sortbyr

    sortbyc(const ma, const icol); sortbyr(const ma, const irow);
    ma
    in: matrix
    icol
    in: scalar: index of column to sort, or matrix: specifying the columns to sort by.
    irow
    in: index of row to sort
    Return value
    The reordered (sorted in ascending order) matrix.
    See also
    reversec, reverser, sortc, sortr


    sortc, sortr

    sortc(const ma); sortr(const ma);
    ma
    in: arithmetic type
    Return value
    If ma is a matrix, the return value is ma with each column (sortc) or row (sortr) sorted in ascending order. If ma is scalar the return type and value are that of ma. The sorting method used is combsort.
    See also
    sortbyc, sortbyr


    spikes

    spikes(const ma, const icol);
    ma
    in: matrix
    icol
    in: scalar: index of column to find spikes of.
    Return value
    Returns a 4 x n matrix:
    • 1st row: low of each subsequent non-decreasing run,
    • 2nd row: high of each subsequent non-decreasing run,
    • 3rd row: row index of low,
    • 4th row: row index of high.
    This is computed for the specified column.
    See also
    limits, sortbyc


    spline

    spline(const my, const mx, const alpha); spline(const my, const mx, const alpha, agcv);
    my
    in: T x n matrix with variables (observations in columns) to smooth
    mx
    in: 0 for evenly spaced Y, else T x m matrix with X (where m=1: same X used for all Ys, or m=n: corresponding X is used with Y)
    alpha
    in: double, bandwidth, 0: automatic bandwidth selection using GCV, <0: absolute value is bandwidth, >0: specifies equivalent number of parameters.
    agcv
    in: (optional) address, returns GCV (generalized cross validation score) and equivalent number of parameters
    Return value
    Returns a T x n matrix with the smooth from applying the natural cubic spline. The optional agcv argument is a 2 x n matrix, with the generalized cross validation (GCV) score in the first row, and the equivalent number of parameters in the second.


    sprint

    sprint(const a, ...);
    a
    in: any type
    ...
    in: any type
    Return value
    Returns a string containing the written text, or 0 if the sprint buffer was too small (see sprintbuffer).
    Description
    Each argument is printed to a string. See print for a description of formatting; the "%m", "%M", "%#m" and "%#M" formats may not be used in sprint. The maximum text length is 2048 characters by default. The sprintbuffer function can be used to enlarge the buffer size.
    See also
    eprint, print, sprintbuffer


    sprintbuffer

    sprintbuffer(const len);
    len
    in: int
    Return value
    Returns 0 of type int.
    Description
    Sets the size of the internal sprint buffer. The default is 2048 characters, and this function is only needed if texts of more than 2048 characters will be written using sprint.
    See also
    sprint


    sqr, sqrt

    sqr(const ma); sqrt(const ma);
    ma
    in: arithmetic type
    Return value
    sqrt returns the square root of the elements of ma, of double or matrix type.

    sqr returns the square of the elements of ma. If the input to sqr is a double or matrix, the return type is a double or matrix. If the input is an integer, the return type is integer unless the result would overflow in integer computation. In that case the return type is double in order to represent the result.


    sscan

    sscan(const string, const a, ...); sscan(const astring, const a, ...);
    string
    in: string to scan from
    astring
    in: address of string to scan from, on return the scanned text has been removed from the string
    a
    in: any type
    ...
    in: any type
    Return value
    Returns the number of arguments successfully scanned and assigned. If s is a string, then sscan(s, ... will leave the string unchanged, whereas sscan(&s, ... will remove the read characters from the string.
    Description
    This function works as fscan, but reading from a string, not a file. See fscan for a description of formatting; the "%m", "%M", "%#m" and "%#M" formats may not be used in sscan.
    See also
    fscan, fwrite, scan


    standardize

    standardize(const ma);
    ma
    in: T x n matrix A
    Return value
    Returns a T x n matrix holding the standardized columns of ma. If any variance is <= 1e-20, then the corresponding column is set to 0.
    See also
    acf, standardize, meanc, meanr, varc, varr, variance


    string

    string(const ma);
    ma
    in: arithmetic type
    Return value
    Casts the argument to a string, see explicit type conversion.
    See also
    double


    strfind

    strfind(const as, const s);
    as
    in: an array of strings
    s
    in: the strings to find
    Return value
    Case sensitive search for a string (or an array of strings) in an array of strings.

    If s is a string, strfind will return an integer which is the index of the first occurrence of s in as. If the string is not found, the return value is -1. If s is an array of n strings, strfind will return an 1 by n matrix, with, for each string in s, the index of the first occurrence in as (-1 if the string is not found). deletec with second argument -1 can be used to remove the -1 entries.


    strlwr, strupr

    strlwr(const s); strupr(const s);
    s
    in: the strings to convert
    Return value
    Returns a copy of the string, which is converted to lower case (strlwr) or uppercase (strupr).


    submat

    submat(const ma, const r1, const r2, const c1, const c2);
    ma
    in: matrix
    r1,r2
    in: int
    c1,c2
    in: int
    Return value
    Returns the submatrix of ma from row indices r1 to r2 and column indices c1 to c2. This is equivalent to ma[r1:r2][c1:c2].


    sumc, sumr

    sumc(const ma); sumr(const ma);
    ma
    in: T x n matrix A
    Return value
    The sumc function returns a 1 x n matrix r which holds the sum of the column elements of ma.

    The sumr function returns a T x 1 matrix which holds the sum of the row elements of ma.

    See also
    meanc, meanr, prodc, prodr, sumsqrc, sumsqrr, varc, varr


    sumsqrc, sumsqrr

    sumsqrc(const ma); sumsqrr(const ma);
    ma
    in: T x n matrix A
    Return value
    The sumsqrc function returns a 1 x n matrix r which holds the sum of the squares of the column elements of ma.

    The sumsqrr function returns a T x 1 matrix which holds the sum of the squares of the row elements of ma.

    See also
    sumc, sumr, varc, varr


    tailchi, tailf, tailn, tailt

    tailchi(const ma, const df); tailf(const ma, const df1, const df2); tailn(const ma); tailt(const ma, const idf);
    ma
    in: arithmetic type
    df
    in: arithmetic type, degrees of freedom
    df1
    in: arithmetic type, degrees of freedom in the numerator
    df2
    in: arithmetic type, degrees of freedom in the denominator
    idf
    in: int, degrees of freedom
    Return value
    Returns the requested tail probabilities at ma (the returned tail probabilities are between zero and one):
    • tailchi: tail probabilities from chi2(df) distribution,
    • tailf: tail probabilities from F(df1, df2) distribution,
    • tailn: one-sided standard normal tail probability,
    • tailt: one-sided tail probabilities from student-t(df) distribution.

    The tail probabilities are accurate to about 10 digits. The return type is derived as follows:

    • m x n matrix, when ma is an m x n matrix, and the rest is scalar (int for tailt);
    • m x n matrix, when ma is a scalar, and the rest are m x n matrices;
    • m x n matrix, when ma is an m x n matrix, and the rest are m x n matrices;
    • double, when ma is scalar, and the rest is also scalar (int for tailt).
    See also
    dens..., prob..., quan...


    tan, tanh

    tan(const ma); tanh(const ma);
    ma
    in: arithmetic type
    Return value
    tan returns the tangent of ma, of double or matrix type.

    tanh returns the tangent hyperbolicus of ma, of double or matrix type.

    See also
    acos, asin, atan, cos, cosh, sin, sinh, tanh


    thinc, thinr

    thinc(const ma, const c); thinr(const ma, const r);
    ma
    in: m x n matrix A
    c
    in: int, desired number of columns to extract
    r
    in: int, desired number of rows to extract
    Return value
    The thinc function returns an m by c matrix consisting of a selection of columns of the original matrix. The thinr function returns an r by n matrix consisting of a selection of rows of the original matrix.


    time

    time();
    Return value
    A string holding the current time.
    See also
    date


    timer, timespan

    timer(); timespan(const time);
    time
    in: double, value from previous call to timer
    Return value
    The timer function returns a double representing the current time in one 100th of a second.

    The timespan function returns a string holding the time lapsed since the time argument.


    toeplitz

    toeplitz(const ma); toeplitz(const ma, const cm);
    ma
    in: double, or r x 1 or 1 x r matrix
    cm
    in: (optional argument) m: dimension of matrix to be created, m >= r; if the argument is missing, m=r is used.
    Return value
    Returns a symmetric Toeplitz matrix.
    See also
    diag, solvetoeplitz


    trace

    trace(const ma);
    ma
    in: arithmetic type
    Return value
    Returns the trace of ma (the sum of its diagonal elements). Return type is double.
    See also
    determinant


    trunc, truncf

    trunc(const ma); truncf(const ma);
    ma
    in: arithmetic type
    Return value
    trunc returns the truncated elements of ma, of double or matrix type.

    truncf is fuzzy truncation.

    See also
    ceil, floor, fuzziness, round,


    unit

    unit(const rc);
    rc
    in: int
    Return value
    Returns an rc by rc identity matrix.
    See also
    constant, unit, zeros


    upper

    upper(const ma);
    ma
    in: m x n matrix
    Return value
    Returns the upper diagonal (including the diagonal) of a matrix; the strict lower diagonal elements are set to zero.
    See also
    lower, setdiagonal, setlower, setupper


    va

    va_arglist();
    Return value
    Returns an array holding the arguments starting with the first variable in the varieble argument list.
    Description
    See variable arguments.


    varc, varr

    varc(const ma); varr(const ma);
    ma
    in: T x n matrix A
    Return value
    The varc function returns a 1 x n matrix holding the variances of the columns of ma.

    The varr function returns a T x 1 matrix holding the variances of the rows of ma.

    See also
    meanc, meanr, sumc, sumr, variance


    variance

    variance(const ma);
    ma
    in: T x n matrix A
    Return value
    Returns an n x n matrix holding variance-covariance matrix of ma.
    See also
    acf, correlation, meanc, meanr, standardize, varc, varr


    vec

    vec(const ma);
    ma
    in: arithmetic type
    Return value
    If ma is an m x n matrix, the return value is an mn x 1 matrix consisting of the stacked columns of ma. If ma is scalar, the return value is an 1 x 1 matrix consisting of the value ma.
    See also
    shape, vech, vecr


    vech

    vech(const ma);
    ma
    in: arithmetic type
    Return value
    If ma is an m x n matrix, the return value is an (m(m+1)/2 - j(j+1)/2) by 1 matrix, where j = max(m-n,0), consisting of the stacked columns of the lower diagonal of ma. If ma is scalar, the return value is a 1 x 1 matrix consisting of the value ma.
    See also
    vec, vecr


    vecindex

    vecindex(const ma);
    ma
    in: matrix
    Return value
    Returns a p x 1 matrix holding the row index of the non-zero elements of vec(ma), where p is the number of non-zero elements in ma. If there is no non-zero element, the function returns the integer -1.
    See also
    shape, vec


    vecr

    vecr(const ma);
    ma
    in: arithmetic type
    Return value
    If ma is an m x n matrix, the return value is an mn x 1 matrix consisting of the stacked rows of ma. If ma is scalar, the return value is a 1 x 1 matrix consisting of the value ma.
    See also
    shape, vech, vecr


    zeros

    zeros(const r, const c);
    r
    in: int
    c
    in: int
    Return value
    Returns an r by c matrix filled with zeros.
    See also
    ones, unit, zeros


    Ox version 1.11. This file last changed 5-Aug-1996.