Oracle® CEP CQL Language Reference 11g Release 1 (11.1.1) Part Number E12048-01 |
|
|
View PDF |
Oracle CQL provides a variety of built-in single-row functions based on the Colt open source libraries for high performance scientific and technical computing.
For more information, see Section 1.1.9, "Functions".
Table 7-1 lists the built-in single-row Colt functions that Oracle CQL provides.
Table 7-1 Oracle CQL Built-in Single-Row Colt-Based Functions
Colt Package | Function |
---|---|
A set of basic polynomials, rounding, and calculus functions. |
|
A set of Bessel functions. |
|
A table with good seeds for pseudo-random number generators. Each sequence in this table has a period of 10**9 numbers. |
|
A set of Gamma and Beta functions. |
|
A set of probability distributions. |
|
A set of non polymorphic, non bounds checking, low level bit-vector functions. |
|
A set of hash functions. |
Note:
In stream input examples, lines beginning withh
(such as h 3800
) are heartbeat input tuples. These inform Oracle CEP that no further input will have a timestamp lesser than the heartbeat value.For more information, see:
Syntax
Purpose
BETA
is based on cern.jet.stat.Gamma
. It returns the beta function (see Figure 7-1) of the input arguments as a double
.
This function takes the following arguments:
double1
: the x
value.
double2
: the y
value.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Gamma.html#beta(double,%20double)
.
Examples
Consider the query qColt28
in Example 7-1. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-2, the query returns the relation in Example 7-3.
Example 7-1 BETA Function Query
<query id="qColt28"><![CDATA[ select beta(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
BETA1
is based on cern.jet.stat.Probability
. It returns the area P(x)
from 0
to x
under the beta density function (see Figure 7-2) as a double
.
This function takes the following arguments:
double1
: the alpha parameter of the beta distribution a
.
double2
: the beta parameter of the beta distribution b
.
double3
: the integration end point x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#beta(double,%20double,%20double)
.
Examples
Consider the query qColt35
in Example 7-4. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-5, the query returns the relation in Example 7-6.
Example 7-4 BETA1 Function Query
<query id="qColt35"><![CDATA[ select beta1(c2,c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
BETACOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the area under the right hand tail (from x
to infinity) of the beta density function (see Figure 7-2) as a double
.
This function takes the following arguments:
double1
: the alpha parameter of the beta distribution a
.
double2
: the beta parameter of the beta distribution b
.
double3
: the integration end point x
.
For more information, see:
Examples
Consider the query qColt37
in Example 7-7. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-8, the query returns the relation in Example 7-9.
Example 7-7 BETACOMPLEMENTED Function Query
<query id="qColt37"><![CDATA[ select betaComplemented(c2,c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
BINOMIAL
is based on cern.jet.math.Arithmetic
. It returns the binomial coefficient n
over k
(see Figure 7-3) as a double
.
This function takes the following arguments:
double1
: the n
value.
long2
: the k
value.
Table 7-2 lists the BINOMIAL
function return values for various values of k
.
Table 7-2 cern.jet.math.Arithmetic Binomial Return Values
Arguments | Return Value |
---|---|
|
0 |
|
1 |
|
|
Any other value of |
Computed binomial coefficient as given in Figure 7-3. |
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#binomial(double,%20long)
.
Examples
Consider the query qColt6
in Example 7-10. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 long)
in Example 7-11, the query returns the relation in Example 7-12.
Example 7-10 BINOMIAL Function Query
<query id="qColt6"><![CDATA[ select binomial(c2,c3) from SColtFunc ]]></query>
Syntax
Purpose
BINOMIAL1
is based on cern.jet.math.Arithmetic
. It returns the binomial coefficient n
over k
(see Figure 7-3) as a double
.
This function takes the following arguments:
long1
: the n
value.
long2
: the k
value.
Table 7-3 lists the BINOMIAL
function return values for various values of k
.
Table 7-3 cern.jet.math.Arithmetic Binomial1 Return Values
Arguments | Return Value |
---|---|
|
0 |
|
1 |
|
|
Any other value of |
Computed binomial coefficient as given in Figure 7-3. |
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#binomial(long,%20long)
.
Examples
Consider the query qColt7
in Example 7-13. Given the data stream SColtFunc
with schema (c1 integer, c2 float, c3 long)
in Example 7-14, the query returns the relation in Example 7-15.
Example 7-13 BINOMIAL1 Function Query
<query id="qColt7"><![CDATA[ select binomial1(c3,c3) from SColtFunc ]]></query>
Syntax
Purpose
BINOMIAL2
is based on cern.jet.stat.Probability
. It returns the sum of the terms 0 through k
of the binomial probability density (see Figure 7-4) as a double
.
This function takes the following arguments (all arguments must be positive):
integer1
: the end term k
.
integer2
: the number of trials n
.
double3
: the probability of success p
in (0.0, 1.0)
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#binomial(int,%20int,%20double)
.
Examples
Consider the query qColt34
in Example 7-16. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-17, the query returns the relation in Example 7-18.
Example 7-16 BINOMIAL2 Function Query
<query id="qColt34"><![CDATA[ select binomial2(c1,c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
BINOMIALCOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the sum of the terms k+1
through n
of the binomial probability density (see Figure 7-5) as a double
.
This function takes the following arguments (all arguments must be positive):
integer1
: the end term k
.
integer2
: the number of trials n
.
double3
: the probability of success p
in (0.0, 1.0)
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#binomialComplemented(int,%20int,%20double)
.
Examples
Consider the query qColt38
in Example 7-19. Given the data stream SColtFunc
with schema (integer, c2 double, c3 bigint)
in Example 7-20, the query returns the relation in Example 7-21.
Example 7-19 BINOMIALCOMPLEMENTED Function Query
<query id="qColt38"><![CDATA[ select binomialComplemented(c1,c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
BITMASKWITHBITSSETFROMTO
is based on cern.colt.bitvector.QuickBitVector
. It returns a 64-bit wide bit mask as a long
with bits in the specified range set to 1 and all other bits set to 0.
This function takes the following arguments:
integer1
: the from
value; index of the start bit (inclusive).
integer2
: the to
value; index of the end bit (inclusive).
Precondition (not checked): to
- from
+ 1 >= 0 && to
- from
+ 1 <= 64.
If to
- from
+ 1 = 0 then returns a bit mask with all bits set to 0.
For more information, see:
Examples
Consider the query qColt53
in Example 7-22. Given the data stream SColtFunc
with schema (c1 integer, c2 float, c3 bigint)
in Example 7-23, the query returns the relation in Example 7-24.
Example 7-22 BITMASKWITHBITSSETFROMTO Function Query
<query id="qColt53"><![CDATA[ select bitMaskWithBitsSetFromTo(c1,c1) from SColtFunc ]]></query>
Syntax
Purpose
CEIL
is based on cern.jet.math.Arithmetic
. It returns the smallest long
greater than or equal to its double
argument.
This method is safer than using (float) java.lang.Math.ceil(long)
because of possible rounding error.
For more information, see:
Examples
Consider the query qColt1
in Example 7-25. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-26, the query returns the relation in Example 7-27.
Example 7-25 CEIL Function Query
<query id="qColt1"><![CDATA[ select ceil(c2) from SColtFunc ]]></query>
Syntax
Purpose
CHISQUARE
is based on cern.jet.stat.Probability
. It returns the area under the left hand tail (from 0 to x
) of the Chi square probability density function with v
degrees of freedom (see Figure 7-6) as a double
.
This function takes the following arguments (all arguments must be positive):
double1
: the degrees of freedom v
.
double2
: the integration end point x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#chiSquare(double,%20double)
.
Examples
Consider the query qColt39
in Example 7-28. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-29, the query returns the relation in Example 7-30.
Example 7-28 CHISQUARE Function Query
<query id="qColt39"><![CDATA[ select chiSquare(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
CHISQUARECOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the area under the right hand tail (from x
to infinity) of the Chi square probability density function with v
degrees of freedom (see Figure 7-6) as a double
.
This function takes the following arguments (all arguments must be positive):
double1
: the degrees of freedom v
.
double2
: the integration end point x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#chiSquareComplemented(double,%20double)
.
Examples
Consider the query qColt40
in Example 7-31. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-32, the query returns the relation in Example 7-33.
Example 7-31 CHISQUARECOMPLEMENTED Function Query
<query id="qColt40"><![CDATA[ select chiSquareComplemented(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
ERRORFUNCTION
is based on cern.jet.stat.Probability
. It returns the error function of the normal distribution of the double
argument as a double
, using the integral that Figure 7-7 shows.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#errorFunction(double)
.
Examples
Consider the query qColt41
in Example 7-34. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-35, the query returns the relation in Example 7-36.
Example 7-34 ERRORFUNCTION Function Query
<query id="qColt41"><![CDATA[ select errorFunction(c2) from SColtFunc ]]></query>
Syntax
Purpose
ERRORFUNCTIONCOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the complementary error function of the normal distribution of the double
argument as a double
, using the integral that Figure 7-8 shows.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#errorFunctionComplemented(double)
.
Examples
Consider the query qColt42
in Example 7-37. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-38, the query returns the relation in Example 7-39.
Example 7-37 ERRORFUNCTIONCOMPLEMENTED Function Query
<query id="qColt42"><![CDATA[ select errorFunctionComplemented(c2) from SColtFunc ]]></query>
Syntax
Purpose
FACTORIAL
is based on cern.jet.math.Arithmetic
. It returns the factorial of the positive integer
argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#factorial(int)
.
Examples
Consider the query qColt8
in Example 7-40. Given the data stream SColtFunc
with schema (c1 integer, c2 float, c3 bigint)
in Example 7-41, the query returns the relation in Example 7-42.
Example 7-40 FACTORIAL Function Query
<query id="qColt8"><![CDATA[ select factorial(c1) from SColtFunc ]]></query>
Syntax
Purpose
FLOOR
is based on cern.jet.math.Arithmetic
. It returns the largest long
value less than or equal to the double
argument.
This method is safer than using (double) java.lang.Math.floor(double)
because of possible rounding error.
For more information, see:
Examples
Consider the query qColt2
in Example 7-43. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-44, the query returns the relation in Example 7-45.
Example 7-43 FLOOR Function Query
<query id="qColt2"><![CDATA[ select floor(c2) from SColtFunc ]]></query>
Syntax
Purpose
GAMMA
is based on cern.jet.stat.Gamma
. It returns the Gamma function of the double
argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Gamma.html#gamma(double)
.
Examples
Consider the query qColt29
in Example 7-46. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-47, the query returns the relation in Example 7-48.
Example 7-46 GAMMA Function Query
<query id="qColt29"><![CDATA[ select gamma(c2) from SColtFunc ]]></query>
Syntax
Purpose
GAMMA1
is based on cern.jet.stat.Probability
. It returns the integral from zero to x
of the gamma probability density function (see Figure 7-9) as a double
.
This function takes the following arguments:
double1
: the gamma distribution alpha value a
double2
: the gamma distribution beta or lambda value b
double3
: the integration end point x
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#gamma(double,%20double,%20double)
.
Examples
Consider the query qColt36
in Example 7-49. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-50, the query returns the relation in Example 7-51.
Example 7-49 GAMMA1 Function Query
<query id="qColt36"><![CDATA[ select gamma1(c2,c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
GAMMACOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the integral from x
to infinity of the gamma probability density function (see Figure 7-10) as a double
.
This function takes the following arguments:
double1
: the gamma distribution alpha value a
double2
: the gamma distribution beta or lambda value b
double3
: the integration end point x
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#gammaComplemented(double,%20double,%20double)
.
Examples
Consider the query qColt43
in Example 7-52. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-53, the query returns the relation in Example 7-54.
Example 7-52 GAMMACOMPLEMENTED Function Query
<query id="qColt43"><![CDATA[ select gammaComplemented(c2,c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
GETSEEDATROWCOLUMN
is based on cern.jet.random.engine.RandomSeedTable
. It returns a deterministic seed as an integer
from a (seemingly gigantic) matrix of predefined seeds.
This function takes the following arguments:
integer1
: the row
value; should (but need not) be in [0,Integer.MAX_VALUE]
.
integer2
: the column
value; should (but need not) be in [0,1]
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/random/engine/RandomSeedTable.html#getSeedAtRowColumn(int,%20int)
.
Examples
Consider the query qColt27
in Example 7-55. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-56, the query returns the relation in Example 7-57.
Example 7-55 GETSEEDATROWCOLUMN Function Query
<query id="qColt27"><![CDATA[ select getSeedAtRowColumn(c1,c1) from SColtFunc ]]></query>
Syntax
Purpose
HASH
is based on cern.colt.map.HashFunctions
. It returns an integer
hashcode for the specified double
value.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/colt/map/HashFunctions.html#hash(double)
.
Examples
Consider the query qColt56
in Example 7-58. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-59, the query returns the relation in Example 7-60.
Example 7-58 HASH Function Query
<query id="qColt56"><![CDATA[ select hash(c2) from SColtFunc ]]></query>
Syntax
Purpose
HASH1
is based on cern.colt.map.HashFunctions
. It returns an integer
hashcode for the specified float
value.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/colt/map/HashFunctions.html#hash(float)
.
Examples
Consider the query qColt57
in Example 7-61. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-62, the query returns the relation in Example 7-63.
Example 7-61 HASH1 Function Query
<query id="qColt57"><![CDATA[ select hash1(c2) from SColtFunc ]]></query>
Syntax
Purpose
HASH2
is based on cern.colt.map.HashFunctions
. It returns an integer
hashcode for the specified integer
value.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/colt/map/HashFunctions.html#hash(int)
.
Examples
Consider the query qColt58
in Example 7-64. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-65, the query returns the relation in Example 7-66.
Example 7-64 HASH2 Function Query
<query id="qColt58"><![CDATA[ select hash2(c1) from SColtFunc ]]></query>
Syntax
Purpose
HASH3
is based on cern.colt.map.HashFunctions
. It returns an integer
hashcode for the specified long
value.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/colt/map/HashFunctions.html#hash(long)
.
Examples
Consider the query qColt59
in Example 7-67. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-68, the query returns the relation in Example 7-69.
Example 7-67 HASH3 Function Query
<query id="qColt59"><![CDATA[ select hash3(c3) from SColtFunc ]]></query>
Syntax
Purpose
I0
is based on cern.jet.math.Bessel
. It returns the modified Bessel function of order 0 of the double
argument as a double
.
The function is defined as i0(x) = j0(ix)
.
The range is partitioned into the two intervals [0,8]
and (8,infinity)
.
For more information, see:
Examples
Consider the query qColt12
in Example 7-70. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-71, the query returns the relation in Example 7-72.
Example 7-70 I0 Function Query
<query id="qColt12"><![CDATA[ select i0(c2) from SColtFunc ]]></query>
Syntax
Purpose
I0E
is based on cern.jet.math.Bessel
. It returns the exponentially scaled modified Bessel function of order 0 of the double
argument as a double
.
The function is defined as: i0e(x) = exp(-|x|) j0(ix)
.
For more information, see:
Examples
Consider the query qColt13
in Example 7-73. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-74, the query returns the relation in Example 7-75.
Example 7-73 I0E Function Query
<query id="qColt13"><![CDATA[ select i0e(c2) from SColtFunc ]]></query>
Syntax
Purpose
I1
is based on cern.jet.math.Bessel
. It returns the modified Bessel function of order 1 of the double
argument as a double
.
The function is defined as: i1(x) = -i j1(ix)
.
The range is partitioned into the two intervals [0,8]
and (8,infinity)
. Chebyshev polynomial expansions are employed in each interval.
For more information, see:
Examples
Consider the query qColt14
in Example 7-76. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-77, the query returns the relation in Example 7-78.
Example 7-76 I1 Function Query
<query id="qColt14"><![CDATA[ select i1(c2) from SColtFunc ]]></query>
Syntax
Purpose
I1E
is based on cern.jet.math.Bessel
. It returns the exponentially scaled modified Bessel function of order 1 of the double
argument as a double
.
The function is defined as i1(x) = -i exp(-|x|) j1(ix)
.
For more information, see
Examples
Consider the query qColt15
in Example 7-79. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-80, the query returns the relation in Example 7-81.
Example 7-79 I1E Function Query
<query id="qColt15"><![CDATA[ select i1e(c2) from SColtFunc ]]></query>
Syntax
Purpose
INCOMPLETEBETA
is based on cern.jet.stat.Gamma
. It returns the Incomplete Beta Function evaluated from zero to x
as a double
.
This function takes the following arguments:
double1
: the beta distribution alpha value a
double2
: the beta distribution beta value b
double3
: the integration end point x
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Gamma.html#incompleteBeta(double,%20double,%20double)
.
Examples
Consider the query qColt30
in Example 7-82. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-83, the query returns the relation in Example 7-84.
Example 7-82 INCOMPLETEBETA Function Query
<query id="qColt30"><![CDATA[ select incompleteBeta(c2,c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
INCOMPLETEGAMMA
is based on cern.jet.stat.Gamma
. It returns the Incomplete Gamma function of the arguments as a double
.
This function takes the following arguments:
double1
: the gamma distribution alpha value a
.
double2
: the integration end point x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Gamma.html#incompleteGamma(double,%20double)
.
Examples
Consider the query qColt31
in Example 7-85. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-86, the query returns the relation in Example 7-87.
Example 7-85 INCOMPLETEGAMMA Function Query
<query id="qColt31"><![CDATA[ select incompleteGamma(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
INCOMPLETEGAMMACOMPLEMENT
is based on cern.jet.stat.Gamma
. It returns the Complemented Incomplete Gamma function of the arguments as a double
.
This function takes the following arguments:
double1
: the gamma distribution alpha value a
.
double2
: the integration start point x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Gamma.html#incompleteGammaComplement(double,%20double)
.
Examples
Consider the query qColt32
in Example 7-88. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-89, the query returns the relation in Example 7-90.
Example 7-88 INCOMPLETEGAMMACOMPLEMENT Function Query
<query id="qColt32"><![CDATA[ select incompleteGammaComplement(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
J0
is based on cern.jet.math.Bessel
. It returns the Bessel function of the first kind of order 0 of the double
argument as a double
.
For more information, see
http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#j0(double)
Examples
Consider the query qColt16
in Example 7-91. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-92, the query returns the relation in Example 7-93.
Example 7-91 J0 Function Query
<query id="qColt16"><![CDATA[ select j0(c2) from SColtFunc ]]></query>
Syntax
Purpose
J1
is based on cern.jet.math.Bessel
. It returns the Bessel function of the first kind of order 1 of the double
argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#j1(double)
.
Examples
Consider the query qColt17
in Example 7-94. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-95, the query returns the relation in Example 7-96.
Example 7-94 J1 Function Query
<query id="qColt17"><![CDATA[ select j1(c2) from SColtFunc ]]></query>
Syntax
Purpose
JN
is based on cern.jet.math.Bessel
. It returns the Bessel function of the first kind of order n
of the argument as a double
.
This function takes the following arguments:
integer1
: the order of the Bessel function n
.
double2
: the value to compute the bessel function of x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#jn(int,%20double)
.
Examples
Consider the query qColt18
in Example 7-97. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-98, the query returns the relation in Example 7-99.
Example 7-97 JN Function Query
<query id="qColt18"><![CDATA[ select jn(c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
K0
is based on cern.jet.math.Bessel
. It returns the modified Bessel function of the third kind of order 0 of the double
argument as a double
.
The range is partitioned into the two intervals [0,8]
and (8, infinity)
. Chebyshev polynomial expansions are employed in each interval.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#k0(double)
.
Examples
Consider the query qColt19
in Example 7-100. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-101, the query returns the relation in Example 7-102.
Example 7-100 K0 Function Query
<query id="qColt19"><![CDATA[ select k0(c2) from SColtFunc ]]></query>
Syntax
Purpose
K0E
is based on cern.jet.math.Bessel
. It returns the exponentially scaled modified Bessel function of the third kind of order 0 of the double
argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#k0e(double)
.
Examples
Consider the query qColt20
in Example 7-103. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-104, the query returns the relation in Example 7-105.
Example 7-103 K0E Function Query
<query id="qColt20"><![CDATA[ select k0e(c2) from SColtFunc ]]></query>
Syntax
Purpose
K1
is based on cern.jet.math.Bessel
. It returns the modified Bessel function of the third kind of order 1 of the double
argument as a double
.
The range is partitioned into the two intervals [0,2]
and (2, infinity)
. Chebyshev polynomial expansions are employed in each interval.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#k1(double)
.
Examples
Consider the query qColt21
in Example 7-106. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-107, the query returns the relation in Example 7-108.
Example 7-106 K1 Function Query
<query id="qColt21"><![CDATA[ select k1(c2) from SColtFunc ]]></query>
Syntax
Purpose
K1E
is based on cern.jet.math.Bessel
. It returns the exponentially scaled modified Bessel function of the third kind of order 1 of the double
argument as a double
.
The function is defined as: k1e(x) = exp(x) * k1(x)
.
For more information, see:
Examples
Consider the query qColt22
in Example 7-109. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-110, the query returns the relation in Example 7-111.
Example 7-109 K1E Function Query
<query id="qColt22"><![CDATA[ select k1e(c2) from SColtFunc ]]></query>
Syntax
Purpose
KN
is based on cern.jet.math.Bessel
. It returns the modified Bessel function of the third kind of order n
of the argument as a double
.
This function takes the following arguments:
integer1
: the n
value order of the Bessel function.
double2
: the x
value to compute the bessel function of.
The range is partitioned into the two intervals [0,9.55]
and (9.55, infinity)
. An ascending power series is used in the low range, and an asymptotic expansion in the high range.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#kn(int,%20double)
.
Examples
Consider the query qColt23
in Example 7-112. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-113, the query returns the relation in Example 7-114.
Example 7-112 KN Function Query
<query id="qColt23"><![CDATA[ select kn(c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
LEASTSIGNIFICANTBIT
is based on cern.colt.bitvector.QuickBitVector
. It returns the index (as an integer
) of the least significant bit in state true
of the integer
argument. Returns 32 if no bit is in state true
.
For more information, see:
Examples
Consider the query qColt54
in Example 7-115. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-116, the query returns the relation in Example 7-117.
Example 7-115 LEASTSIGNIFICANTBIT Function Query
<query id="qColt54"><![CDATA[ select leastSignificantBit(c1) from SColtFunc ]]></query>
Syntax
Purpose
LOG
is based on cern.jet.math.Arithmetic
. It returns the computation that Figure 7-11 shows as a double
.
This function takes the following arguments:
double1
: the base
.
double2
: the value
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#log(double,%20double)
.
Examples
Consider the query qColt3
in Example 7-118. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-119, the query returns the relation in Example 7-120.
Example 7-118 LOG Function Query
<query id="qColt3"><![CDATA[ select log(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
LOG10
is based on cern.jet.math.Arithmetic
. It returns the base 10 logarithm of a double
value as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#log10(double)
.
Examples
Consider the query qColt4
in Example 7-121. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-122, the query returns the relation in Example 7-123.
Example 7-121 LOG10 Function Query
<query id="qColt4"><![CDATA[ select log10(c2) from SColtFunc ]]></query>
Syntax
Purpose
LOG2
is based on cern.jet.math.Arithmetic
. It returns the base 2 logarithm of a double
value as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#log2(double)
.
Examples
Consider the query qColt9
in Example 7-124. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-125, the query returns the relation in Example 7-126.
Example 7-124 LOG2 Function Query
<query id="qColt9"><![CDATA[ select log2(c2) from SColtFunc ]]></query>
Syntax
Purpose
LOGFACTORIAL
is based on cern.jet.math.Arithmetic
. It returns the natural logarithm (base e) of the factorial of its integer
argument as a double
For argument values k<30
, the function looks up the result in a table in O(1)
. For argument values k>=30
, the function uses Stirlings approximation.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#logFactorial(int)
.
Examples
Consider the query qColt10
in Example 7-127. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-128, the query returns the relation in Example 7-129.
Example 7-127 LOGFACTORIAL Function Query
<query id="qColt10"><![CDATA[ select logFactorial(c1) from SColtFunc ]]></query>
Syntax
Purpose
LOGGAMMA
is based on cern.jet.stat.Gamma
. It returns the natural logarithm (base e) of the gamma function of the double
argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Gamma.html#logGamma(double)
.
Examples
Consider the query qColt33
in Example 7-130. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-131, the query returns the relation in Example 7-132.
Example 7-130 LOGGAMMA Function Query
<query id="qColt33"><![CDATA[ select logGamma(c2) from SColtFunc ]]></query>
Syntax
Purpose
LONGFACTORIAL
is based on cern.jet.math.Arithmetic
. It returns the factorial of its integer
argument (in the range k >= 0 && k < 21
) as a long
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#longFactorial(int)
.
Examples
Consider the query qColt11
in Example 7-133. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-134, the query returns the relation in Example 7-135.
Example 7-133 LONGFACTORIAL Function Query
<query id="qColt11"><![CDATA[ select longFactorial(c1) from SColtFunc ]]></query>
Syntax
Purpose
MOSTSIGNIFICANTBIT
is based on cern.colt.bitvector.QuickBitVector
. It returns the index (as an integer
) of the most significant bit in state true
of the integer
argument. Returns -1
if no bit is in state true
For more information, see:
http://dsd.lbl.gov/~hoschek/colt/api/cern/colt/bitvector/QuickBitVector.html#mostSignificantBit(int)
Examples
Consider the query qColt55
in Example 7-136. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-137, the query returns the relation in Example 7-138.
Example 7-136 MOSTSIGNIFICANTBIT Function Query
<query id="qColt55"><![CDATA[ select mostSignificantBit(c1) from SColtFunc ]]></view>
Syntax
Purpose
NEGATIVEBINOMIAL
is based on cern.jet.stat.Probability
. It returns the sum of the terms 0 through k
of the Negative Binomial Distribution (see Figure 7-12) as a double
.
This function takes the following arguments:
integer1
: the end term k
.
integer2
: the number of trials n
.
double3
: the probability of success p
in (0.0,1.0).
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#negativeBinomial(int,%20int,%20double)
.
Examples
Consider the query qColt44
in Example 7-139. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-140, the query returns the relation in Example 7-141.
Example 7-139 NEGATIVEBINOMIAL Function Query
<query id="qColt44"><![CDATA[ select negativeBinomial(c1,c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
NEGATIVEBINOMIALCOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the sum of the terms k+1
to infinity of the Negative Binomial distribution (see Figure 7-13) as a double
.
This function takes the following arguments:
integer1
: the end term k
.
integer2
: the number of trials n
.
double3
: the probability of success p
in (0.0,1.0).
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#negativeBinomialComplemented(int,%20int,%20double)
.
Examples
Consider the query qColt45
in Example 7-142. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-143, the query returns the relation in Example 7-144.
Example 7-142 NEGATIVEBINOMIALCOMPLEMENTED Function Query
<query id="qColt45"><![CDATA[ select negativeBinomialComplemented(c1,c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
NORMAL
is based on cern.jet.stat.Probability
. It returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to the double
argument x
(see Figure 7-14) as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#normal(double)
.
Examples
Consider the query qColt46
in Example 7-145. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-146, the query returns the relation in Example 7-147.
Example 7-145 NORMAL Function Query
<query id="qColt46"><![CDATA[ select normal(c2) from SColtFunc ]]></query>
Syntax
Purpose
NORMAL1
is based on cern.jet.stat.Probability
. It returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to x
(see Figure 7-15) as a double
.
This function takes the following arguments:
double1
: the normal distribution mean
.
double2
: the variance of the normal distribution v
.
double3
: the integration limit x
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#normal(double,%20double,%20double)
.
Examples
Consider the query qColt47
in Example 7-148. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-149, the query returns the relation in Example 7-150.
Example 7-148 NORMAL1 Function Query
<query id="qColt47"><![CDATA[ select normal1(c2,c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
NORMALINVERSE
is based on cern.jet.stat.Probability
. It returns the double
value, x
, for which the area under the Normal (Gaussian) probability density function (integrated from minus infinity to x
) equals the double
argument y
(assumes mean is zero and variance is one).
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#normalInverse(double)
.
Examples
Consider the query qColt48
in Example 7-151. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-152, the query returns the relation in Example 7-153.
Example 7-151 NORMALINVERSE Function Query
<query id="qColt48"><![CDATA[ select normalInverse(c2) from SColtFunc ]]></view>
Syntax
Purpose
POISSON
is based on cern.jet.stat.Probability
. It returns the sum of the first k
terms of the Poisson distribution (see Figure 7-16) as a double
.
This function takes the following arguments:
integer1
: the number of terms k
.
double2
: the mean of the Poisson distribution m
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#poisson(int,%20double)
.
Examples
Consider the query qColt49
in Example 7-154. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-155, the query returns the relation in Example 7-156.
Example 7-154 POISSON Function Query
<query id="qColt49"><![CDATA[ select poisson(c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
POISSONCOMPLEMENTED
is based on cern.jet.stat.Probability
. It returns the sum of the terms k+1
to Infinity of the Poisson distribution (see Figure 7-17) as a double
.
This function takes the following arguments:
integer1
: the start term k
.
double2
: the mean of the Poisson distribution m
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#poissonComplemented(int,%20double)
.
Examples
Consider the query qColt50
in Example 7-157. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-158, the query returns the relation in Example 7-159.
Example 7-157 POISSONCOMPLEMENTED Function Query
<query id="qColt50"><![CDATA[ select poissonComplemented(c1,c2) from SColtFunc ]]></query>
Syntax
Purpose
STIRLINGCORRECTION
is based on cern.jet.math.Arithmetic
. It returns the correction term of the Stirling approximation of the natural logarithm (base e) of the factorial of the integer
argument (see Figure 7-18) as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Arithmetic.html#stirlingCorrection(int)
.
Examples
Consider the query qColt5
in Example 7-160. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-161, the query returns the relation in Example 7-162.
Example 7-160 STIRLINGCORRECTION Function Query
<query id="qColt5"><![CDATA[ select stirlingCorrection(c1) from SColtFunc ]]></query>
Syntax
Purpose
STUDENTT
is based on cern.jet.stat.Probability
. It returns the integral from minus infinity to t
of the Student-t distribution with k
> 0 degrees of freedom (see Figure 7-19) as a double
.
This function takes the following arguments:
double1
: the degrees of freedom k
.
double2
: the integration end point t
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/stat/Probability.html#studentT(double,%20double)
.
Examples
Consider the query qColt51
in Example 7-163. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-164, the query returns the relation in Example 7-165.
Example 7-163 STUDENTT Function Query
<query id="qColt51"><![CDATA[ select studentT(c2,c2) from SColtFunc ]]></query>
Syntax
Purpose
STUDENTTINVERSE
is based on cern.jet.stat.Probability
. It returns the double
value, t
, for which the area under the Student-t probability density function (integrated from minus infinity to t
) equals 1-alpha/2
. The value returned corresponds to the usual Student t-distribution lookup table for talpha[size]
. This function uses the STUDENTT
function to determine the return value iteratively.
This function takes the following arguments:
double1
: the probability alpha
.
integer2
: the data set size.
For more information, see:
Examples
Consider the query qColt52
in Example 7-166. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-167, the query returns the relation in Example 7-168.
Example 7-166 STUDENTTINVERSE Function Query
<query id="qColt52"><![CDATA[ select studentTInverse(c2,c1) from SColtFunc ]]></query>
Syntax
Purpose
Y0
is based on cern.jet.math.Bessel
. It returns the Bessel function of the second kind of order 0 of the double
argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#y0(double)
.
Examples
Consider the query qColt24
in Example 7-169. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-170, the query returns the relation in Example 7-171.
Example 7-169 Y0 Function Query
<query id="qColt24"><![CDATA[ select y0(c2) from SColtFunc ]]></query>
Syntax
Purpose
Y1
is based on cern.jet.math.Bessel
. It returns the Bessel function of the second kind of order 1 of the float argument as a double
.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#y1(double)
.
Examples
Consider the query qColt25
in Example 7-172. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-173, the query returns the relation in Example 7-174.
Example 7-172 Y1 Function Query
<query id="qColt25"><![CDATA[ select y1(c2) from SColtFunc ]]></query>
Syntax
Purpose
YN
is based on cern.jet.math.Bessel
. It returns the Bessel function of the second kind of order n
of the double
argument as a double
.
This function takes the following arguments:
integer1
: the n
value order of the Bessel function.
double2
: the x
value to compute the Bessel function of.
For more information, see http://dsd.lbl.gov/~hoschek/colt/api/cern/jet/math/Bessel.html#yn(int,%20double)
.
Examples
Consider the query qColt26
in Example 7-175. Given the data stream SColtFunc
with schema (c1 integer, c2 double, c3 bigint)
in Example 7-176, the query returns the relation in Example 7-177.
Example 7-175 YN Function Query
<query id="qColt26"><![CDATA[ select yn(c1,c2) from SColtFunc ]]></query>