Namespace: math

planBuilder. math

Builds expressions to call functions in the math server library for a row pipeline.
Since:
  • 2.1.1

Methods


acos(x) → {XsDouble}

Returns the arc cosine of x, in radians, in the range from 0 to pi (inclusive). Provides a client interface to a server function. See math.acos
Parameters:
Name Type Argument Description
x XsDouble <optional>
The fraction to be evaluated. Must be in the range of -1 to +1 (inclusive).
Since:
  • 2.1.1
Returns:
Type
XsDouble

asin(x) → {XsDouble}

Returns the arc sine of x, in radians, in the range from -pi/2 to +pi/2 (inclusive). Provides a client interface to a server function. See math.asin
Parameters:
Name Type Argument Description
x XsDouble <optional>
The fraction to be evaluated. Must be in the range of -1 to +1 (inclusive).
Since:
  • 2.1.1
Returns:
Type
XsDouble

atan(x) → {XsDouble}

Returns the arc tangent of x, in radians. in the range from -pi/2 to +pi/2 (inclusive). Provides a client interface to a server function. See math.atan
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

atan2(y, x) → {XsDouble}

Returns the arc tangent of y/x, in radians, in the range from -pi/2 to +pi/2 (inclusive), using the signs of y and x to determine the appropriate quadrant. Provides a client interface to a server function. See math.atan2
Parameters:
Name Type Argument Description
y XsDouble <optional>
The floating point dividend.
x XsDouble <optional>
The floating point divisor.
Since:
  • 2.1.1
Returns:
Type
XsDouble

ceil(x) → {XsDouble}

Returns the smallest integer greater than or equal to x. Provides a client interface to a server function. See math.ceil
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

correlation(arg) → {XsDouble}

Returns the Pearson correlation coefficient of a data set. The size of the input array should be 2. The function eliminates all pairs for which either the first element or the second element is empty. After the elimination, if the length of the input is less than 2, the function returns the empty sequence. After the elimination, if the standard deviation of the first column or the standard deviation of the second column is 0, the function returns the empty sequence. Provides a client interface to a server function. See math.correlation
Parameters:
Name Type Argument Description
arg JsonArray <optional>
The input data set. Each array should contain a pair of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

cos(x) → {XsDouble}

Returns the cosine of x, in the range from -1 to +1 (inclusive). Provides a client interface to a server function. See math.cos
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

cosh(x) → {XsDouble}

Returns the hyperbolic cosine of x. Provides a client interface to a server function. See math.cosh
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

cot(x) → {XsDouble}

Returns the cotangent of x. Provides a client interface to a server function. See math.cot
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

covariance(arg) → {XsDouble}

Returns the sample covariance of a data set. The size of the input array should be 2. The function eliminates all pairs for which either the first element or the second element is empty. After the elimination, if the length of the input is less than 2, the function returns the empty sequence. Provides a client interface to a server function. See math.covariance
Parameters:
Name Type Argument Description
arg JsonArray <optional>
The input data set. Each array should contain a pair of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

covarianceP(arg) → {XsDouble}

Returns the population covariance of a data set. The size of the input array should be 2. The function eliminates all pairs for which either the first element or the second element is empty. After the elimination, if the length of the input is 0, the function returns the empty sequence. Provides a client interface to a server function. See math.covarianceP
Parameters:
Name Type Argument Description
arg JsonArray <optional>
The input data set. Each array should contain a pair of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

degrees(x) → {XsDouble}

Returns numeric expression converted from radians to degrees. Provides a client interface to a server function. See math.degrees
Parameters:
Name Type Argument Description
x XsDouble <optional>
An angle expressed in radians.
Since:
  • 2.1.1
Returns:
Type
XsDouble

exp(x) → {XsDouble}

Returns e (approximately 2.71828182845905) to the xth power. Provides a client interface to a server function. See math.exp
Parameters:
Name Type Argument Description
x XsDouble <optional>
The exponent to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

fabs(x) → {XsDouble}

Returns the absolute value of x. Provides a client interface to a server function. See math.fabs
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

floor(x) → {XsDouble}

Returns the largest integer less than or equal to x. Provides a client interface to a server function. See math.floor
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

fmod(x, y) → {XsDouble}

Returns the remainder of x/y. Provides a client interface to a server function. See math.fmod
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point dividend.
y XsDouble <optional>
The floating point divisor.
Since:
  • 2.1.1
Returns:
Type
XsDouble

frexp(x) → {Item}

Returns x broken up into mantissa and exponent, where x = mantissa*2^exponent. Provides a client interface to a server function. See math.frexp
Parameters:
Name Type Argument Description
x XsDouble <optional>
The exponent to be evaluated.
Since:
  • 2.1.1
