Overview
The arrayFillColumn destructively fills the mth column vector with the new value.
Type: Function
Syntax
(math.arrayFillColumn arrayVector A m newValue)
Arguments
Arguments | Explanation |
---|---|
A | The input array whose specified column vector is to be filled. |
m | The index of the array column vector to be filled. |
newValue | The new value with which the array column vector is to be filled. |
RETURN | The input array after the specified array column vector has been filled.. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The arrayRegressionGuestimate returns a vector containing the guestimated coefficients for a multivariable regression. The guestimated coefficients result from averaging a series of simple linear regressions on pairs of variables, each independent variable paired with the dependent variable.
Type: Function
Syntax
(math.arrayRegressionGuestimate A)
(math.arrayRegressionGuestimate A Y)
Arguments
Arguments | Explanation |
---|---|
A | The N by M+1 array representing the original observations in the matrix form of X Y. |
Y | (Optional) The N vector containing the dependent values. |
RETURN | The M+1 coefficient vector with the constant inserted in first position. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The arrayWidrowHoffRegression returns the dense M coefficient vector giving the coefficients with the best least squares fit of the variables with a constant term inserted in the model. The method used is the Widrow-Hoff iterative approximation.
Type: Function
Syntax
(math.arrayWidrowHoffRegression X Y Gmax err)
(math.arrayWidrowHoffRegression X Y Gmax err RfSW)
(math.arrayWidrowHoffRegression X Y Gmax err RfSW printSW)
Arguments
Arguments | Explanation |
---|---|
X | The N by M array representing the original observations of the independent variables. |
Y | The N vector containing the dependent values. |
Gmax | The maximum number of optimization trials (generations) to attempt before returning the best set of coefficients available at that time. |
err | A minimum error value which would terminate further optimization trials and return the best set of coefficients at that time. This minimum error is expressed as the absolute value of the average error. |
RfSW | (Optional)If present and true, return a linear regression Lambda, Rf, with coefficient vector, Rf.C, and Rf.Error set to the proper values. |
printSW | (Optional)If present and true, display each regression interation on the console. |
RETURN | The M+2 coefficient vector (with M+1th = error), AND the 0th term being an inserted constant. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The blackScholesDelta return the Black-Scholes theoretical delta for an option from the specified data. Note: Computes the option price as a percent of the current stock price, therefore, the stock price is considered to be 1, and the variance is the daily percent difference variance.
Type: Function
Syntax
(math.blackScholesDelta optType strikePct daysExp dailyVar stockYield longBondYield)
Arguments
Arguments | Explanation |
---|---|
optType | The option type (either "call" or "put"). |
strikePct | The strike price as a percent of the current price. |
daysExp | The number of days until expiration.. |
dailyVar | The daily percentage variance of the stock for past 365 days. |
stockYield | The annual dividend yield for stock as a percent. |
longBondYield | The annual long bond interest rate. |
RETURN | The Black-Scholes theoretical delta for an option, as a percent of the current price. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
The blackScholesPrice return the Black-Scholes theoretical price for an option from the specified data. Note: Computes the option price as a percent of the current stock price, therefore, the stock price is considered to be 1, and the variance is the daily percent difference variance.
Type: Function
Syntax
(math.blackScholesPrice optType strikePct daysExp dailyVar stockYield longBondYield)
Arguments
Arguments | Explanation |
---|---|
optType | The option type (either "call" or "put"). |
strikePct | The strike price as a percent of the current price. |
daysExp | The number of days until expiration.. |
dailyVar | The daily percentage variance of the stock for past 365 days. |
stockYield | The annual dividend yield for stock as a percent. |
longBondYield | The annual long bond interest rate. |
RETURN | The Black-Scholes theoretical price for an option, as a percent of the current price. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The coefficientsToFormula returns a javaScript formula from the specified M+1 coefficient vector and the field name vector of length M.
Type: Function
Syntax
(math.coefficientsToFormula coefficients fieldNames)
Arguments
Arguments | Explanation |
---|---|
coefficients | The M+1 coefficient vector (0 = constant term, and e = M+1 term). |
fieldNames | The field name vector, of length M, with which the javaScript formula will be constructed. |
RETURN | The javaScript formula of the format (append coefficients[0] "+(" coefficients[1] "*" fieldNames[0] ")+(" ...). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The convertToArray converts the input arguments to a vector array. A rank one vector or matrix is converted into a rank two column vector array. A rank two matrix is converted into a rank two vector array. If the optional dependent variable vector Y is present, a rank two XY vector array is always returned.
Type: Function
Syntax
(math.convertToArray X Y)
Arguments
Arguments | Explanation |
---|---|
X | The rank one or rank two vector or matrix to be converted. |
Y | (Optional) A vector of dependent variable values. |
RETURN | The XY vector array resulting from the conversion. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1: A math Lambda vector array must be an object vector of length N, each element of which is a number vector of length N.
Note2: If the argument is already a rank two vector and no Y argument is present, then no conversion is performed.
Overview
The convertToColumnVector returns the vector extracted from the mth column of the input array: #(w[0][m] w[1][m] .... w[N][m])
Type: Function
Syntax
(math.convertToColumnVector X m)
Arguments
Arguments | Explanation |
---|---|
X | The N by M vector array to be converted. |
m | The mth column from which to extract the vector. |
RETURN | The mth column vector of length N. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The convertToMatrix converts the input arguments to a matrix. A rank one vector or matrix is converted into a rank two number matrix. If the optional dependent variable vector Y is present, a rank two XY number matrix is always returned.
Type: Function
Syntax
(math.convertToMatrix X Y)
Arguments
Arguments | Explanation |
---|---|
X | The rank one or rank two vector or matrix to be converted. |
Y | (Optional) A vector of dependent variable values. |
RETURN | The XY number matrix resulting from the conversion. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1: A math Lambda vector array must be an object vector of length N, each element of which is a number vector of length N.
Note2: If the argument is already a rank two matrix and no Y argument is present, then no conversion is performed.
Overview
The convertToMatrixC converts the input arguments to a matrix. A rank one vector or matrix is converted into a rank two number matrix. If the optional dependent variable vector Y is present, a rank two XY number matrix is always returned. In all cases an additional column is inserted into location zero of the converted matrix. This constant column is filled with all ones, making it ready for the various regression algorithms.
Type: Function
Syntax
(math.convertToMatrixC X Y)
Arguments
Arguments | Explanation |
---|---|
X | The rank one or rank two vector or matrix to be converted. |
Y | (Optional) A vector of dependent variable values. |
RETURN | The XY number matrix resulting from the conversion. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1: A math Lambda vector array must be an object vector of length N, each element of which is a number vector of length N.
Overview
The copyToMatrix copies a rank one or two vector or a rank one matrix into a rank two matrix.
Type: Function
Syntax
(math.copyToMatrix X)
Arguments
Arguments | Explanation |
---|---|
X | The rank one or rank two vector or matrix to be copied. |
RETURN | The XY number matrix resulting from the copy. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1: A math Lambda vector array must be an object vector of length N, each element of which is a number vector of length N.
Overview
The correlation returns the correlation coefficient statistics for the two vectors.
Type: Function
Syntax
(math.correlation X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N. |
RETURN | The correlation coefficient of x and y |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The covariance returns the covariance coefficient statistics for the two vectors.
Type: Function
Syntax
(math.covariance X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N. |
RETURN | The covariance coefficient of x and y |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The cummNormalDensity returns the cummulative normal density for the specified input.
Type: Function
Syntax
(math.cummNormalDensity x)
Arguments
Arguments | Explanation |
---|---|
x | The value whose cummulative normal density is to be returned. |
RETURN | The cummulative normal density of x. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The cursorRegress returns the sparse M coefficient vector for the fields with the best least squares fit of the variables. The field names vector is used to construct an N by M+1 array where the M+1 column represents the dependent variable (the last field name in the vector).
Type: Function
Syntax
(math.cursorRegress cursor fieldNames)
Arguments
Arguments | Explanation |
---|---|
cursor | The dataMineLib memory cursor from which the N by M+1 array will be extracted. |
fieldNames | The vector of field names which are to become the colums of the N by M+1 array. |
RETURN | The M+1 coefficient vector (0 = constant term, and e = M+1 term). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
The cursor is NOT restored before the regression array is extracted. This enables conditional regression on partial row sets.
Overview
The cursorToArray returns a regression array from the cursor and table fields specified. The field names vector is used to construct an N by M+1 array where the M+1 column represents the dependent variable (the last field named in the field names vector).
Type: Function
Syntax
(math.cursorToArray cursor fieldNames)
Arguments
Arguments | Explanation |
---|---|
cursor | The dataMineLib memory cursor from which the N by M+1 array will be extracted. |
fieldNames | The vector of field names which are to become the colums of the N by M+1 array. |
RETURN | The N by M+1 regression array with the dependent variable in the last column. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
The cursor is NOT restored before the regression array is extracted. This enables conditional regression on partial row sets.
Overview
The cursorToMatrix returns a regression matrix from the cursor and table fields specified. The field names vector is used to construct an N by M+1 matrix where the M+1 column represents the dependent variable (the last field named in the field names vector).
Type: Function
Syntax
(math.cursorToMatrix cursor fieldNames)
Arguments
Arguments | Explanation |
---|---|
cursor | The dataMineLib memory cursor from which the N by M+1 matrix will be extracted. |
fieldNames | The vector of field names which are to become the colums of the N by M+1 matrix. |
RETURN | The N by M+1 regression matrix with the dependent variable in the last column. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
The cursor is NOT restored before the regression matrix is extracted. This enables conditional regression on partial row sets.
Overview
The cursorToVector Returns a vector containing the values from the specified column from the cursor specified. If the optional string switch is present, the values are returned as a column of strings ready for console display.
Type: Function
Syntax
(math.cursorToVector cursor fieldName stringSW)
Arguments
Arguments | Explanation |
---|---|
cursor | The dataMineLib memory cursor from which the N by M+1 matrix will be extracted. |
fieldName | The field name which specifies the colum to be extracted. |
stringSW | (Optional) True IFF row numbers are to be prefixed to each value as a display string; otherwise, a number vector of column values is to be returned. |
RETURN | The vector of column values. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The egm
creates a new evolutionary grid machine Lambda instance.
Form 1: create a new egm instance with initial training information
(setq estimator (math.egm cursor analystName baseExpressions fieldExpressions trainExpressions maxDepth numGridBuckets numTopGridSel))
Form 2: create a new egm instance with previously saved egm state information
(setq estimator (math.egm s))
s is structure containing saved pvars from former instance of egm.
Call Form 1 to ready machine for training on a summary table cursor.
See egm.setMyPvars for logic behind Form 2.
The cursor is reduced to a dense XY sigmod vector array using the
supplied baseExpressions, fieldExpressions and trainExpressions.
Evolutionary grid machines (egm) are quasi regression engines which
learn and make regression estimates on XY vector arrays such as:
XY: An NumRows by NumX + NumY array representing the original observations
in the matrix form of: X Y
NumRows is the number of rows in the observation set.
NumX is the number of independent columns (x values).
NumY is the number of dependent columns (y values) for which regressions are to be peformed.
The XY vector array is constructued by applying the baseExpressions against
the cursor to reduce the cursor to NumRows. Then the fieldExpressions
are applied to the cursor to produce NumX independent columns (x values). Then
the trainExpressions are applied to the cursor to produce NumY dependent
columns (y values). Then the XY vector is crunched to a dense sigmod vector
for the independent columns.
The resulting XY dense sigmod vector is stored in the egm pvars and is
persistent across multiple calls to egm.trainMachine
The egm is designed to process very large numbers of cross correlations
of the variables in the independant colums. This is accomplished by
keeping a top result list, for each dependent column, of only the best
performing correlations and associated rows. The results from every
cross-correlation are not kept and this vastly reduces the persistant
storage required to store the results of machine training.
The egm.trainMachine Lambda is passed an argument that specifies some amount
of time within which training will be completed. Each time trainMachine is
called, new training, not previously performed, will be done.
Type: Function
Syntax
(math.egm cursor analystName baseExpressions fieldExpressions trainExpressions maxDepth numGridBuckets numTopGridSel)
Arguments
Arguments | Explanation |
---|---|
cursor | The dataMineLib memory cursor from which to seed the new egm machine. |
baseExpressions | List of fitler expressons to apply to table. |
fieldExpressions | List of field expressions to apply to table to generate independent columns (x values). |
trainExpressions | List of training expressions to apply to table to generate dependent columns (y values) |
maxDepth | Maximum depth of column cross correlation to perform. Can not exceed 10 |
numGridBuckets | Optional - Number of grid buckets (default is 100 for a percentile grid) |
numTopGridSel | Optional - Number of top grid selectors to keep for each trainExpression (default is 100) |
PreviousPeriods | Optional - Vector of TVAL dates for PreviousPeriods to process in trainMachine (default is empty vector) |
RETURN | A new evolutionary grid machine Lambda instance. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
[...under construction...]
Overview
[...under construction...]
Overview
[...under construction...]
Overview
[...under construction...]
Overview
The gaussianEliminate function triangulates the M by M+1 coefficient array representing a system of M simultaneous linear equations in M variables.
Type: Function
Syntax
(math.gaussianEliminate XY)
Arguments
Arguments | Explanation |
---|---|
XY | The M by M+1 coefficient array to be triangulated. |
RETURN | The M by M+1 coefficient array after triangulation. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The gaussianSubstitute function returns the M coefficient vector from a triangulated array representing a system of M simultaneous linear equations in M variables.
Type: Function
Syntax
(math.gaussianSubstitute T)
Arguments
Arguments | Explanation |
---|---|
T | The M by M triangulated array representing a system of M simultaneous linear equations in M variables. |
RETURN | The M coefficient vector representing a solution for the M variables. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The linearRegress function
returns a vector containing the coefficients resulting
from a linear regression on two variables.
If the matrix XY is an N by 2 matrix with the independent variable, X,
in the first column and the dependent variable, Y, in the last column,
then (linearRegress XY) returns #(a b error),
where a + bX = Y represents the least squares best fit.
The term, error, is the least squares error = sqr(y - (a + bx)).
Type: Function
Syntax
(math.linearRegress XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by 2 array representing the original observations in the matrix form of: X Y. |
RETURN | The coefficient vector #(a b error) |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The makeCorrelationMatrix function returns The N by (M*M) cross correlation matrix containing all possible cross correlations of the original input features, known as the correlation matrix.
Type: Function
Syntax
(math.makeCorrelationMatrix X)
Arguments
Arguments | Explanation |
---|---|
X | The N by M matrix representing the original observations. |
RETURN | The N by (M*M) matrix containing all possible cross correlations of the original observations in the form of Xc[n,((i*M)+j)] = X[n,i]*X[n,j] for all i in M and all j in M. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The makeGaussianArray function returns the M by M+1 system of linear equations representing the coefficient derivative equations for the least squares error fit.
Type: Function
Syntax
(math.makeGaussianArray XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing a system of N simultaneous linear equations in M variables. |
RETURN | The M by M+1 array containing the dot products of the column vectors of the original observation array XY, where: X[i,j] = vectorInnerProduct(Xcol[i],Xcol[j]) |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1:See Sedgewick[2] chap 38.
Note2:The Gaussian array represents the coefficients of the derrivatives of the least squares conversion of the original observation array in preparation for least squares regression.
Overview
The makeGaussianMatrix function returns the M by M+1 system of linear equations representing the coefficient derivative equations for the least squares error fit.
Type: Function
Syntax
(math.makeGaussianMatrix XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing a system of N simultaneous linear equations in M variables. |
RETURN | The M by M+1 matrix containing the dot products of the column vectors of the original observation array XY, where: X[i,j] = vectorInnerProduct(Xcol[i],Xcol[j]) |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1:See Sedgewick[2] chap 38.
Note2:The Gaussian matrix represents the coefficients of the derrivatives of the least squares conversion of the original observation array in preparation for least squares regression.
Overview
The makeGramArray function returns the N by N array containing the dot products of the input vectors, known as the Gram array.
Type: Function
Syntax
(math.makeGramArray XY)
(math.makeGramArray X Y)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing a system of N simultaneous linear equations in M variables. |
Y | (Optional) The N column vector representing the dependent variables. |
RETURN | The N by N array containing the dot products of the row vectors of the original observation array XY, where: G[i,j] = vectorDotProduct(XYrow[i],XYrow[j]) |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1:See Cristianini, "Support Vector Machines", page 169.
Overview
The makeGramMatrix function returns the N by N matrix containing the dot products of the input vectors, known as the Gram matrix.
Type: Function
Syntax
(math.makeGramMatrix XY)
(math.makeGramMatrix X Y)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing a system of N simultaneous linear equations in M variables. |
Y | (Optional) The N column vector representing the dependent variables. |
RETURN | The N by N matrix containing the dot products of the row vectors of the original observation array XY, where: G[i,j] = vectorDotProduct(XYrow[i],XYrow[j]) |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note1:See Cristianini, "Support Vector Machines", page 169.
Overview
The makeIdentityMatrix function returns the N by N identity matrix with 1's only along the diagonal and zero's everywhere else.
Type: Function
Syntax
(math.makeIdentityMatrix N)
(math.makeIdentityMatrix N C)
Arguments
Arguments | Explanation |
---|---|
N | The number of rows and columns in the identity matrix. |
C | (Optional) The alternative diagonal constant (defaults to 1.0). |
RETURN | The N by N identity matrix, in the form of:
1 0 ... 0 0 0 1 ... 0 0 ... 0 0 ... 1 0 0 0 ... 0 1 |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixColToVector function returns the N by N identity matrix with 1's only along the diagonal and zero's everywhere else.
Type: Function
Syntax
(math.matrixColToVector X c N)
Arguments
Arguments | Explanation |
---|---|
X | The matrix from which the column vector is to be extracted. |
N | The number of rows to include in the final column vector (must be less than or egual to the number of rows in X. |
C | The column of X to be extracted. |
RETURN | The N vector containing the values from the C column of the matrix X. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixDualGramRegress function returns the dense N coefficient vector giving the coefficients with the best least squares fit of the variables, in dual Gram matrix form.
Type: Function
Syntax
(math.matrixDualGramRegress X Y)
Arguments
Arguments | Explanation |
---|---|
X | The N by M array or matrix representing the original observations. |
Y | The separate N column vector containing the dependent variable. |
RETURN | The N+1th coefficient vector (with N+1th = stdError, avgError, minError, maxError, avgY). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note:See Cristianini, "Support Vector Machines" chap 2.
Overview
The matrixDualGramRegressC function returns the dense N coefficient vector giving the coefficients with the best least squares fit of the variables, in dual Gram matrix form, with constant term inserted before the first column.
Type: Function
Syntax
(math.matrixDualGramRegressC X Y)
Arguments
Arguments | Explanation |
---|---|
X | The N by M array or matrix representing the original observations. |
Y | The separate N column vector containing the dependent variable. |
RETURN | The N+1th coefficient vector (with N+1th = stdError, avgError, minError, maxError, avgY). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
Note:See Cristianini, "Support Vector Machines" chap 2.
Overview
The matrixFillColumn function destructively fills the Cth column vector with the fill value. The fill value may be a scalar or a vector.
Type: Function
Syntax
(math.matrixFillColumn X C newValue)
Arguments
Arguments | Explanation |
---|---|
X | The matrix whose Cth column is to be filled. |
C | The index of the matrix column to be filled. |
fillValue | The value which is to fill the Cth column of the matrix. |
RETURN | The original input matrix with the specified column filled. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixFillRow function destructively fills the Rth row vector with the fill value. The fill value may be a scalar or a vector.
Type: Function
Syntax
(math.matrixFillRow X R newValue)
Arguments
Arguments | Explanation |
---|---|
X | The matrix whose Rth row is to be filled. |
R | The index of the matrix row to be filled. |
fillValue | The value which is to fill the Rth row of the matrix. |
RETURN | The original input matrix with the specified row filled. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixGaussianEliminate function triangulates the M by M+1 coefficient matrix representing a system of M simultaneous linear equations in M variables.
Type: Function
Syntax
(math.matrixGaussianEliminate XY)
Arguments
Arguments | Explanation |
---|---|
XY | The M by M+1 coefficient matrix to be triangulated. |
RETURN | The M by M+1 coefficient matrix after triangulation. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixGaussianSolve function solves the M by M+1 system of M simultaneous linear equations in M variables, and returns the M vector containing the coefficients for each of the M variables.
Type: Function
Syntax
(math.matrixGaussianSolve X Y)
Arguments
Arguments | Explanation |
---|---|
X | The M by M matrix representing a system of M simultaneous linear equations in M variables. |
Y | The M vector representing the dependent variables. |
RETURN | The M coefficient vector representing a solution for the M variables. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixGaussianSubstitute function returns the M coefficient vector from a triangulated matrix representing a system of M simultaneous linear equations in M variables.
Type: Function
Syntax
(math.gaussianSubstitute XY)
Arguments
Arguments | Explanation |
---|---|
XY | The M by M+1 triangulated matrix representing a system of M simultaneous linear equations in M variables. |
RETURN | The M coefficient vector representing a solution for the M variables. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixInvert function returns the inversion of the N by N input matrix using gaussian LU decomposition, without pivoting, to reduce round off errors.
Type: Function
Syntax
(math.matrixInvert X)
Arguments
Arguments | Explanation |
---|---|
X | The M by M matrix to be inverted. |
RETURN | The M by M matrix after inversion. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixInvertUpperTriangular function returns the inversion of the M by M upper triangular input matrix, using gaussian substitution.
Type: Function
Syntax
(math.matrixInvertUpperTriangular U)
Arguments
Arguments | Explanation |
---|---|
U | The M by M matrix (upper triangular). |
RETURN | The M by M matrix after inversion (also upper triangular). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixLower function returns the lower triangular component matrix of the N by N input matrix using gaussian LU decomposition, without pivoting, to reduce round off errors.
Type: Function
Syntax
(math.matrixLower X)
Arguments
Arguments | Explanation |
---|---|
X | The N by N matrix to be lower triangulated. |
RETURN | The N by N matrix after lower triangulation. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixMultipleRegress function returns the dense M+1 coefficient vector giving the coefficients with the best least squares fit of the variables.
Type: Function
Syntax
(math.matrixMultipleRegress XY)
(math.matrixMultipleRegress X Y)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 matrix representing the original observations. |
Y | (Optional)A separate vector contains the dependent values. |
RETURN | The M+1 coefficient vector (with M+1th = stdError, avgError, minError, maxError, avgY). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixMultipleRegressC function returns the dense M+1 coefficient vector giving the coefficients with the best least squares fit of the variables. A constant column is added to the input matrix.
Type: Function
Syntax
(math.matrixMultipleRegressC XY)
(math.matrixMultipleRegressC X Y)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 matrix representing the original observations. |
Y | (Optional)A separate vector contains the dependent values. |
RETURN | The M+1 coefficient vector (with M+1th = stdError, avgError, minError, maxError, avgY). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixMultiply function
Returns The M by N matrix product from multiplying A times B,
where A is maximally an M by K matrix, and B is maximally a
K by N matrix.
Minimally the A component may be a scalar, a vector, a row vector,
a column vector, a vector array, or a matrix. In each case,
the appropriately shaped product result will be returned.
Type: Function
Syntax
(math.matrixMultiply A B)
Arguments
Arguments | Explanation |
---|---|
A | The M by K matrix representing the left matrix. |
B | The K by N matrix representing the right matrix. |
RETURN | The M by N matrix containing the dot products of the row vectors of the left matrix A, with the column vectors of the right matrix B, where: AB[m,n] = vectorInnerProduct(rowA[m],colB[n]). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixNormalize function
Normalizes the column values in a matrix. Each matrix
cell value is normalized by finding the high and low
range for the value's column, then value is converted
into a fraction (0 ... 1) of it's column's high-low range.
Minimally the A component may be a scalar, a vector, a row vector,
a column vector, a vector array, or a matrix. In each case,
the appropriately shaped product result will be returned.
Type: Function
Syntax
(math.matrixNormalize A)
Arguments
Arguments | Explanation |
---|---|
A | The M by N matrix to be normalized. |
RETURN | The M by N matrix with normalized columns. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixRowToVector function returns the M number vector which is the specified row of the N by M matrix input matrix.
Type: Function
Syntax
(math.matrixRowToVector X r M)
Arguments
Arguments | Explanation |
---|---|
X | The N by M matrix whose specified row is to be extracted. |
r | The row which is to be extracted. |
M | The maximum number of elements to extract into the row vector. |
RETURN | The and M number vector which is the specified row of the N by M matrix input matrix. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixTranspose function returns The N by M matrix transposition of the M by N input matrix. The input matrix may be a scalar, a vector, a row vector, a column vector, a vector array, or a matrix. In each case, the appropriately shaped product result will be returned.
Type: Function
Syntax
(math.matrixTranspose X)
Arguments
Arguments | Explanation |
---|---|
X | The M by N matrix to be transposed. |
RETURN | The N by M matrix transposition. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixTriangulate function triangulates the M by M matrix using gaussian elimination to reduce round off error..
Type: Function
Syntax
(math.matrixTriangulate X)
Arguments
Arguments | Explanation |
---|---|
X | The M by M matrix to be triangulated. |
RETURN | The M by M matrix after triangulation. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The matrixUpper function returns the upper triangular component matrix of the M by M input matrix using gaussian LU decomposition, without pivoting, to reduce round off errors.
Type: Function
Syntax
(math.matrixUpper X)
Arguments
Arguments | Explanation |
---|---|
X | The M by M matrix to be upper triangulated. |
RETURN | The M by M matrix after upper triangulation. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
The matrixWidrowHoffRegression returns the dense M coefficient vector giving the coefficients with the best least squares fit of the variables with a constant term inserted in the model. The method used is the Widrow-Hoff iterative approximation.
Type: Function
Syntax
(math.matrixWidrowHoffRegression X Y Gmax err)
(math.matrixWidrowHoffRegression X Y Gmax err RfSW)
(math.matrixWidrowHoffRegression X Y Gmax err RfSW printSW)
Arguments
Arguments | Explanation |
---|---|
X | The N by M matrix representing the original observations of the independent variables.. |
Y | The N vector containing the dependent values. |
Gmax | The maximum number of optimization trials (generations) to attempt before returning the best set of coefficients available at that time. |
err | A minimum error value which would terminate further optimization trials and return the best set of coefficients at that time. This minimum error is expressed as the absolute value of the average error. |
RfSW | (Optional)If present and true, return a linear regression Lambda, Rf, with coefficient vector, Rf.C, and Rf.Error set to the proper values. |
printSW | (Optional)If present and true, display each regression interation on the console. |
RETURN | The M+2 coefficient vector (with M+1th = error), AND the 0th term being an inserted constant. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The multipleRegress returns the sparse M coefficient vector for the factors with the best least squares fits of the variables.
Type: Function
Syntax
(math.multipleRegress XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing the original observations. |
RETURN | The M+2 coefficient vector (with M+1th = error), AND the 0th term being an inserted constant. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The multivariableRegress returns the sparse M coefficient vector for the factors with the best least squares fits of the variables.
Type: Function
Syntax
(math.multivariableRegress XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing the original observations. |
RETURN | The M+1 coefficient vector (with M+1th = error). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The multivariableRegressC returns the dense M coefficient vector giving the coefficients with the best least squares fit of the variables with a constant term inserted in the model.
Type: Function
Syntax
(math.multivariableRegressC XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing the original observations. |
RETURN | The M+2 coefficient vector (with M+1th = error), AND the 0th term being an inserted constant. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
[...under construction...]
Overview
The multivariableRegressIC Returns the dense M coefficient vector giving the coefficients with the best least squares fit of the variables with a constant term inserted in the model. The method used is evolutionary approximation.
Type: Function
Syntax
(math.multivariableRegressIC XY)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing the original observations. |
RETURN | The M+1 coefficient vector (with M+1th = error). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
[...under construction...]
Overview
The normalizeArray normalizes the column values in a array. Each array cell value is normalized by finding the high and low range for the value's column, then value is converted into a fraction (0 ... 1) of it's column's high-low range.
Type: Function
Syntax
(math.normalizeArray XY)
(math.normalizeArray XY lastSW)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M array values to be normalized. |
lastSW | (Optional) true if last column is to be unchanged. |
RETURN | The normalized array (all values are fractions). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
[...under construction...]
Overview
The numericRegress
returns the input estimator Lambda with numeric coefficients
optimized against the specified objective function. The
regression may be linear or nonlinear and will minimize any
objective function. Neither the estimator Lambda nor the
objective function are required to be continuous.
The problem sizes addressed by this Lambda are classified as:
o Small Problems (nominally 4 columns by 500 rows of data).
o Midsize Problems (nominally 20 columns by 5000 rows of data).
o Large scale Problems (nominally 100 columns by 25000 rows of data).
This Lambda uses many user selectable search strategies for
estimator Lambda optimization. Each technology has its own
strengths and weaknesses. Some are linear only. Some cannot be
used on large scale problems. As new technologies become available,
in the scientific community, they are made available here. The
currently supported numeric regression strategies are as
follows.
Multivariate Linear Regression: This is the technology developed
by Gauss several centuries ago. It is deterministic and absolutely
accurate, but limited to linear regression only. This strategy is
extremely fast and applicable for all small, midsize, and large
scale regression problems.
Support Vector Machine Regression: This is technology developed
by Vapnik and Platt in this century. It is non-deterministic,
incremental, but fairly accurate and capable of handling both
linear and non-linear regression tasks. This strategy is
reasonably fast and applicable for all small, midsize, and large
scale regression problems.
Genetic Evolutionary Regression: This technology was developed
by Holland and Koza in the past century. It is non-deterministic,
incremental, fairly inaccurate but capable of handling both
linear and non-linear regression tasks. This strategy is
fairly slow and applicable for only small scale regression
problems. It has trouble handling more than 500 or so rows.
There are three flavors of this technology. Evolve, uses a
real number genome. EvolveBinary uses a binary genome, and
evolveBinaryMemo uses a binary genome with memoizing.
Induced Regression: This is ad hoc technology defined by the
user. The regression technology to be used must be entirely
contained in the user supplied estimator Lambda. As examples
of such ad hoc, user defined technology, we supply estimator
regression Lambdas to implement nearest neighbor cluster
regression, and euclidean induction regression. The speed
and problem size applicability of these strategies is entirely
on the estimator Lambda supplied by the user.
Type: Function
Syntax
(math.numericRegress X Y Rf Gmax err)
Arguments
Arguments | Explanation | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
XY | (Option 1): The N by M+1 array of the original observations
where each of the row vectors must be Number vectors.
(Option 2): The N by M+1 number matrix of the observations (Option 3): The N by M array of the independent variables where each of the row vectors must be Number vectors. |
||||||||||||||||||||||||||||||||||||
Y | (Option A) #void (in which case the XY argument must be
either Option 1 or Option 2, and never Option 3.
(Option B) The N number vector representing the dependent variables Note: If Y is NOT #void then the first argument, X, must be Option 3, and never Options 1 or 2. Note: Each of the available regression strategies will accept X and Y variables in any of the legal options combinations. In all cases, data conversion will be done for the user. To avoid expensive automatic data conversions, use the following X Y input options for each strategy as follows:
|
||||||||||||||||||||||||||||||||||||
Rf | The estimator Lambda which maps a number vector, of length M,
into a single real number, Rf: Vm --> R, whose coefficients
are to be optimized. The estimator Lambda is in the form of
a function, (Rf mVector) ==> aNumber, and the coefficients
to be optimized are stored as a number vector Rf.C
in the persistant variables of the Rf Lambda.
Note: The estimator Lambda, Rf, must be an Lambda containing the following persistant (pvars) variables:
Note: We supply a number of child Lambdas with expertise in constructing estimator Lambdas for use with the various regression strategies. Reviewing the following child Lambdas and their documentation will provide assistance in using each of the available regression techniques:
|
||||||||||||||||||||||||||||||||||||
Gmax | The maximum number of optimization trials (generations) to attempt before returning the best set of coefficients available at that time. | ||||||||||||||||||||||||||||||||||||
err | A minimum error value which would terminate further optimization trials and return the best set of coefficients at that time. | ||||||||||||||||||||||||||||||||||||
RETURN | The estimator Lambda, Rf, with all coefficients in Rf.C optimized. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
The math.numericRegress.selfTest child Lambda contains a number of examples demonstrating the use of these regression techniques to solve test regression problems. Also included are examples of using the child Lambdas to construct estimator Lambdas for use with each regression strategy.
Overview
The numericRegress.makeBExponential
Genetic Evolutionary Regression: (binary genome)
Return an exponential regression estimator Lambda for
use with numericRegress. The estimator Lambda implements
an exponential polynomial regression model, which has
been modified to prevent overflow.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
y = C[0] + C[1]*expt(X[0],C[2]) + ... + C[2M]*expt(X[M-1],C[2M+1])
Type: Function
Syntax
(math.numericRegress.makeBExponential variableCount)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeCluster
Induced Regression:
Return a nearest neighbor cluster induction estimator Lambda
for use with numericRegress. This estimator Lambda memorizes each unique
independent vector, X, observed during the training period along with the
average dependent variable, y, associated with the memorized observation, X.
Additionally, all the observations are segmented into nearest neighbor
euclidean clusters along each independent axis. For each cluster along
each independent axis, the optimal multivariable regression coefficients
are memorized.
During estimation, if the input X has been observed during training, then
the best estimate for y is the average y value seen for X during training.
If the input X has NOT been observed during training, then the best estimate
for y is the average y value, returned from the memorized optimal multivariable
regression coefficients, for each of the euclidean nearest neighbor clusters
of X as on each independent axis as segmented during training.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Type: Function
Syntax
(math.numericRegress.makeCluster variableCount filter)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
filter | The type of final output filter. Must be one of (binary, bipolar, continuous, or sigmoid). |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeEuclidean
Induced Regression:
Return a Euclidean induction regression estimator Lambda for use with
numericRegress. This estimator Lambda memorizes each unique independent
vector, X, observed during the training period along with the average
dependent variable, y, associated with the memorized observation, X.
During estimation, if the input X has been observed during training, then
the best estimate for y is the average y value seen for X during training.
If the input X has NOT been observed during training, then the best estimate
for y is the average y value for the euclidean nearest neighbors of X as
memorized during training. The optimal neighborhood size is determined
empirically during training.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Type: Function
Syntax
(math.numericRegress.makeEuclidean variableCount filter)
(math.numericRegress.makeEuclidean variableCount filter crunch)
(math.numericRegress.makeEuclidean variableCount filter crunch errorOn)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
filter | The type of final output filter. Must be one of (binary, bipolar, continuous, or sigmoid). |
crunch | (Optional)Input vector crunch function. Defaults to copy function
if missing or #void. Can be used to crunch input elements
into deciles, percentiles, etc. After learning, during estimation
phase, new observations are compared with the memorized crunched
training samples stored during learning.
o Does not effect the dependent variable. o Only used during training. o Must produce a copy of the original input vector. o Must NEVER mutate the original input vector. May use the following symbols for specially prepared sigmoid input crunching functions. o percentile: o decile: o quintile: o quartile: o trinary: o binary: May use a number argument for specially prepared sigmoid input crunching functions of the specified arity. |
errorOn | True iff least squared errors are to be returned from the Objective function |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeExponential
Genetic Evolutionary Regression: (real number genome):
Return an exponential regression estimator Lambda for
use with numericRegress. The estimator Lambda implements
an exponential polynomial regression model, which has
been modified to prevent overflow.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
y = C[0] + C[1]*expt(X[0],C[2]) + ... + C[2M]*expt(X[M-1],C[2M+1]).
Type: Function
Syntax
(math.numericRegress.makeExponential variableCount)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeLinear
Multivariable Linear Regression (Gaussian):
Return a linear regression estimator Lambda for
use with numericRegress. The estimator Lambda implements
a linear polynomial regression model, which has
been modified to prevent overflow.
This model does NOT support a threshold constant at C[0].
The model assumes each coefficient C[m] is multiplied
by its paired variable X[m].
A threshold constant at C[0] can be achieved by setting
X[0] equal to one for all rows in the training data. The
resulting C[0] value will equal the threshold constant.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
y = C[0]*X[0] + ... + C[M-1]*X[M-1].
Type: Function
Syntax
(math.numericRegress.makeLinear variableCount)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeLinearEvolve
Genetic Evolutionary Regression (real number genome):
Return a linear regression estimator Lambda for
use with numericRegress. The estimator Lambda implements
a linear polynomial regression model, which has
been modified to prevent overflow.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
y = C[0] + C[1]*X[0] + ... + C[M]*X[M-1].
Type: Function
Syntax
(math.numericRegress.makeLinearEvolve variableCount)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeLinearNetwork
Induced Regression:
Return a linear network regression estimator Lambda for use with
numericRegress. This estimator Lambda memorizes each unique independent
vector, X, observed during the training period along with the average
dependent variable, y, associated with the memorized observation, X.
Additionally, all the observations are segmented into nearest neighbor
euclidean clusters along each independent axis. For each cluster along
each independent axis, the optimal multivariable regression coefficients
are memorized.
During estimation, if the input X has been observed during training, then
the best estimate for y is the average y value seen for X during training.
If the input X has NOT been observed during training, then the best estimate
for y is the average y value, returned from the memorized optimal multivariable
regression coefficients, for each of the euclidean nearest neighbor clusters
of X as on each independent axis as segmented during training.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Type: Function
Syntax
(math.numericRegress.makeLinearNetwork variableCount filter)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
filter | The type of final output filter. Must be one of (binary, nbinary, bipolar, continuous, or sigmoid). |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeLogit
Genetic Evolutionary Regression (real number genome):
Return a logit regression estimator Lambda for use
with numericRegress. The estimator Lambda implements
a logit polynomial regression model, which has been
modified to prevent overflow.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
d = C[0] + abs(C[1])*X[0] + ... + abs(C[M])*X[M]
y = exp(d) / (1 + exp(d))
Type: Function
Syntax
(math.numericRegress.makeLogit variableCount)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeNeighbor
Induced Regression:
Return a nearest neighbor induction regression estimator Lambda
for use with numericRegress. This estimator Lambda memorizes each unique
independent vector, X, observed during the training period along with the
average dependent variable, y, associated with the memorized observation, X.
Additionally, all the observations are segmented into nearest neighbor euclidean
clusters along each independent axis. For each cluster along each independent
axis, the optimal multivariable regression coefficients are memorized.
During estimation, if the input X has been observed during training, then
the best estimate for y is the average y value seen for X during training.
If the input X has NOT been observed during training, then the best estimate
for y is the average y value, returned from the memorized optimal multivariable
regression coefficients, for each of the euclidean nearest neighbor clusters
of X as on each independent axis as segmented during training.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Type: Function
Syntax
(math.numericRegress.makeNeighbor variableCount filter)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
filter | The type of final output filter. Must be one of (binary, nbinary, bipolar, continuous, or sigmoid). |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makePolynomial
Induced Regression (uses ad hoc Gaussian methods):
Return a non-linear polynomial regression estimator Lambda
for use with numericRegress. The estimator Lambda implements
a general non-linear polynomial regression model, which has
been modified to prevent overflow.
This ad hoc regression technique attempts to reduce a
non-linear problem to a linear polynomial regression
where Gaussian methods can be applied.
First, a general polynomial is computed, then it is raised
to a power, and a filter is applied to the output. To find
the polynomial regression coefficients, the filter and power
are reversed in the dependent variable, Y. Now we have a linear
relationship between X and Y and we can use Gaussian techniques.
Warning: In order to be reversable, the power must be a positive,
odd, integer. Since we need all the positive integers
to create the family of Nth order polynomials, from which
all other functions can be simulated, this method tends
to over fit all problems where an even integer would
suffice to fit the data. The sigmoid output filter has
been selected so that it can be easily reversed.
Notes:
The objective function computes the average
absolute tolerance (expressed as a percent of each dependent variable).
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
p = expt( C[0]*X[0] + ... + C[M-1]*X[M-1] , power )
(filter == continuous): y = p
(filter == sigmoid): y = exp(p) / (1 + exp(p))
Type: Function
Syntax
(math.numericRegress.makePolynomial variableCount power filter ErrTolerance)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
power | The power to which the polynomial is to be raised (a positive, odd integer). |
filter | The output filter for the polynomial (continuous, or sigmoid). |
ErrTolerance | The tolerance limit to use in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeSinusoidal
Genetic Evolutionary Regression (real number genome):
Return a sinusoidal regression estimator Lambda for
use with numericRegress. The estimator Lambda implements
a sinusoidal polynomial regression model, which has
been modified to prevent overflow.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
y = C[0]*X[1] + (C[1]*X[1])*sin(C[2]*X[0])
Type: Function
Syntax
(math.numericRegress.makeSinusoidal variableCount)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeSVM
Support Vector Machine Regression:
Return a support vector machine regression estimator Lambda
for use with numericRegress. The estimator Lambda implements
a support vector machine polynomial regression model, which has
been modified to prevent overflow. The Support Vector Machine
creates a weighted polynomial dual model based on the Gram
matrix of the observations.
Support Vector Machine regression can be highly accurate
when solving non-linear regression problems. However, the
accuracy varies from excellent to poor depending upon
the ratio of: the chosen Gaussian Sample Size (maxSVSize);
the number of regression variables (M); and the THEORETICAL
number of variables created by the kernel function to
make the non-linear problem linearly solvable. A simplified
example would be as follows.
Solving a quadratic regression problem with variableCount == 3,
y = sum{m from 0 until variableCount}(Cm*Xm*Xm), and
a kernel function of vectorSquareInnerProduct, is very
accurate with a Gaussian Sample Size (maxSVSize) of 10.
However, if the variableCount is increased to 10, then the
accuracy completely breaks down and is not restored until
the Gaussian Sample Size is increased to around 100. An
explanation is as follows.
In order to make the quadratic regression linearly tractable,
the vectorSquareInnerProduct performs an on-the-fly squaring
of each training point vector. Thus, with a training point
vector of size three, the vectorSquareInnerProduct creates
the following on-the-fly THEORETICAL new training point:
kernel(X1,X2,X3) => (X1,X2,X3,X1*X1,X2*X2,X3*X3,X1*X2,X1*X3,X2*X3).
Clearly the problem is now linearly solvable because the squared
variables are now terms in the THEORETICAL on-the-fly linear regression
created by the kernel. NOTICE however, that the THEORETICAL linear
regression, created on-the-fly by the kernel function, has nine variables
not three variables as in the original quadratic problem. Unless the
number of training points is greater than nine, and the Gaussian
sample size is greater than nine, the on-the-fly linear regression
will not have enough data to get accurate results. (The Lambda
math.numericRegress.selfTest contains a sample test case which
demonstrates the fall in accuracy as Gaussian Sample Size is decreased).
This model does NOT support a threshold constant at C[0].
The model assumes each coefficient C[m] is multiplied
by its paired dual model variable: kernel(X[0],Xs).
A threshold constant at C[0] can be achieved by setting
X[0] equal to one for all rows in the training data.
Notes:
The objective function computes the average
absolute tolerance (expressed as a percent of each dependent variable).
Estimator training data must be an N x M vector array, X, and an N number vector, Y.
Estimator input must be a single number vector.
Model:
y = C[0]*kernel(X[0],Xs) + ... + C[M-1]*kernel(X[M-1],Xs)
Type: Function
Syntax
(math.numericRegress.makeSVM variableCount kernel ErrTolerance maxSVSize)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
kernel | The kernel function to use in the regression. |
ErrTolerance | The error tolerance limit to use in the regression. |
maxSVSize | The Gaussian sample size (maximum number of support vectors to use during Gaussian initialization -- defaults to 100). |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.makeTailExponential
Support Vector Machine Regression:
Return an exponential tail estimator Lambda for
use with numericRegress. The estimator Lambda implements
an exponential polynomial regression model, which has
been modified to prevent overflow.
This objective function trys to maximize its best top N% and
to minimize its bottom N%. The product, not the sum, of the
actual scores is used to force more wins/losses into each tail
during the training process.
Notes:
A standard least squares objective function is used.
Estimator training data must be a single N x M+1 vector array.
Estimator input must be a single number vector.
Model:
y = C[0] + C[1]*expt(X[0],C[2]) + ... + C[2M]*expt(X[M-1],C[2M+1])
Type: Function
Syntax
(math.numericRegress.makeTailExponential variableCount tailPct)
Arguments
Arguments | Explanation |
---|---|
variableCount | The number of independent variables in the regression. |
tailPct | The percent of independent variables, top and bottom tail, to be optimized. |
RETURN | Always returns an estimator Lambda,Rf, suitable for use with the numericRegress Lambda. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.setRandom Return an exponential tail estimator Lambda for use with numericRegress. The estimator Lambda implements an exponential polynomial regression model, which has been modified to prevent overflow.
Type: Function
Syntax
(math.numericRegress.setRandom randomSW seed)
Arguments
Arguments | Explanation |
---|---|
randomSW | The random number switch (true for random function, false for srandom function). |
seed | The numeric seed for the srandom function (iff randomSW = false). |
RETURN | Always returns the new randomSW setting. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.selfTest Perform a self test of the numericRegress general regression Lambda.
Type: Function
Syntax
(math.numericRegress.selfTest)
Arguments
Arguments | Explanation |
---|---|
RETURN | Always returns true if the self test is successful. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.percentileGridMachine
Returns a new percentile grid machine Lambda ready for training.
Percentile grid machines are quasi regression engines which
learn and make regression estimates on XY vector arrays, where
XY is an N by M+1 array representing the original observations.
The percentile grid machine constructs a percentile grid, of the
XY training data. The grid contains Bayesian equal probabalistic
percentile views of all possible N-way cross correlations of the
independent columns in XY. Each row in the percentile grid contains
exactly 100 entries representing the average Y values for each
percentile of the specified N-way cross correlation of independent
variables.
The percentile grid machine is designed to provide either 1-way,
2-way, 3-way, or 4-way column cross correlations. The PGM automatically
selects the largest number of columns to cross correlate which it can
fit into available resources. The percentile grid size is determined
by the number of independent columns, MX, and the number of columns
chosen for cross correlation, C. The number of rows in the percentile
grid is always equal to expt(MX,C).
Percentile grid machines operate on entire vector arrays
at once. For this reason percentile grid machines are not
strictly regression engines, and therefore are not included
in the math.numericRegress Lambda's tool set.
Type: Function
Syntax
(math.numericRegress.percentileGridMachine MGrid)
Arguments
Arguments | Explanation |
---|---|
MGrid | The number of cols in each row of the percentile training grid (default is 100 for percentile subdivisions). |
RETURN | Always returns, pgm, a new percentile grid machine Lambda ready for training. On this pgm copy the user can invoke the functions pgm.reset, pgm.inputArray, pgm.inputCursor, pgm.trainMachine, and pgm.runMachine. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.percentileGridMachine.inputArray function crunches the input vector array into a dense sigmoid XY training vector array.
Type: Function
Syntax
(pgm.inputArray XY)
(pgm.inputArray XY Y)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array of independent variable observations (if no optional Y argument is present, then the M+1th column contains the dependent variable values). |
Y | (Optional) The N vector of dependent variable values. |
RETURN | Always returns, XY, the final crunched input array ready for training. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.percentileGridMachine.inputCursor function crunches the dataMineLib table memory cursor input into a dense sigmoid XY training vector array. The dataMineLib table, which the cursor is managing, must have a field named: SpecialSituationNotes, because the SpecialSituationNotes field is used as a scratch pad by this function.
Type: Function
Syntax
(pgm.inputCursor cursor baseExpressions expressionVector)
Arguments
Arguments | Explanation |
---|---|
cursor | A dataMineLib memory cursor to be crunched into a dense sigmoid XY training vector array (The dataMineLib table, which the cursor is managing, must have a field named: SpecialSituationNotes, because the SpecialSituationNotes field is used as a scratch pad by this function). |
baseExpressions | The vector of javaScript filter expressions used to reduce the table BEFORE data extraction. Selecting all cursor rows would require a baseExpression argument of: #("restore;"). |
expressionVector | The M+1 vector of javaScript filter expressions used to extract each column of data from the cursor. The dependent variable is the M+1 expression. |
RETURN | Always returns, XY, the final crunched input array ready for training. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.percentileGridMachine.resetMachine Reset this percentile grid machine (clears all existing training memory).
Type: Function
Syntax
(pgm.resetMachine)
Arguments
Arguments | Explanation |
---|---|
RETURN | Always returns true. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.percentileGridMachine.runMachine
Run this percentile grid machine on the X sample vector array.
Percentile grid machines are quasi regression engines which
learn and make regression estimates on X vector arrays, where
X is an N by M array representing the independent observations.
The percentile grid machine trains on a complete N by M+1 vector
array, XY. When the percentile grid machine runs, it only requires
a complete N by M vector array, X, on which to make its predictions
concerning the estimated values of the dependent variable, Y.
May be run on a vector array or a table cursor, as follows.
(Option 1) (runMachine X {gridVector})
(Option 2) (runMachine cursor baseExpressions expressionVector {gridVector})
If a dataMineLib table memory cursor is passed as an argument, the SpecialSituationNotes field
of each row in the table cursor will contain the new dependent variable, Yest, estimates.
An optional gridVector argument provides an object vector of percentile grids
each of which will have an equal vote on the estimator values.
Type: Function
Syntax
(pgm.runMachine X)
(pgm.runMachine X gridVector)
(pgm.runMachine cursor baseExpressions expressionVector)
(pgm.runMachine cursor baseExpressions expressionVector gridVector)
Arguments
(Option 1)
Arguments | Explanation |
---|---|
X | The N by M vector array, X, on which this machine is to make its predictions concerning the estimated values for the dependent variable, Y. |
gridVector | (Optional) An object vector of percentile grids each of which will have an equal vote on the estimator values (the training grid inside this machine is ignored). |
RETURN | Always returns, Yest, an N vector of estimates for the dependent variable, Y. |
(Option 2)
Arguments | Explanation |
---|---|
cursor | A dataMineLib memory cursor to be crunched into a dense sigmoid XY training vector array (The dataMineLib table, which the cursor is managing, must have a field named: SpecialSituationNotes, because the SpecialSituationNotes field is used as a scratch pad by this function). |
baseExpressions | The vector of javaScript filter expressions used to reduce the table BEFORE data extraction. Selecting all cursor rows would require a baseExpression argument of: #("restore;"). |
expressionVector | The M vector of javaScript filter expressions used to extract each column of data from the cursor. |
gridVector | (Optional) An object vector of percentile grids each of which will have an equal vote on the estimator values (the training grid inside this machine is ignored). |
RETURN | Always returns, Yest, an N vector of estimates for the dependent variable, Y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The numericRegress.percentileGridMachine.trainMachine
Train this percentile grid machine on an XY training vector array.
May be cummulatively trained on multiple training data arrays
as long as the percentile grid machine is not reset between trainings.
Percentile grid machines are quasi regression engines which
learn and make regression estimates on XY vector arrays, where
X is an N by M+1 array representing the independent observations,
with the M+1th column being the sependent variable, Y.
The percentile grid machine trains on a complete N by M+1 vector
array, XY. When the percentile grid machine runs, it only requires
a complete N by M vector array, X, on which to make its predictions
concerning the estimated values of the dependent variable, Y.
May be trained on a vector array or a table cursor, as follows.
(Option 1) (pgm.trainMachine XY)
(Option 2) (pgm.trainMachine X Y)
(Option 3) (pgm.trainMachine cursor baseExpressions expressionVector)
If a dataMineLib table memory cursor is passed as an argument, the SpecialSituationNotes field
of each row in the table cursor will contain the new dependent variable, Yest, estimates.
Type: Function
Syntax
(pgm.trainMachine X)
(pgm.trainMachine X Y)
(pgm.trainMachine cursor baseExpressions expressionVector)
Arguments
(Option 1)
Arguments | Explanation |
---|---|
XY | The N by M+1 vector array, XY, on which this machine is to be trained. The M+1th column contains the values for the dependent variable, Y. |
RETURN | Always returns, Grid, the training grid estimates for the dependent variable, Y. |
(Option 2)
Arguments | Explanation |
---|---|
X | The N by M vector array, X, on which this machine is to be trained. |
Y | The N vector containing the values for the dependent variable, Y. |
RETURN | Always returns, Grid, the training grid estimates for the dependent variable, Y. |
(Option 3)
Arguments | Explanation |
---|---|
cursor | A dataMineLib memory cursor to be crunched into a dense sigmoid XY training vector array (The dataMineLib table, which the cursor is managing, must have a field named: SpecialSituationNotes, because the SpecialSituationNotes field is used as a scratch pad by this function). |
baseExpressions | The vector of javaScript filter expressions used to reduce the table BEFORE data extraction. Selecting all cursor rows would require a baseExpression argument of: #("restore;"). |
expressionVector | The M+1 vector of javaScript filter expressions used to extract each column of data from the cursor. The M+1th expression is used to extract the values for the dependent variable, Y. |
RETURN | Always returns, Grid, the training grid estimates for the dependent variable, Y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.projectRegress function correlates the strategies in a dataMineLib miner project. Returns the sparse M coefficient vector for the strategies with the best least squares fit of the variables. The strategy names are used to construct an N by M+1 array where the M+1 column represents the dependent variable (the last strategy named in the strategy list).
Type: Function
Syntax
(math.projectRegress cursor strategyNames)
Arguments
Arguments | Explanation |
---|---|
cursor | The memory cursor from which the N by M+1 array will be extracted. |
strategyNames | The strategy names with which the N by M+1 array will be extracted. (Note: the strategy names must contain strategies tiles from the Name column of the data mine miner project). |
RETURN | The M+1 coefficient vector (0 = constant term, and e = M+1 term). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.projectToArray function returns a regression array from the cursor and project strategies specified. The strategy names are used to construct an N by M+1 array where the M+1 column represents the dependent variable (the last strategy named in the list).
Type: Function
Syntax
(math.projectToArray cursor strategyNames)
Arguments
Arguments | Explanation |
---|---|
cursor | The memory cursor from which the N by M+1 array will be extracted. |
strategyNames | The strategy names with which the N by M+1 array will be extracted. (Note: the strategy names must contain strategies tiles from the Name column of the data mine miner project). |
RETURN | The M+1 coefficient vector (0 = constant term, and e = M+1 term). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regress function returns a vector containing the coefficients resulting from a linear regression on two vectors of equal length. If x and y are vectors of equal length, then (regression x y) is: #(a b e). where a + bx = y represents the least squares best fit extracted from a comparison of the two vectors. The term e is the error ä sqr(y - (a + bx)).
Type: Function
Syntax
(math.regress X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N. |
RETURN | The coefficient vector #(a b error) containing the optimized regression terms. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressNet function returns an Lambda using the coefficients from several segmented multiple regressions.
Type: Function
Syntax
(math.regressNet X)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressNetBinaryRegress function returns an Lambda using the coefficients from several segmented multiple regressions.
Type: Function
Syntax
(math.regressNetBinaryRegress X T S Z)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
T | The column index of the target variable to segment at the top level. |
S | The maximum number of splits to segment the target variable. |
Z | The minimum number of elements in each segment of the target variable. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressNetCart2 function returns an Lambda using the coefficients from several segmented multiple regressions.
Type: Function
Syntax
(math.regressNetCart2 X T S Z)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
T | The column index of the target variable to segment at the top level. |
S | The maximum number of splits to segment the target variable. |
Z | The minimum number of elements in each segment of the target variable. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressNetCart3 function returns an Lambda using Classification Tree with 3 classes (no pruning).
Type: Function
Syntax
(math.regressNetCart3 X T S Z)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
T | The column index of the target variable of the first split. |
S | The maximum number of splits to segment the target variable. |
Z | The minimum number of elements in each segment of the target variable. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressNetMultiSegment function returns an Lambda using the coefficients from several segmented multiple regressions.
Type: Function
Syntax
(math.regressNetMultiSegment X T S Z)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
T | The column index of the target variable of the first split. |
S | The maximum number of splits to segment the target variable. |
Z | The minimum number of elements in each segment of the target variable. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressNetTwoSegment function returns an Lambda using the coefficients from several segmented multiple regressions.
Type: Function
Syntax
(math.regressNetTwoSegment X T S Z)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
T | The column index of the target variable of the first split. |
S | The maximum number of splits to segment the target variable. |
Z | The minimum number of elements in each segment of the target variable. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.regressTree function returns an Lambda using the coefficients from several segmented multiple regressions.
Type: Function
Syntax
(math.regressTree X T S Z)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
T | The column index of the target variable of the first split. |
S | The maximum number of splits to segment the target variable. |
Z | The minimum number of elements in each segment of the target variable. |
RETURN | The estimator Lambda (Lambda(x) ==> y) expecting an x input vector (length M), returning a scalar y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.sigmoidizeArray function converts the column values in an array to sigmoid values. Each array cell value is normalized by finding the positive logit value x/(1+x). Positive values of x are scaled into [.5 - 1.0]. Negative values of x are scaled into [0 - .5].
Type: Function
Syntax
(math.sigmoidizeArray X depSW)
Arguments
Arguments | Explanation |
---|---|
X | The N by M+1 array representing the original observations with the last column representing the dependent variable Y. |
depSW | (Optional) true if last column is to be unchanged. |
RETURN | The sigmoidized array (all values are positive fractions). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.smoRegress function
trains a support vector machine dual regression Lambda,
and returns the trained Lambda.
Support Vector Machine regression can be highly accurate
when solving non-linear regression problems. However, the
accuracy varies from excellent to poor depending upon
the ratio of: the chosen Gaussian Sample Size (maxSVSize);
the number of regression variables (M); and the THEORETICAL
number of variables created by the kernel function to
make the non-linear problem linearly solvable. A simplified
example would be as follows.
Solving a quadratic regression problem with variableCount == 3,
y = sum{m from 0 until variableCount}(Cm*Xm*Xm), and
a kernel function of vectorSquareInnerProduct, is very
accurate with a Gaussian Sample Size (maxSVSize) of 10.
However, if the variableCount is increased to 10, then the
accuracy completely breaks down and is not restored until
the Gaussian Sample Size is increased to around 100. An
explanation is as follows.
In order to make the quadratic regression linearly tractable,
the vectorSquareInnerProduct performs an on-the-fly squaring
of each training point vector. Thus, with a training point
vector of size three, the vectorSquareInnerProduct creates
the following on-the-fly THEORETICAL new training point:
kernel(X1,X2,X3) => (X1,X2,X3,X1*X1,X2*X2,X3*X3,X1*X2,X1*X3,X2*X3).
Clearly the problem is now linearly solvable because the squared
variables are now terms in the THEORETICAL on-the-fly linear regression
created by the kernel. NOTICE however, that the THEORETICAL linear
regression, created on-the-fly by the kernel function, has nine variables
not three variables as in the original quadratic problem. Unless the
number of training points is greater than nine, and the Gaussian
sample size is greater than nine, the on-the-fly linear regression
will not have enough data to get accurate results. (The Lambda
math.numericRegress.selfTest contains a sample test case which
demonstrates the fall in accuracy as Gaussian Sample Size is decreased).
See Cristianini, "Support Vector Machines", page 169.
Type: Function
Syntax
(math.smoRegress X Y kernelID tolerance maxErr maxGen maxSVSize verboseSW)
Arguments
Arguments | Explanation | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
X | The N by M array representing the independent variables
(must be an ObjVector of length N with each Object element being a NumVector of length M). |
||||||||||||
Y | The N vector of dependent variables. | ||||||||||||
kernelID | The kernel identifier to be used for support vector machine training.
|
||||||||||||
tolerance | (Optional) The regression error tolerance as a percent of Y (defaults to 0.1). | ||||||||||||
maxErr | (Optional) The maximum error before halting training as a percent of Y (defaults to .05). | ||||||||||||
maxGen | (Optional) The maximum generation count before halting training (defaults to 1). | ||||||||||||
maxSVSize | (Optional) The Gaussian sample size (maximum number of support vectors to use during Gaussian initialization -- defaults to 100). | ||||||||||||
verboseSW | (Optional) True iff we are to set verbose mode on (defaults to false). | ||||||||||||
RETURN | The result structure containing the trained dual regression model results, where
|
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.symbolicMath function
manages symbolic math problems. This Lambda contains
a number of expert system rules about algebra which
are used to evaluate and simplify symbolic algebra
problems.
Invoking this parent function initializes the symbolic
math system, and is a required step before using this Lambda
to perform symbolic math operations.
Type: Function
Syntax
(math.symbolicMath)
Arguments
Arguments | Explanation |
---|---|
RETURN | Always returns true. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.symbolicMath.evaluate function
manages symbolic math problems. This Lambda contains
a number of expert system rules about algebra which
are used to evaluate and simplify symbolic algebra
problems.
Invoking this parent function initializes the symbolic
math system, and is a required step before using this Lambda
to perform symbolic math operations.
Type: Function
Syntax
(math.symbolicMath.evaluate formula)
Arguments
Arguments | Explanation |
---|---|
formula | The symbolic math formula to be evaluated (in either string or list format). |
RETURN | Always returns the symbolic or numeric value of the evaluated formula. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.symbolicRegress function
returns a regression estimator function with numeric coefficients
optimized against the specified objective function. The
regression is nonlinear and will minimize any objective function.
Neither the estimator function nor the objective function
are required to be continuous.
This Lambda uses three search technologies for estimator function
optimization: multivariate regression, neural net regression,
and genetic algorithm regression. Genetic algorithms learn
faster when the input data has been crunched into the sigmoid
or the closed bipolar domain. The neural net regression requires
that the input data be crunched into the sigmoid domain.
Multivariate regression is deterministic and absolutely accurate,
but limited in scope. Both genetic algorithms and neural nets are
nondeterministic and only appoximately accurate, but are general
in scope. Please see the _selfTest child Lambda for an introduction
to the use and accuracy of these various regression techniques in
a wide range of sample problem domains.
The regression estimator function maps a number vector, of length M,
into a single real number, Rf: Xm --> R, whose coefficients
are optimized. The estimator function is in the form of
an Lambda, (Rf mVector) ==> aNumber, and the coefficients
to be optimized are stored as a number vector Rf.C
in the persistant variables of the Rf Lambda.
Note: The returned estimator function, Rf, will be an Lambda containing
the following persistant (pvars) variables:
C | A number vector containing the coefficients to optimize | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Error | The final score from the objective function | ||||||||||||||
G | The final generation count when optimization halted | ||||||||||||||
Objective | The objective function which maps an N by M+1 observation matrix, w, using it's parent estimator function, Rf, into a single positive real error value. The objective function is in the form of a child Lambda, (Rf.Objective w) ==> anErrorNumber. The symbolicRegress Lambda attempts to optimize the estimator function coefficients, Rf.C, such that the objective function's resulting error value is minimized. | ||||||||||||||
P | The final population count when optimization halted | ||||||||||||||
Strategy | The optimization strategy to use: | ||||||||||||||
|
Type: Function
Syntax
(math.symbolicRegress XY Gmax err)
Arguments
Arguments | Explanation |
---|---|
XY | The N by M+1 array representing the original observations with the M+1th column being the dependent variable. |
Gmax | The maximum number of optimization trials (generations) to attempt before returning the best set of coefficients available at that time. |
err | A minimum error value which would terminate further optimization trials and return the best set of coefficients at that time. |
RETURN | Always returns a regression estimator function, Rf. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorAdd function returns the sum of two vectors or of a vector and a constant. If x and y are vectors of equal length, then x+y is: #(x[0]+y[0] x[1]+y[1] .... x[N]+y[N]). If x is a vector and y is a constant, then x+y is: #(x[0]+y x[1]+y .... x[N]+y).
Type: Function
Syntax
(math.vectorAdd X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N or a constant. |
RETURN | Always returns the vector sum of x+y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorDeltas function
converts an N vector into an N-1 vector of deltas.
If x is: x[0] x[1] .... x[N], then result is: (x[1]-x[0]) (x[2]-x[1]) .... (x[N]-x[N-1]).
Type: Function
Syntax
(math.vectorDeltas Y)
Arguments
Arguments | Explanation |
---|---|
Y | A vector of length N. |
RETURN | An N-1 vector of deltas. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorDeltaPercents function
converts an N vector into an N-1 vector of deltas (expressed as percent differences).
If x is: x[0] x[1] .... x[N], then result is: (x[1]/x[0])-1 (x[2]/x[1])-1 .... (x[N]/x[N-1])-1.
Note: Where ever x[n] == 0, then x[n+1]/x[n] == x[n+1].
Type: Function
Syntax
(math.vectorDeltaPercents Y)
Arguments
Arguments | Explanation |
---|---|
Y | A vector of length N. |
RETURN | An N-1 vector of deltas (expressed as percent differences). |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorDivide function
returns the quotient of two vectors or of a vector and a constant.
If x and y are vectors of equal length, then xøy is: #(x[0]/y[0] x[1]/y[1] .... x[N]/y[N]).
If x is a vector and y is a constant, then xøy is: #(x[0]/y x[1]/y .... x[N]/y).
Type: Function
Syntax
(math.vectorDivide X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N or a constant. |
RETURN | The vector quotient of x and y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorDotProduct function
returns the inner (dot) product of two vectors.
If x and y are vectors of equal length, then x*y is: x[0]y[0] + x[1]y[1] + .... x[N]y[N].
Type: Function
Syntax
(math.vectorDotProduct X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N. |
RETURN | The vector inner (dot) product of x and y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorProduct function
returns the product of two vectors or of a vector and a constant.
If x and y are vectors of equal length, then x*y is: #(x[0]y[0] x[1]y[1] .... x[N]y[N]).
If x is a vector and y is a constant, then x*y is: #(x[0]y x[1]y .... x[N]y).
Type: Function
Syntax
(math.vectorProduct X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N or a constant. |
RETURN | The vector product of x and y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]
Overview
The math.vectorSub function
returns the difference of two vectors or of a vector and a constant.
If x and y are vectors of equal length, then x-y is: #(x[0]-y[0] x[1]-y[1] .... x[N]-y[N]).
If x is a vector and y is a constant, then x-y is: #(x[0]-y x[1]-y .... x[N]-y).
Type: Function
Syntax
(math.vectorSub X Y)
Arguments
Arguments | Explanation |
---|---|
X | A vector of length N. |
Y | A vector of length N or a constant. |
RETURN | The vector difference of x and y. |
When To Use
[...under construction...]
Example
[...under construction...]
Notes & Hints
[...under construction...]