Returns:
Type
Item

ldexp(y, i) → {XsDouble}

Returns x*2^i. Provides a client interface to a server function. See math.ldexp
Parameters:
Name Type Argument Description
y XsDouble <optional>
The floating-point number to be multiplied.
i XsInteger <optional>
The exponent integer.
Since:
  • 2.1.1
Returns:
Type
XsDouble

linearModel(arg) → {MathLinearModel}

Returns a linear model that fits the given data set. The size of the input array should be 2, as currently only simple linear regression model is supported. The first element of the array should be the value of the dependent variable while the other element should be the value of the independent variable. Provides a client interface to a server function. See math.linearModel
Parameters:
Name Type Argument Description
arg JsonArray <optional>
The input data set. Each array should contain a pair of values.
Since:
  • 2.1.1
Returns:
Type
MathLinearModel

linearModelCoeff(linearModel) → {XsDouble}

Returns the coefficients of the linear model. Currently only simple linear regression model is supported so the return should contain only one coefficient (also called "slope"). Provides a client interface to a server function. See math.linearModelCoeff
Parameters:
Name Type Argument Description
linearModel MathLinearModel <optional>
A linear model.
Since:
  • 2.1.1
Returns:
Type
XsDouble

linearModelIntercept(linearModel) → {XsDouble}

Returns the intercept of the linear model. Provides a client interface to a server function. See math.linearModelIntercept
Parameters:
Name Type Argument Description
linearModel MathLinearModel <optional>
A linear model.
Since:
  • 2.1.1
Returns:
Type
XsDouble

linearModelRsquared(linearModel) → {XsDouble}

Returns the R^2 value of the linear model. Provides a client interface to a server function. See math.linearModelRsquared
Parameters:
Name Type Argument Description
linearModel MathLinearModel <optional>
A linear model.
Since:
  • 2.1.1
Returns:
Type
XsDouble

log(x) → {XsDouble}

Returns the base-e logarithm of x. Provides a client interface to a server function. See math.log
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

log10(x) → {XsDouble}

Returns the base-10 logarithm of x. Provides a client interface to a server function. See math.log10
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

median(arg) → {XsDouble}

Returns the median of a sequence of values. The function returns the empty sequence if the input is the empty sequence. Provides a client interface to a server function. See math.median
Parameters:
Name Type Argument Description
arg XsDouble <optional>
The sequence of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

mode(arg, options) → {XsAnyAtomicType}

Returns the mode of a sequence. The mode is the value that occurs most frequently in a data set. If no value occurs more than once in the data set, the function returns the empty sequence. If the input is the empty sequence, the function returns the empty sequence. Provides a client interface to a server function. See math.mode
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The sequence of values.
options XsString <optional>
Options. The default is (). Options include: "collation=URI" Applies only when $arg is of the xs:string type. If no specified, the default collation is used. "coordinate-system=name" Applies only when $arg is of the cts:point type. If no specified, the default coordinate system is used.
Since:
  • 2.1.1
Returns:
Type
XsAnyAtomicType

modf(x) → {XsDouble}

Returns x broken up into fraction and integer. x = fraction+integer. Provides a client interface to a server function. See math.modf
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

percentRank(arg, value, options) → {XsDouble}

Returns the rank of a value in a data set as a percentage of the data set. If the given value is not equal to any item in the sequence, the function returns the empty sequence. See math:rank. Provides a client interface to a server function. See math.percentRank
Parameters:
Name Type Argument Description
arg XsAnyAtomicType <optional>
The sequence of values.
value XsAnyAtomicType <optional>
The value to be "ranked".
options XsString <optional>
Options. The default is (). Options include: "ascending"(default) Rank the value as if the sequence was sorted in ascending order. "descending" Rank the value as if the sequence was sorted in descending order. "collation=URI" Applies only when $arg is of the xs:string type. If no specified, the default collation is used. "coordinate-system=name" Applies only when $arg is of the cts:point type. If no specified, the default coordinate system is used.
Since:
  • 2.1.1
Returns:
Type
XsDouble

percentile(arg, p) → {XsDouble}

Returns a sequence of percentile(s) given a sequence of percentage(s). The function returns the empty sequence if either arg or p is the empty sequence. Provides a client interface to a server function. See math.percentile
Parameters:
Name Type Argument Description
arg XsDouble <optional>
The sequence of values to calculate the percentile(s) on.
p XsDouble <optional>
The sequence of percentage(s).
Since:
  • 2.1.1
Returns:
Type
XsDouble

pi() → {XsDouble}

Returns the value of pi. Provides a client interface to a server function. See math.pi
Since:
  • 2.1.1
Returns:
Type
XsDouble

pow(x, y) → {XsDouble}

Returns x^y. Provides a client interface to a server function. See math.pow
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating-point base number.
y XsDouble <optional>
The exponent to be applied to x.
Since:
  • 2.1.1
Returns:
Type
XsDouble

radians(x) → {XsDouble}

Returns numeric expression converted from degrees to radians. Provides a client interface to a server function. See math.radians
Parameters:
Name Type Argument Description
x XsDouble <optional>
An angle expressed in degrees.
Since:
  • 2.1.1
Returns:
Type
XsDouble

rank(arg1, arg2, options) → {XsInteger}

Returns the rank of a value in a data set. Ranks are skipped in the event of ties. If the given value is not equal to any item in the sequence, the function returns the empty sequence. The function can be used on numeric values, xs:yearMonthDuration, xs:dayTimeDuration, xs:string, xs:anyURI, xs:date, xs:dateTime, xs:time, and cts:point. Provides a client interface to a server function. See math.rank
Parameters:
Name Type Argument Description
arg1 XsAnyAtomicType <optional>
The sequence of values.
arg2 XsAnyAtomicType <optional>
The value to be "ranked".
options XsString <optional>
Options. The default is (). Options include: "ascending"(default) Rank the value as if the sequence was sorted in ascending order. "descending" Rank the value as if the sequence was sorted in descending order. "collation=URI" Applies only when $arg is of the xs:string type. If no specified, the default collation is used. "coordinate-system=name" Applies only when $arg is of the cts:point type. If no specified, the default coordinate system is used.
Since:
  • 2.1.1
Returns:
Type
XsInteger

sin(x) → {XsDouble}

Returns the sine of x, in the range from -1 to +1 (inclusive). Provides a client interface to a server function. See math.sin
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

sinh(x) → {XsDouble}

Returns the hyperbolic sine of x. Provides a client interface to a server function. See math.sinh
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

sqrt(x) → {XsDouble}

Returns the square root of x. Provides a client interface to a server function. See math.sqrt
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

stddev(arg) → {XsDouble}

Returns the sample standard deviation of a sequence of values. The function returns the empty sequence if the length of the input sequence is less than 2. Provides a client interface to a server function. See math.stddev
Parameters:
Name Type Argument Description
arg XsDouble <optional>
The sequence of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

stddevP(arg) → {XsDouble}

Returns the standard deviation of a population. The function returns the empty sequence if the input is the empty sequence. Provides a client interface to a server function. See math.stddevP
Parameters:
Name Type Argument Description
arg XsDouble <optional>
The sequence of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

tan(x) → {XsDouble}

Returns the tangent of x. Provides a client interface to a server function. See math.tan
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

tanh(x) → {XsDouble}

Returns the hyperbolic tangent of x, in the range from -1 to +1 (inclusive). Provides a client interface to a server function. See math.tanh
Parameters:
Name Type Argument Description
x XsDouble <optional>
The floating point number to be evaluated.
Since:
  • 2.1.1
Returns:
Type
XsDouble

trunc(arg, n) → {XsNumeric}

Returns the number truncated to a certain number of decimal places. If type of arg is one of the four numeric types xs:float, xs:double, xs:decimal or xs:integer the type of the result is the same as the type of arg. If the type of arg is a type derived from one of the numeric types, the result is an instance of the base numeric type. Provides a client interface to a server function. See math.trunc
Parameters:
Name Type Argument Description
arg XsNumeric <optional>
A numeric value to truncate.
n XsInteger <optional>
The numbers of decimal places to truncate to. The default is 0. Negative values cause that many digits to the left of the decimal point to be truncated.
Since:
  • 2.1.1
Returns:
Type
XsNumeric

variance(arg) → {XsDouble}

Returns the sample variance of a sequence of values. The function returns the empty sequence if the length of the input sequence is less than 2. Provides a client interface to a server function. See math.variance
Parameters:
Name Type Argument Description
arg XsDouble <optional>
The sequence of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble

varianceP(arg) → {XsDouble}

Returns the population variance of a sequence of values. The function returns the empty sequence if the input is the empty sequence. Provides a client interface to a server function. See math.varianceP
Parameters:
Name Type Argument Description
arg XsDouble <optional>
The sequence of values.
Since:
  • 2.1.1
Returns:
Type
XsDouble
Copyright (c) 2020 MarkLogic Corporation Documentation generated by JSDoc 4.0.0 on 2024-08-20T21:35:26-07:00 using the DocStrap template.