ストリーム評価機能リファレンス

ストリーム評価機能は、ストリームソースやストリームデコレーターとは異なります。ストリームソースとストリームデコレーターは両方ともタプルのストリームを返します。ストリーム評価機能は、パラメータを評価して結果を返す従来の関数に似ています。その結果は、単一の値、配列、マップ、またはその他の構造にすることができます。

ストリーム評価機能はネストできるため、ある評価機能の出力が別の評価機能の入力になります。

ストリーム評価機能はさまざまなコンテキストで呼び出すことができます。たとえば、ストリーム評価機能は単独で呼び出すことも、ストリーミング式内で呼び出すこともできます。

abs

abs 関数は、指定された単一のパラメータの絶対値を返します。値が数値以外の場合、abs 関数は実行に失敗します。null 値が見つかった場合は、結果として null が返されます。

abs パラメータ

  • フィールド名 | 生の数値 | 数値評価機能

abs 構文

以下の式は、abs 評価機能を使用できるさまざまな方法を示しています。パラメータは 1 つだけ受け入れられます。数値が返されます。

abs(1) // 1, not really a good use case for it
abs(-1) // 1, not really a good use case for it
abs(add(fieldA,fieldB)) // absolute value of fieldA + fieldB
abs(fieldA) // absolute value of fieldA

acos

acos 関数は、数値の三角法のアークコサインを返します。

acos パラメータ

  • フィールド名 | 生の数値 | 数値評価機能: アークコサインを返す値。

acos 構文

acos(100.4)  // returns the arccosine of 100.4
acos(fieldA) // returns the arccosine for fieldA.
if(gt(fieldA,fieldB),sin(fieldA),sin(fieldB)) // if fieldA > fieldB then return the arccosine of fieldA, else return the arccosine of fieldB

add

add 関数は、2 つ以上の数値を加算します。いずれかの値が数値以外の場合、add 関数は実行に失敗します。null 値が見つかった場合は、結果として null が返されます。

add パラメータ

  • フィールド名 | 生の数値 | 数値評価機能

  • フィールド名 | 生の数値 | 数値評価機能

  • …​…​

  • フィールド名 | 生の数値 | 数値評価機能

add 構文

以下の式は、add 評価機能を使用できるさまざまな方法を示しています。これらのパラメータの数と順序は重要ではなく、少なくとも 2 つのパラメータが必要であること以外に制限はありません。数値が返されます。

add(1,2,3,4) // 1 + 2 + 3 + 4 == 10
add(1,fieldA) // 1 + value of fieldA
add(fieldA,1.4) // value of fieldA + 1.4
add(fieldA,fieldB,fieldC) // value of fieldA + value of fieldB + value of fieldC
add(fieldA,div(fieldA,fieldB)) // value of fieldA + (value of fieldA / value of fieldB)
add(fieldA,if(gt(fieldA,fieldB),fieldA,fieldB)) // if fieldA > fieldB then fieldA + fieldA, else fieldA + fieldB

analyze

analyze 関数は、使用可能なアナライザーを使用してテキストを分析し、アナライザーによって出力されたトークンのリストを返します。analyze 関数は、単独で呼び出すことも、select および cartesianProduct ストリーミング式内で呼び出すこともできます。

analyze パラメータ

  • フィールド名 | 生のテキスト: タプル内のフィールドまたは分析する生のテキスト。

  • アナライザーフィールド名: テキストの分析に使用するアナライザーのフィールド名。

analyze 構文

以下の式は、analyze 評価機能を使用できるさまざまな方法を示しています。

  • 生のテキストを分析する: analyze("hello world", analyzerField)

  • select式内のテキストフィールドを解析します。これにより、タプルにアナライザーの出力が注釈として付与されます。select(expr, analyze(textField, analyzerField) as outField)

  • cartesianProduct式でテキストフィールドを解析します。これにより、アナライザーによって出力された各トークンが独自のタプルでストリーミングされます。cartesianProduct(expr, analyze(textField, analyzer) as outField)

and

and関数は、少なくとも2つのブールパラメータの論理ANDを返します。パラメータがブール型ではないか、nullの場合、関数は実行に失敗します。ブール値を返します。

and パラメータ

  • フィールド名 | 生のブール値 | ブール評価器

  • フィールド名 | 生のブール値 | ブール評価器

  • …​…​

  • フィールド名 | 生のブール値 | ブール評価器

and 構文

以下の式は、and評価器を使用できるさまざまな方法を示しています。少なくとも2つのパラメータが必要ですが、使用できる数に制限はありません。

and(true,fieldA) // true && fieldA
and(fieldA,fieldB) // fieldA && fieldB
and(or(fieldA,fieldB),fieldC) // (fieldA || fieldB) && fieldC
and(fieldA,fieldB,fieldC,or(fieldD,fieldE),fieldF)

anova

anova関数は、2つ以上の数値配列に対して分散分析を計算します。

anova パラメータ

  • 数値配列 …​ (2つ以上)

anova 構文

anova(numericArray1, numericArray2) // calculates ANOVA for two numeric arrays
anova(numericArray1, numericArray2, numericArray2) // calculates ANOVA for three numeric arrays

array

array関数は、数値または他のオブジェクト(他の配列を含む)の配列を返します。

array パラメータ

  • 数値 | 配列 …​

array 構文

array(1, 2, 3)  // Array of numerics
array(array(1,2,3), array(4,5,6)) // Array of arrays

asin

asin関数は、数値の三角アークサインを返します。

asin パラメータ

  • フィールド名 | 生の数値 | 数値評価器: アークサインを返す値。

asin 構文

asin(100.4)  // returns the sine of 100.4
asine(fieldA) // returns the sine for fieldA.
if(gt(fieldA,fieldB),asin(fieldA),asin(fieldB)) // if fieldA > fieldB then return the asine of fieldA, else return the asine of fieldB

atan

atan関数は、数値の三角アークタンジェントを返します。

atan パラメータ

  • フィールド名 | 生の数値 | 数値評価器: アークタンジェントを返す値。

atan 構文

atan(100.4)  // returns the arctangent of 100.4
atan(fieldA) // returns the arctangent for fieldA.
if(gt(fieldA,fieldB),atan(fieldA),atan(fieldB)) // if fieldA > fieldB then return the arctanget of fieldA, else return the arctangent of fieldB

betaDistribution

betaDistribution関数は、パラメータに基づいてベータ確率分布を返します。この関数は確率分布フレームワークの一部であり、samplekolmogorovSmirnov、およびcumulativeProbability関数と連携するように設計されています。

betaDistribution パラメータ

  • double: shape1

  • double: shape2

betaDistribution の戻り値

確率分布関数。

betaDistribution 構文

betaDistribution(1, 5)

binomialCoefficient

binomialCoefficient関数は、二項係数、つまりn要素の集合から選択できるk要素の部分集合の数を返します。

binomialCoefficient パラメータ

  • integer: [n] 集合

  • integer: [k] 部分集合

binomialCoefficient の戻り値

long値:n要素の集合から選択できるk要素の部分集合の数。

binomialCoefficient 構文

binomialCoefficient(8, 3) // Returns the number of 3 element subsets from an 8 element set.

binomialDistribution

binomialDistribution関数は、パラメータに基づいて二項確率分布を返します。この関数は確率分布フレームワークの一部であり、sampleprobability、およびcumulativeProbability関数と連携するように設計されています。

binomialDistribution パラメータ

  • integer: 試行回数

  • double: 成功確率

binomialDistribution の戻り値

確率分布関数。

binomialDistribution 構文

binomialDistribution(1000, .5)

cbrt

cbrt関数は、数値の三角立方根を返します。

cbrt パラメータ

  • フィールド名 | 生の数値 | 数値評価器: 立方根を返す値。

cbrt 構文

cbrt(100.4)  // returns the square root of 100.4
cbrt(fieldA) // returns the square root for fieldA.
if(gt(fieldA,fieldB),cbrt(fieldA),cbrt(fieldB)) // if fieldA > fieldB then return the cbrt of fieldA, else return the cbrt of fieldB

ceil

ceil関数は、小数値を次の最も高い整数に丸めます。

ceil パラメータ

  • フィールド名 | 生の数値 | 数値評価器: 切り上げる小数。

ceil 構文

以下の式は、ceil評価器を使用できるさまざまな方法を示しています。

ceil(100.4) // returns 101.
ceil(fieldA) // returns the next highest whole number for fieldA.
if(gt(fieldA,fieldB),ceil(fieldA),ceil(fieldB)) // if fieldA > fieldB then return the ceil of fieldA, else return the ceil of fieldB.

col

col関数は、タプルのリストから数値配列を返します。col関数は、ストリームソースから数値配列を作成するために使用されます。

col パラメータ

  • タプルのリスト

  • フィールド名: 配列を作成するフィールド。

col 構文

col(tupleList, fieldName)

colAt

colAt関数は、特定のインデックスにある行列の列を数値配列として返します。

colAt パラメータ

  • matrix: 操作する行列

  • integer: 返す列のインデックス

colAt 構文

colAt(matrix, 10)

colAt の戻り値

数値配列:行列の列

columnCount

columnCount関数は、matrixの列数を返します。

columnCount パラメータ

  • matrix: 操作する行列

columnCount 構文

columnCount(matrix)

columnCount の戻り値

integer:行列の列数。

constantDistribution

constantDistribution関数は、そのパラメータに基づいて定数確率分布を返します。この関数は確率分布フレームワークの一部であり、sampleおよびcumulativeProbability関数と連携するように設計されています。

サンプリングすると、定数分布は常にその定数値を返します。

constantDistribution パラメータ

  • double: 定数値

constantDistribution の戻り値

確率分布関数。

constantDistribution 構文

constantDistribution(constantValue)

conv

conv関数は、2つの数値配列の畳み込みを返します。

conv パラメータ

  • 数値配列

  • 数値配列

conv 構文

conv(numericArray1, numericArray2)

copyOf

copyOf関数は、数値配列のコピーを作成します。

copyOf パラメータ

  • 数値配列

  • length:コピーされた配列の長さ。lengthパラメータが元の配列のサイズを超えた場合、返される配列は右側をゼロで埋められます。

copyOf 構文

copyOf(numericArray, length)

copyOfRange

copyOfRange関数は、数値配列の範囲のコピーを作成します。

copyOfRange パラメータ

  • 数値配列

  • 開始インデックス

  • 終了インデックス

copyOfRange 構文

copyOfRange(numericArray, startIndex, endIndex)

corr

corr関数は、2つの数値配列の相関または行列の相関行列を返します。

corr関数は、ピアソン、ケンドール、スピアマンの相関をサポートしています。

corr 位置パラメータ

  • 数値配列: 最初の数値配列

  • 数値配列: 2番目の数値配列

または

  • matrix: 相関行列を計算する行列。相関は行列のcolumns間で計算されることに注意してください。

corr 名前付きパラメータ

  • type: (オプション) 相関のタイプ。可能な値は、pearsonskendalls、またはspearmansです。デフォルトはpearsonsです。

corr 構文

corr(numericArray1, numericArray2) // Compute the Pearsons correlation for two numeric arrays
corr(numericArray1, numericArray2, type=kendalls) // Compute the Kendalls correlation for two numeric arrays
corr(matrix) // Compute the Pearsons correlation matrix for a matrix
corr(matrix, type=spearmans) // Compute the Spearmans correlation matrix for a matrix

corr の戻り値

数値 | 行列:相関または相関行列のいずれか。

cos

cos関数は、数値の三角余弦を返します。

cos パラメータ

  • フィールド名 | 生の数値 | 数値評価器: 双曲線余弦を返す値。

cos 構文

cos(100.4)  // returns the arccosine of 100.4
cos(fieldA) // returns the arccosine for fieldA.
if(gt(fieldA,fieldB),cos(fieldA),cos(fieldB)) // if fieldA > fieldB then return the arccosine of fieldA, else return the cosine of fieldB

cosineSimilarity

cosineSimilarity関数は、2つの数値配列のコサイン類似度を返します。

cosineSimilarity パラメータ

  • 数値配列

  • 数値配列

cosineSimilarity の戻り値

数値。

cosineSimilarity 構文

cosineSimilarity(numericArray, numericArray)

cov

cov関数は、2つの数値配列の共分散、または行列の共分散行列を返します。

cov パラメータ

  • 数値配列: 最初の数値配列

  • 数値配列: 2番目の数値配列

または

  • matrix: 共分散行列を計算する行列。共分散は行列のcolumns間で計算されることに注意してください。

cov 構文

cov(numericArray, numericArray) // Computes the covariance of a two numeric arrays
cov(matrix) // Computes the covariance matrix for the matrix.

cov の戻り値

数値 | 行列:共分散または共分散行列のいずれか。

cumulativeProbability

cumulativeProbability関数は、確率分布内のランダム変数の累積確率を返します。累積確率は、ランダム変数以下のすべてのランダム変数の合計確率です。

cumulativeProbability パラメータ

  • 確率分布

  • 数値:確率を計算する値。

cumulativeProbability の戻り値

double:累積確率。

cumulativeProbability 構文

cumulativeProbability(normalDistribution(500, 25), 502) // Returns the cumulative probability of the random sample 502 in a normal distribution with a mean of 500 and standard deviation of 25.

derivative

derivative関数は、関数の導関数を返します。導関数は、spline関数とloess関数の導関数を計算できます。導関数は、導関数の導関数を求めることもできます。

derivative パラメータ

  • spline | loess | akima | lerp | derivative: 導関数を計算する関数。

derivative 構文

derivative(spline(...))
derivative(loess(...))
derivative(derivative(...))

derivative の戻り値

関数:関数は、数値配列関数の両方として扱うことができます。

describe

describe関数は、配列の記述統計を含むタプルを返します。

describe パラメータ

  • 数値配列

describe 構文

describe(numericArray)

diff

diff関数は、時系列差分を実行します。

時系列差分は、さらなる分析を行う前に時系列を定常にするためによく使用されます。

diff パラメータ

  • 数値配列:時系列データ。

  • integer: (オプション) ラグ。デフォルトは1です。

diff 構文

diff(numericArray1) // Perform time series differencing with a default lag of 1.
diff(numericArray1, 30) // Perform time series differencing with a lag of 30.

diff の戻り値

数値配列: 差分時系列データ。配列のサイズは、(元の配列サイズ - ラグ)と等しくなります。

距離

distance関数は、2つの数値配列の距離、または行列の距離行列を計算します。

distance 位置パラメータ

  • 数値配列: 最初の数値配列

  • 数値配列: 2番目の数値配列

または

  • matrix: 距離行列を計算する行列。距離は行列の間で計算されることに注意してください。

distance 名前付きパラメータ

  • type: (オプション) 距離のタイプ。指定可能な値は、euclideanmanhattancanberra、またはearthMoversです。デフォルトはeuclideanです。

distance 構文

distance(numericArray1, numericArray2) // Computes the euclidean distance for two numeric arrays.
distance(numericArray1, numericArray2, type=manhattan) // Computes the manhattan distance for two numeric arrays.
distance(matrix) // Computes the euclidean distance matrix for a matrix.
distance(matrix, type=canberra) // Computes the canberra distance matrix for a matrix.

distance 戻り値

number | matrix: 距離または距離行列のいずれか。

div

div関数は、2つの数値をとり、それらを割り算します。いずれかの値が数値ではないか、nullである場合、または2番目の値が0の場合、関数は実行に失敗します。数値が返されます。

div パラメータ

  • フィールド名 | 生の数値 | 数値評価機能

  • フィールド名 | 生の数値 | 数値評価機能

div 構文

以下の式は、div評価器を使用できるさまざまな方法を示しています。最初の値は2番目の値で除算されるため、2番目の値は0にすることはできません。

div(1,2) // 1 / 2
div(1,fieldA) // 1 / fieldA
div(fieldA,1.4) // fieldA / 1.4
div(fieldA,add(fieldA,fieldB)) // fieldA / (fieldA + fieldB)

dotProduct

dotProduct関数は、2つの数値配列のドット積を返します。

dotProduct パラメータ

  • 数値配列

  • 数値配列

dotProduct 戻り値

数値。

dotProduct 構文

dotProduct(numericArray, numericArray)

ebeAdd

ebeAdd関数は、2つの数値配列の要素ごとの加算を実行します。

ebeAdd パラメータ

  • 数値配列

  • 数値配列

ebeAdd 戻り値

数値配列。

ebeAdd 構文

ebeAdd(numericArray, numericArray)

ebeDivide

ebeDivide関数は、2つの数値配列の要素ごとの除算を実行します。

ebeDivide パラメータ

  • 数値配列

  • 数値配列

ebeDivide 戻り値

数値配列。

ebeDivide 構文

ebeDivide(numericArray, numericArray)

ebeMultiple

ebeMultiply関数は、2つの数値配列の要素ごとの乗算を実行します。

ebeMultiply パラメータ

  • 数値配列

  • 数値配列

ebeMultiply 戻り値

数値配列。

ebeMultiply 構文

ebeMultiply(numericArray, numericArray)

ebeSubtract

ebeSubtract関数は、2つの数値配列の要素ごとの減算を実行します。

ebeSubtract パラメータ

  • 数値配列

  • 数値配列

ebeSubtract 戻り値

数値配列。

ebeSubtract 構文

ebeSubtract(numericArray, numericArray)

empiricalDistribution

empiricalDistribution関数は、実際のデータセットに基づいた連続的な確率分布関数である経験分布関数を返します。この関数は、確率分布フレームワークの一部であり、samplekolmogorovSmirnov、およびcumulativeProbability関数と連携するように設計されています。

この関数は、連続データで動作するように設計されています。離散データセットから分布を作成するには、enumeratedDistributionを使用します。

empiricalDistribution パラメータ

  • 数値配列: 経験観測値

empiricalDistribution 戻り値

確率分布関数。

empiricalDistribution 構文

empiricalDistribution(numericArray)

enumeratedDistribution

enumeratedDistribution関数は、実際のデータセット、または事前に定義されたデータと確率のセットに基づいた離散確率分布関数を返します。この関数は、確率分布フレームワークの一部であり、sampleprobability、およびcumulativeProbability関数と連携するように設計されています。

enumeratedDistributionは、2つの異なるシナリオで呼び出すことができます。

  1. 離散値の単一配列。これは、離散データの経験分布のように機能します。

  2. 単一の離散値の配列と、離散値の確率を表すdouble値の配列。

この関数は、離散データで動作するように設計されています。連続データセットから分布を作成するには、empiricalDistributionを使用します。

enumeratedDistribution パラメータ

  • 整数配列: 離散観測値または単一の離散値。

  • double 配列: (オプション) 単一の離散値の確率を表す値。

enumeratedDistribution 戻り値

確率分布関数。

enumeratedDistribution 構文

enumeratedDistribution(integerArray) // This creates an enumerated distribution from the observations in the numeric array.
enumeratedDistribution(array(1,2,3,4), array(.25,.25,.25,.25)) // This creates an enumerated distribution with four discrete values (1,2,3,4) each with a probability of .25.

eor

eor関数は、少なくとも2つのブールパラメータの論理排他的ORを返します。いずれかのパラメータがブール値ではないか、nullの場合、関数は実行に失敗します。ブール値を返します。

eor パラメータ

  • フィールド名 | 生のブール値 | ブール評価器

  • フィールド名 | 生のブール値 | ブール評価器

  • …​…​

  • フィールド名 | 生のブール値 | ブール評価器

eor 構文

以下の式は、eor評価器を使用できるさまざまな方法を示しています。少なくとも2つのパラメータが必要ですが、使用できる数に制限はありません。

eor(true,fieldA) // true iff fieldA is false
eor(fieldA,fieldB) // true iff either fieldA or fieldB is true but not both
eor(eq(fieldA,fieldB),eq(fieldC,fieldD)) // true iff either fieldA == fieldB or fieldC == fieldD but not both

eq

eq関数は、Javaの標準的なequals(…​)関数に従って、すべてのパラメータが等しいかどうかを返します。この関数は任意の型のパラメータを受け入れますが、すべてのパラメータが同じ型ではない場合、実行に失敗します。つまり、すべてブール値、すべて文字列、またはすべて数値です。いずれかのパラメータがnullであり、nullではないパラメータが少なくとも1つ存在する場合、falseが返されます。ブール値を返します。

eq パラメータ

  • フィールド名 | 生の値 | 評価器

  • フィールド名 | 生の値 | 評価器

  • …​…​

  • フィールド名 | 生の値 | 評価器

eq 構文

以下の式は、eq評価器を使用できるさまざまな方法を示しています。

eq(1,2) // 1 == 2
eq(1,fieldA) // 1 == fieldA
eq(fieldA,val(foo)) fieldA == "foo"
eq(add(fieldA,fieldB),6) // fieldA + fieldB == 6

expMovingAge

expMovingAverage関数は、数値配列の指数移動平均を計算します。

expMovingAge パラメータ

  • 数値配列: 指数移動平均を計算する配列。

  • 整数: ウィンドウサイズ

expMovingAvg 戻り値

数値配列。返された配列の最初の要素は、元の配列のwindowSize-1インデックスから開始されます。

expMovingAvg 構文

expMovingAvg(numericArray, 5) //Computes an exponential moving average with a window size of 5.

factorial

factorial関数は、パラメータの階乗を返します。

factorial パラメータ

  • 整数: 階乗を計算する値。このパラメータでサポートされる最大値は170です。

factorial 戻り値

double。

factorial 構文

factorial(100) //Computes the factorial of 100

finddelay

finddelay関数は、2つの数値配列間の相互相関を実行し、遅延を返します。

finddelay パラメータ

  • 数値配列

  • 数値配列

finddelay 構文

finddelay(numericArray1, numericArray2)

floor

floor関数は、小数点値を次の最小の整数に丸めます。

floor パラメータ

  • フィールド名 | 生の数値 | 数値評価器: 切り捨てる小数。

floor 構文

以下の式は、floor評価器を使用できるさまざまな方法を示しています。

floor(100.4) // returns 100.
ceil(fieldA) // returns the next lowestt whole number for fieldA.
if(gt(fieldA,fieldB),floor(fieldA),floor(fieldB)) // if fieldA > fieldB then return the floor of fieldA, else return the floor of fieldB.

freqTable

freqTable関数は、離散値の配列から度数分布を返します。

この関数は、離散値で動作するように設計されています。連続データで動作するには、hist関数を使用します。

freqTable パラメータ

  • 整数配列: 度数分布を構築する値。

freqTable 戻り値

各離散値の頻度情報を含むタプルのリスト。

freqTable 構文

freqTable(integerArray)

gammaDistribution

gammaDistribution関数は、パラメータに基づいてガンマ確率分布を返します。この関数は、確率分布フレームワークの一部であり、samplekolmogorovSmirnov、およびcumulativeProbability関数と連携するように設計されています。

gammaDistribution パラメータ

  • double: 形状

  • double: スケール

gammaDistribution 戻り値

確率分布関数、

gammaDistribution 構文

gammaDistribution(1, 10)

geometricDistribution

geometricDistribution関数は、パラメータに基づいて幾何確率分布を返します。この関数は、確率分布フレームワークの一部であり、sampleprobability、およびcumulativeProbability関数と連携するように設計されています。

geometricDistribution パラメータ

  • double: 確率

geometricDistribution 構文

geometricDistribution(.5) // Creates a geometric distribution with probability of .5

geometricDistribution 戻り値

確率分布関数

getAttribute

getAttribute関数は、キーによってmatrixから属性を返します。matrixを返す任意の関数は、追加情報とともにmatrixに属性を設定することもできます。setAttribute関数を使用して、matrixに属性を設定することもできます。属性のキーは常に文字列です。属性の値には、数値、配列、マップ、行列など、任意のオブジェクトを指定できます。

getAttribute パラメータ

  • matrix: 属性を設定する行列

  • string: 属性のキー

getAttribute 構文

getAttribute(matrix, key)

getAttribute 戻り値

object: 任意のオブジェクト

getAttributes

getAttributes関数は、行列から属性マップを返します。属性の詳細については、getAttribute関数を参照してください。

getAttributes パラメータ

  • matrix: 属性マップを取得する行列。

getAttributes 構文

getAttributes(matrix)

getAttributes 戻り値

map: 属性のマップ。

getColumnLabels

getColumnLabels関数は、行列の列ラベルを返します。列ラベルは、行列を返す任意の関数によってオプションで設定できます。列ラベルは、setColumnLabels関数を使用して設定することもできます。

getColumnLabels パラメータ

  • matrix: 列ラベルを取得する対象のマトリックス。

getColumnLabels 構文

getColumnLabels(matrix)

getColumnLabels 戻り値

文字列配列: マトリックスの各列のラベル

getRowLabels

getRowLabels 関数は、マトリックスの行ラベルを返します。行ラベルは、マトリックスを返す任意の関数によってオプションで設定できます。行ラベルは、setRowLabels 関数を使用して設定することもできます。

getRowLabels パラメータ

  • matrix: 行ラベルを取得する対象のマトリックス。

getRowLabels 構文

getRowLabels(matrix)

getRowLabels 戻り値

文字列配列: マトリックスの各行のラベル

getValue

getValue 関数は、キーによって単一のタプルエントリの値を返します。

getValue パラメータ

  • tuple: エントリを取得する対象のタプル。

  • key: 値を取得する対象のエントリのキー。

getValue 構文

getValue(tuple, key)

getValue 戻り値

オブジェクト: タプルエントリと同じ型のオブジェクトを返します。

grandSum

grandSum 関数は、マトリックス内のすべての値を合計します。

grandSum パラメータ

  • matrix: 操作対象のマトリックス。

grandSum 構文

grandSum(matrix)

grandSum 戻り値

数値: マトリックス内のすべての値の合計。

gt

gt 関数は、最初のパラメータが 2 番目のパラメータより大きいかどうかを返します。この関数は数値または文字列のパラメータを受け入れますが、すべてのパラメータが同じ型でない場合 (つまり、すべてが String またはすべてが Numeric の場合) は実行に失敗します。パラメータが null の場合はエラーが発生します。ブール値を返します。

gt パラメータ

  • フィールド名 | 生の値 | 評価器

  • フィールド名 | 生の値 | 評価器

gt 構文

以下の式は、gt 評価関数を使用できるさまざまな方法を示しています。

gt(1,2) // 1 > 2
gt(1,fieldA) // 1 > fieldA
gt(fieldA,val(foo)) // fieldA > "foo"
gt(add(fieldA,fieldB),6) // fieldA + fieldB > 6

gteq

gteq 関数は、最初のパラメータが 2 番目のパラメータ以上であるかどうかを返します。この関数は数値および文字列のパラメータを受け入れますが、すべてのパラメータが同じ型でない場合 (つまり、すべてが String またはすべてが Numeric の場合) は実行に失敗します。パラメータが null の場合はエラーが発生します。ブール値を返します。

gteq パラメータ

  • フィールド名 | 生の値 | 評価器

  • フィールド名 | 生の値 | 評価器

gteq 構文

以下の式は、gteq 評価関数を使用できるさまざまな方法を示しています。

gteq(1,2) // 1 >= 2
gteq(1,fieldA) // 1 >= fieldA
gteq(fieldA,val(foo)) fieldA >= "foo"
gteq(add(fieldA,fieldB),6) // fieldA + fieldB >= 6

hist

hist 関数は、数値配列からヒストグラムを作成します。hist 関数は、連続変数で使用するように設計されています。

hist パラメータ

  • 数値配列

  • bins: ヒストグラムのビンの数。返される各タプルには、ビン内にある観測値の要約統計が含まれています。

hist 構文

hist(numericArray, bins)

hsin

hsin 関数は、数値の三角双曲線正弦を返します。

hsin パラメータ

  • フィールド名 | 生の数値 | 数値評価関数: 双曲線正弦を返す値。

hsin 構文

hsin(100.4)  // returns the hsine of 100.4
hsin(fieldA) // returns the hsine for fieldA.
if(gt(fieldA,fieldB),sin(fieldA),sin(fieldB)) // if fieldA > fieldB then return the hsine of fieldA, else return the hsine of fieldB

if

if 関数は、標準的な条件付き if/then ステートメントのように動作します。最初のパラメータが true の場合は 2 番目のパラメータが返され、それ以外の場合は 3 番目のパラメータが返されます。この関数は、最初のパラメータとしてブール値、2 番目と 3 番目のパラメータとして任意の値を受け入れます。最初のパラメータがブール値でない場合、または null の場合はエラーが発生します。

if パラメータ

  • フィールド名 | 生の値 | ブール評価関数

  • フィールド名 | 生の値 | 評価器

  • フィールド名 | 生の値 | 評価器

if 構文

以下の式は、if 評価関数を使用できるさまざまな方法を示しています。

if(fieldA,fieldB,fieldC) // if fieldA is true then fieldB else fieldC
if(gt(fieldA,5), fieldA, 5) // if fieldA > 5 then fieldA else 5
if(eq(fieldB,null), null, div(fieldA,fieldB)) // if fieldB is null then null else fieldA / fieldB

indexOf

indexOf 関数は、文字列の配列内の文字列のインデックスを返します。

indexOf パラメータ

  • 文字列配列: 操作対象の配列。

  • 文字列: 配列内で検索する文字列。

indexOf 構文

indexOf(stringArray, string)

indexOf 戻り値

整数: 配列内の文字列のインデックス。または、文字列が見つからない場合は -1。

integrate

integrate 関数は、特定の曲線範囲に対して補間関数の積分を計算します。

integrate パラメータ

  • spline | akima | lerp | loess: 積分を計算する対象の補間関数。

  • 数値: 積分範囲の開始。

  • 数値: 積分範囲の終了。

integrate 構文

integrate(function, start, end)

integrate 戻り値

数値: 積分

length

length 関数は、数値配列の長さを返します。

length パラメータ

  • 数値配列

length 構文

length(numericArray)

lerp

loess

leoss 関数は、局所回帰アルゴリズムを使用する平滑化曲線フィッターです。各制御点に触れるスプライン関数とは異なり、loess 関数は制御点に触れる必要なく、制御点を通過する滑らかな曲線を配置します。loess の結果は、微分関数で使用して、滑らかでないデータから滑らかな微分を生成できます。

loess 位置パラメータ

  • 数値配列: (オプション) x 値。省略すると、x 値のシーケンスが作成されます。

  • 数値配列: y 値

loess 名前付きパラメータ

  • bandwidth: (オプション) 局所回帰線を描画する際に使用するデータポイントの割合。デフォルトは .25。帯域幅を小さくすると、loess が適合できる曲線の数が増えます。

  • robustIterations: (オプション) 外れ値を平滑化するために使用する反復回数。デフォルトは 2。

loess 構文

loess(yValues) // This creates the xValues automatically and fits a smooth curve through the data points.
loess(xValues, yValues) // This will fit a smooth curve through the data points.
loess(xValues, yValues, bandwidth=.15) // This will fit a smooth curve through the data points using 15 percent of the data points for each local regression line.

loess 戻り値

関数: この関数は、平滑化されたデータポイントの数値配列関数の両方として扱うことができます。

log

log 関数は、指定された単一のパラメータの自然対数を返します。log 関数は、値が数値でない場合は実行に失敗します。null 値が見つかった場合は、null が結果として返されます。

log パラメータ

  • フィールド名 | 生の数値 | 数値評価機能

log 構文

以下の式は、log 評価関数を使用できるさまざまな方法を示しています。パラメータは 1 つだけを受け入れます。数値が返されます。

log(100)
log(add(fieldA,fieldB))
log(fieldA)

logNormalDistribution

logNormalDistribution 関数は、そのパラメータに基づいて対数正規確率分布を返します。この関数は、確率分布フレームワークの一部であり、samplekolmogorovSmirnovcumulativeProbability 関数で使用するように設計されています。

logNormalDistribution パラメータ

  • double: 形状

  • double: スケール

logNormalDistribution 戻り値

確率分布関数。

logNormalDistribution 構文

logNormalDistribution(.3, .0)

kolmogorovSmirnov

kolmogorovSmirnov 関数は、参照連続確率分布とサンプルセットの間でコルモゴロフ-スミルノフ検定を実行します。

サポートされている分布関数は、empiricalDistributionnormalDistributionlogNormalDistributionweibullDistributiongammaDistribution、および betaDistribution です。

kolmogorovSmirnov パラメータ

  • 連続確率分布: 参照分布

  • 数値配列: サンプルセット

kolmogorovSmirnov 戻り値

結果タプル: 検定結果の p 値と d 統計量を含むタプル。

kolmogorovSmirnov 構文

kolmogorovSmirnov(normalDistribution(10, 2), sampleSet)

lt

lt 関数は、最初のパラメータが 2 番目のパラメータより小さいかどうかを返します。この関数は数値または文字列のパラメータを受け入れますが、すべてのパラメータが同じ型でない場合 (つまり、すべてが String またはすべてが Numeric の場合) は実行に失敗します。パラメータが null の場合はエラーが発生します。ブール値を返します。

lt パラメータ

  • フィールド名 | 生の値 | 評価器

  • フィールド名 | 生の値 | 評価器

lt 構文

以下の式は、lt 評価関数を使用できるさまざまな方法を示しています。

lt(1,2) // 1 < 2
lt(1,fieldA) // 1 < fieldA
lt(fieldA,val(foo)) fieldA < "foo"
lt(add(fieldA,fieldB),6) // fieldA + fieldB < 6

lteq

lteq 関数は、最初のパラメータが 2 番目のパラメータ以下であるかどうかを返します。この関数は数値および文字列のパラメータを受け入れますが、すべてのパラメータが同じ型でない場合 (つまり、すべてが String またはすべてが Numeric の場合) は実行に失敗します。パラメータが null の場合はエラーが発生します。ブール値を返します。

lteq パラメータ

  • フィールド名 | 生の値 | 評価器

  • フィールド名 | 生の値 | 評価器

lteq 構文

以下の式は、lteq 評価器を使用するさまざまな方法を示しています。

lteq(1,2) // 1 <= 2
lteq(1,fieldA) // 1 <= fieldA
lteq(fieldA,val(foo)) fieldA <= "foo"
lteq(add(fieldA,fieldB),6) // fieldA + fieldB <= 6

markovChain

markovChain 関数は、マルコフ連鎖シミュレーションを実行するために使用できます。markovChain 関数は、パラメータとして遷移行列を取り、sample 関数を使用してサンプリングできる数学モデルを返します。マルコフ連鎖から取得された各サンプルは、システムの現在の状態を表します。

markovChain パラメータ

  • matrix: 遷移行列

markovChain 構文

sample(markovChain(transitionMatrix), 5)  // This creates a Markov Chain given a specific transition matrix.
The sample function takes 5 samples from the Markov Chain, representing the next five states of the system.

markovChain の戻り値

マルコフ連鎖モデル: マルコフ連鎖モデルは、sample 関数で使用できます。

matrix

matrix 関数は、行列演算をサポートする関数で操作できる行列を返します。

matrix パラメータ

  • 数値配列 …​: 行列の行になる 1 つ以上の数値配列。

matrix 構文

matrix(numericArray1, numericArray2, numericArray3) // Returns a matrix with three rows of data: numericaArray1, numericArray2, numericArray3

matrix の戻り値

行列

meanDifference

meanDifference 関数は、2 つの数値配列間の要素ごとの減算後の差の平均を計算します。

meanDifference パラメータ

  • 数値配列

  • 数値配列

meanDifference の戻り値

数値。

meanDifference 構文

meanDifference(numericArray, numericArray)

minMaxScale

minMaxScale 関数は、数値配列を最小値と最大値の範囲にスケールします。デフォルトでは、minMaxScale は 0 から 1 の間にスケールします。minMaxScale 関数は、数値配列と行列の両方で動作できます。

行列を操作する場合、minMaxScale 関数は行列の各行を操作します。

minMaxScale パラメータ

  • 数値配列 | 行列: スケールする配列または行列

  • double: (オプション) 最小値。デフォルトは 0 です。

  • double: (オプション) 最大値。デフォルトは 1 です。

minMaxScale 構文

minMaxScale(numericArray) // scale a numeric array between 0 and 1
minMaxScale(numericArray, 0, 100) // scale a numeric array between 1 and 100
minMaxScale(matrix) // Scale each row in a matrix between 0 and 1
minMaxScale(matrix, 0, 100) // Scale each row in a matrix between 0 and 100

minMaxScale の戻り値

数値配列または行列

mod

mod 関数は、最初のパラメータを 2 番目のパラメータで割った余り (モジュロ) を返します。

mod パラメータ

  • フィールド名 | 生の数値 | 数値評価器: パラメータ 1

  • フィールド名 | 生の数値 | 数値評価器: パラメータ 2

mod 構文

以下の式は、mod 評価器を使用するさまざまな方法を示しています。

mod(100,3) // returns the remainder of 100 / 3 .
mod(100,fieldA) // returns the remainder of 100 divided by the value of fieldA.
mod(fieldA,1.4) // returns the remainder of fieldA divided by 1.4.
if(gt(fieldA,fieldB),mod(fieldA,fieldB),mod(fieldB,fieldA)) // if fieldA > fieldB then return the remainder of fieldA/fieldB, else return the remainder of fieldB/fieldA.

monteCarlo

monteCarlo 関数は、パラメータに基づいてモンテカルロシミュレーションを実行します。monteCarlo 関数は、指定された回数だけ別の関数を実行し、結果を返します。実行される関数には通常、各実行で確率分布から抽出される 1 つ以上の変数があります。sample 関数は、サンプルを抽出するために関数で使用されます。

シミュレーションの結果配列は、シミュレーション結果の確率を理解するための経験的分布として扱うことができます。

monteCarlo パラメータ

  • 数値関数: シミュレーションで実行される関数。数値値を返す必要があります。

  • 整数: 関数を実行する回数。

monteCarlo の戻り値

数値配列: シミュレーション実行の結果。

monteCarlo 構文

let(a=uniformIntegerDistribution(1, 6),
    b=uniformIntegerDistribution(1, 6),
    c=monteCarlo(add(sample(a), sample(b)), 1000))

上の式では、monteCarlo 関数は add(sample(a), sample(b)) 関数を 1000 回実行し、結果を返しています。関数が実行されるたびに、変数 a および b に格納された確率分布からサンプルが抽出されます。

movingAvg

movingAvg 関数は、数値の配列に対する移動平均を計算します。

movingAvg パラメータ

  • 数値配列

  • ウィンドウサイズ

movingAvg の戻り値

数値配列。返された配列の最初の要素は、元の配列のwindowSize-1インデックスから開始されます。

movingAvg 構文

movingAverage(numericArray, 30)

movingMedian

movingMedian 関数は、数値の配列に対する移動中央値を計算します。

movingMedian パラメータ

  • 数値配列

  • ウィンドウサイズ

movingMedian の戻り値

数値配列。返された配列の最初の要素は、元の配列のwindowSize-1インデックスから開始されます。

movingMedian 構文

movingMedian(numericArray, 30)

mult

mult 関数は、2 つ以上の数値を掛け合わせます。mult 関数は、いずれかの値が数値でない場合は実行に失敗します。null 値が見つかった場合は、null が結果として返されます。

mult パラメータ

  • フィールド名 | 生の数値 | 数値評価機能

  • フィールド名 | 生の数値 | 数値評価機能

  • …​…​

  • フィールド名 | 生の数値 | 数値評価機能

mult 構文

以下の式は、mult 評価器を使用するさまざまな方法を示しています。これらのパラメータの数と順序は重要ではなく、少なくとも 2 つのパラメータが必要であること以外に制限はありません。数値が返されます。

mult(1,2,3,4) // 1 * 2 * 3 * 4
mult(1,fieldA) // 1 * value of fieldA
mult(fieldA,1.4) // value of fieldA * 1.4
mult(fieldA,fieldB,fieldC) // value of fieldA * value of fieldB * value of fieldC
mult(fieldA,div(fieldA,fieldB)) // value of fieldA * (value of fieldA / value of fieldB)
mult(fieldA,if(gt(fieldA,fieldB),fieldA,fieldB)) // if fieldA > fieldB then fieldA * fieldA, else fieldA * fieldB

normalDistribution

normalDistribution 関数は、パラメータに基づいて正規確率分布を返します。この関数は、確率分布フレームワークの一部であり、samplekolmogorovSmirnov、および cumulativeProbability 関数と連携するように設計されています。

normalDistribution パラメータ

  • double: 平均

  • double: 標準偏差

normalDistribution の戻り値

確率分布関数。

normalDistribution 構文

normalDistribution(mean, stddev)

normalizeSum

normalizeSum 関数は、合計が 1 になるように数値配列をスケールします。normalizeSum 関数は、数値配列と行列の両方で動作できます。

行列を操作する場合、normalizeSum 関数は行列の各行を操作します。

normalizeSum パラメータ

  • 数値配列 | 行列

normalizeSum 構文

normalizeSum(numericArray)
normalizeSum(matrix)

normalizeSum の戻り値

数値配列 | 行列

not

not 関数は、単一のブール値パラメータの論理 NOT を返します。パラメータがブール値以外または null の場合、関数は実行に失敗します。ブール値が返されます。

not パラメータ

  • フィールド名 | 生のブール値 | ブール評価器

not 構文

以下の式は、not 評価器を使用するさまざまな方法を示しています。許可されるパラメータは 1 つだけです。

not(true) // false
not(fieldA) // true if fieldA is false else false
not(eq(fieldA,fieldB)) // true if fieldA != fieldB

olsRegress

olsRegress 関数は、通常の最小二乗法、多変量、線形回帰を実行します。

olsRegress 関数は、推定回帰パラメータ、RSquared、および回帰診断を含む回帰モデルを含む単一のタプルを返します。

olsRegress の出力は、predict 関数で、回帰モデルに基づいて値を予測するために使用できます。

olsRegress パラメータ

  • 行列: 回帰観測行列。行列の各行は、単一の多変量回帰観測を表します。切片項を含むモデルを指定する場合、最初の単位列 (1 の列) を追加する必要はありません。この列は自動的に追加されます。

  • 数値配列: 回帰観測行列の各行に対応する結果配列。

olsRegress 構文

olsRegress(matrix, numericArray) // This performs the olsRegression analysis on given regressor matrix and outcome array.

olsRegress の戻り値

タプル: 推定回帰パラメータと診断を含む回帰モデル。

or

or 関数は、少なくとも 2 つのブール値パラメータの論理 OR を返します。パラメータがブール値以外または null の場合、関数は実行に失敗します。ブール値が返されます。

or パラメータ

  • フィールド名 | 生のブール値 | ブール評価器

  • フィールド名 | 生のブール値 | ブール評価器

  • …​…​

  • フィールド名 | 生のブール値 | ブール評価器

or 構文

以下の式は、or 評価器を使用するさまざまな方法を示しています。少なくとも 2 つのパラメータが必要ですが、使用できる数に制限はありません。

or(true,fieldA) // true || fieldA
or(fieldA,fieldB) // fieldA || fieldB
or(and(fieldA,fieldB),fieldC) // (fieldA && fieldB) || fieldC
or(fieldA,fieldB,fieldC,and(fieldD,fieldE),fieldF)

poissonDistribution

poissonDistribution 関数は、パラメータに基づいてポアソン確率分布を返します。この関数は、確率分布フレームワークの一部であり、sampleprobability、および cumulativeProbability 関数と連携するように設計されています。

poissonDistribution パラメータ

  • double: 平均

poissonDistribution の戻り値

確率分布関数。

poissonDistribution 構文

poissonDistribution(mean)

polyFit

polyFit 関数は、多項式曲線フィッティングを実行します。

polyFit パラメータ

  • 数値配列: (オプション) x 値。省略すると、x 値のシーケンスが作成されます。

  • 数値配列: y 値

  • 整数: (オプション) 多項式の次数。デフォルトは 3 です。

polyFit の戻り値

数値配列: データ点に適合した曲線。

polyFit 構文

polyFit(yValues) // This creates the xValues automatically and fits a curve through the data points using the default 3 degree polynomial.
polyFit(yValues, 5) // This creates the xValues automatically and fits a curve through the data points using a 5 degree polynomial.
polyFit(xValues, yValues, 5) // This will fit a curve through the data points using a 5 degree polynomial.

pow

pow 関数は、最初のパラメータを 2 番目のパラメータの累乗にした値を返します。

pow パラメータ

  • フィールド名 | 生の値 | 数値評価器: パラメータ1

  • フィールド名 | 生の値 | 数値評価器: パラメータ2

pow 構文

以下の式は、pow 評価器を使用できるさまざまな方法を示しています。

pow(2,3) // returns 2 raised to the 3rd power.
pow(4,fieldA) // returns 4 raised by the value of fieldA.
pow(fieldA,1.4) // returns the value of fieldA raised by 1.4.
if(gt(fieldA,fieldB),pow(fieldA,fieldB),pow(fieldB,fieldA)) // if fieldA > fieldB then raise fieldA by fieldB, else raise fieldB by fieldA.

predict

predict 関数は、回帰モデルまたは関数に基づいて、従属変数の値を予測します。

predict 関数は、splineloessregressolsRegress 関数の出力に基づいて値を予測できます。

predict パラメータ

  • 回帰モデル | 関数: 予測に使用されるモデルまたは関数

  • 数値 | 数値配列 | 行列: 使用される回帰モデルまたは関数に応じて、予測変数は数値、数値配列、または行列のいずれかになります。

predict 構文

predict(regressModel, number) // predict using the output of the <<regress>> function and single numeric predictor. This will return a single numeric prediction.

predict(regressModel, numericArray) // predict using the output of the <<regress>> function and a numeric array of predictors. This will return a numeric array of predictions.

predict(splineFunc, number) // predict using the output of the <<spline>> function and single numeric predictor. This will return a single numeric prediction.

predict(splineFunc, numericArray) // predict using the output of the <<spline>> function and a numeric array of predictors. This will return a numeric array of predictions.

predict(olsRegressModel, numericArray) // predict using the output of the <<olsRegress>> function and a numeric array containing one multi-variate predictor. This will return a single numeric prediction.

predict(olsRegressModel, matrix) // predict using the output of the <<olsRegress>> function and a matrix containing rows of multi-variate predictor arrays. This will return a numeric array of predictions.

primes

primes 関数は、指定された数値から始まる素数の配列を返します。

primes パラメータ

  • 整数: リストで返す素数の数

  • 整数: 素数を返す開始点

primes 返り値

数値配列。

primes 構文

primes(100, 2000) // returns 100 primes starting from 2000

probability

probability 関数は、確率分布内の確率変数の確率を返します。

probability 関数は、連続および離散確率分布の両方について、確率変数の範囲間の確率を計算します。

probability 関数は、離散確率分布のみの場合、特定の確率変数に対する確率を計算できます。

probability パラメータ

  • 確率分布: 確率を計算する確率分布。

  • 数値: 範囲の低い値。

  • 数値: (離散確率分布の場合はオプション) 範囲の高い値。高い範囲が省略された場合、確率関数は低い範囲の値に対する確率を計算します。

probability 構文

probability(poissonDistribution(10), 7) // Returns the probability of a random sample of 7 in a poisson distribution with a mean of 10.

probability(normalDistribution(10, 2), 7.5, 8.5) // Returns the probability between the range of 7.5 to 8.5 for a normal distribution with a mean of 10 and standard deviation of 2.

probability 返り値

double: 確率

rank

rank は、数値配列に対して順位変換を実行します。

rank パラメータ

  • 数値配列

rank 構文

rank(numericArray)

raw

raw 関数は、パラメータである生の値そのものを返します。これは、文字列を別の評価器の一部として使用する場合に便利です。

raw パラメータ

  • 生の値

raw 構文

以下の式は、raw 評価器を使用できるさまざまな方法を示しています。内部にあるものはそのまま返されます。内部評価器は文字列とみなされ、評価されません。

raw(foo) // "foo"
raw(count(*)) // "count(*)"
raw(45) // 45
raw(true) // "true" (note: this returns the string "true" and not the boolean true)
eq(raw(fieldA), fieldA) // true if the value of fieldA equals the string "fieldA"

regress

regress 関数は、2つの数値配列の単純な回帰を実行します。

この式の結果は、predict 関数でも使用されます。

regress パラメータ

  • 数値配列

  • 数値配列

regress 構文

regress(numericArray1, numericArray2)

rev

rev 関数は、数値配列の順序を反転します。

rev パラメータ

  • 数値配列

rev 構文

rev(numericArray)

round

round 関数は、引数に最も近い整数を返します。

round パラメータ

  • フィールド名 | 生の値 | 数値評価器: 平方根を返す値。

round 構文

round(100.4)
round(fieldA)
if(gt(fieldA,fieldB),sqrt(fieldA),sqrt(fieldB)) // if fieldA > fieldB then return the round of fieldA, else return the round of fieldB

rowAt

rowAt 関数は、特定のインデックスにある行列の行を数値配列として返します。

rowAt パラメータ

  • matrix: 操作する行列

  • 整数: 返す行のインデックス

rowAt 構文

rowAt(matrix, 10)

rowAt 返り値

数値配列: 行列の行

rowCount

rowCount 関数は、行列内の行数を返します。

rowCount パラメータ

  • matrix: 操作する行列

rowCount 構文

rowCount(matrix)

rowCount 返り値

整数: 行列内の行数。

sample

sample 関数は、確率分布またはマルコフ連鎖からランダムサンプルを抽出するために使用できます。

sample パラメータ

  • 確率分布 | マルコフ連鎖: サンプリングする分布またはマルコフ連鎖。

  • 整数: (オプション) サンプルサイズ。デフォルトは1です。

sample 返り値

サンプルサイズのパラメータに応じて、単一の数値ランダムサンプル、または数値配列のいずれか。

sample 構文

sample(poissonDistribution(5)) // Returns a single random sample from a poissonDistribution with mean of 5.
sample(poissonDistribution(5), 1000) // Returns 1000 random samples from poissonDistribution with a mean of 5.
sample(markovChain(transitionMatrix), 1000) // Returns 1000 random samples from a Markov Chain.

scalarAdd

scalarAdd 関数は、数値配列または行列内のすべての値にスカラ値を追加します。数値配列を操作する場合、scalarAdd は新しい値を持つ新しい配列を返します。行列を操作する場合、scalarAdd は新しい値を持つ新しい行列を返します。

scalarAdd パラメータ

数値: 追加する値 数値配列 | 行列: 値を追加する数値配列または行列。

scalarAdd 構文

scalarAdd(number, numericArray) // Adds the number to each element in the number in the array.
scalarAdd(number, matrix) // Adds the number to each value in a matrix

scalarAdd 返り値

numericArray | 行列: 何が操作されているかによって異なります。

scalarDivide

scalarDivide 関数は、数値配列または行列内の各数値をスカラ値で除算します。数値配列を操作する場合、scalarDivide は新しい値を持つ新しい配列を返します。行列を操作する場合、scalarDivide は新しい値を持つ新しい行列を返します。

scalarDivide パラメータ

数値: 除算する値 数値配列 | 行列: 値で除算する数値配列または行列。

scalarDivide 構文

scalarDivide(number, numericArray) // Divides each element in the numeric array by the number.
scalarDivide(number, matrix) // Divides each element in the matrix by the number.

scalarDivide 返り値

numericArray | 行列: 何が操作されているかによって異なります。

scalarMultiply

scalarMultiply 関数は、数値配列または行列内の各要素にスカラ値を乗算します。数値配列を操作する場合、scalarMultiply は新しい値を持つ新しい配列を返します。行列を操作する場合、scalarMultiply は新しい値を持つ新しい行列を返します。

scalarMultiply パラメータ

数値: 除算する値 数値配列 | 行列: 値で除算する数値配列または行列。

scalarMultiply 構文

scalarMultiply(number, numericArray) // Multiplies each element in the numeric array by the number.
scalarMultiply(number, matrix) // Multiplies each element in the matrix by the number.

scalarMultiply 返り値

numericArray | 行列: 何が操作されているかによって異なります

scalarSubtract

scalarSubtract 関数は、数値配列または行列内のすべての値からスカラ値を減算します。数値配列を操作する場合、scalarSubtract は新しい値を持つ新しい配列を返します。行列を操作する場合、scalarSubtract は新しい値を持つ新しい行列を返します。

scalarSubtract パラメータ

数値: 追加する値 数値配列 | 行列: 値を減算する数値配列または行列。

scalarSubtract 構文

scalarSubtract(number, numericArray) // Subtracts the number from each element in the number in the array.
scalarSubtract(number, matrix) // Subtracts the number from each value in a matrix

scalarSubtract 返り値

numericArray | 行列: 何が操作されているかによって異なります。

scale

scale 関数は、配列のすべての要素に数値を乗算します。

scale パラメータ

  • 数値

  • 数値配列

scale 構文

scale(number, numericArray)

sequence

sequence 関数は、そのパラメータに基づいて数値の配列を返します。

sequence パラメータ

  • 長さ

  • 開始

  • ストライド

sequence 構文

sequence(100, 0, 1) // Returns a sequence of length 100, starting from 0 with a stride of 1.

setAttributes

setAttributes 関数は、行列の属性マップを設定します。

setAttributes パラメータ

  • 行列: 属性マップを設定する行列。

  • マップ: 行列に設定する属性のマップ。

setAttributes 構文

setAttributes(matrix, map)

setAttributes 返り値

行列: 属性が設定された行列。

setColumnLabels

setColumnLabels 関数は、行列の列ラベルを設定します。

setColumnLabels パラメータ

  • 行列: 列ラベルを設定する行列。

  • 文字列配列: 行列に設定する列ラベル

setColumnLabels 構文

setColumnLabels(行列, ラベル)

setColumnLabels 返り値

行列: ラベルが設定された行列。

setRowLabels

setRowLabels 関数は、行列の行ラベルを設定します。

setRowLabels パラメータ

  • 行列: 行ラベルを設定する行列。

  • 文字列配列: 行列に設定する行ラベル

setRowLabels 構文

setRowLabels(行列, ラベル)

setRowLabels 返り値

行列: ラベルが設定された行列。

setValue

setValue 関数は、タプルエントリの新しい値を設定します。

setValue パラメータ

  • tuple: エントリを取得する対象のタプル。

  • キー: 設定するエントリのキー。

  • : 設定する値。

setValue 構文

setValue(タプル, キー, 値)

setValue 返り値

タプル: 変更された新しいタプルを返します

sin

sin 関数は、数値の三角正弦を返します。

sin パラメータ

  • フィールド名 | 生の値 | 数値評価器: 正弦を返す値。

sin 構文

sin(100.4)  // returns the sine of 100.4
sine(fieldA) // returns the sine for fieldA.
if(gt(fieldA,fieldB),sin(fieldA),sin(fieldB)) // if fieldA > fieldB then return the sine of fieldA, else return the sine of fieldB

spline

spline 関数は、一連のx、y座標が与えられた曲線の三次スプライン補間(https://en.wikiversity.org/wiki/Cubic_Spline_Interpolation)を実行します。スプライン関数の戻り値は、曲線に沿って値を予測し、曲線の導関数を生成するために使用できる補間関数です。

spline パラメータ

  • 数値配列: (オプション) x 値。省略すると、x 値のシーケンスが作成されます。

  • 数値配列: y 値

spline 構文

spline(yValues) // This creates the xValues automatically and fits a spline through the data points.
spline(xValues, yValues) // This will fit a spline through the data points.

spline 返り値

関数: 関数は数値配列関数の両方として扱えます。

sqrt

sqrt 関数は、数値の三角平方根を返します。

sqrt パラメータ

  • フィールド名 | 生の数値 | 数値評価器: 平方根を返す値。

sqrt 構文

sqrt(100.4)  // returns the square root of 100.4
sqrt(fieldA) // returns the square root for fieldA.
if(gt(fieldA,fieldB),sqrt(fieldA),sqrt(fieldB)) // if fieldA > fieldB then return the sqrt of fieldA, else return the sqrt of fieldB

standardize

standardize 関数は、数値配列内の値が平均 0、標準偏差 1 になるように、数値配列を標準化します。

standardize パラメータ

  • 数値配列: 標準化する配列

standardize 構文

standardize(numericArray)

standardize の戻り値

数値配列: 標準化された値

sub

sub 関数は、2 つ以上の数値を左から右へ減算します。いずれかの値が数値でない場合、sub 関数は実行に失敗します。null 値が見つかった場合は、結果として null が返されます。

sub パラメータ

  • フィールド名 | 生の数値 | 数値評価機能

  • フィールド名 | 生の数値 | 数値評価機能

  • …​…​

  • フィールド名 | 生の数値 | 数値評価機能

sub 構文

以下の式は、sub 評価器を使用できるさまざまな方法を示しています。これらのパラメータの数は重要ではなく、少なくとも 2 つのパラメータが必要であるという点を除いて制限はありません。数値が返されます。

sub(1,2,3,4) // 1 - 2 - 3 - 4
sub(1,fieldA) // 1 - value of fieldA
sub(fieldA,1.4) // value of fieldA - 1.4
sub(fieldA,fieldB,fieldC) // value of fieldA - value of fieldB - value of fieldC
sub(fieldA,div(fieldA,fieldB)) // value of fieldA - (value of fieldA / value of fieldB)
if(gt(fieldA,fieldB),sub(fieldA,fieldB),sub(fieldB,fieldA)) // if fieldA > fieldB then fieldA - fieldB, else fieldB - field

sumDifference

sumDifference 関数は、2 つの数値配列間の要素ごとの減算に続く差の合計を計算します。

sumDifference パラメータ

  • 数値配列

  • 数値配列

sumDifference の戻り値

数値。

sumDifference 構文

sumDifference(numericArray, numericArray)

sumColumns

sumColumns 関数は、行列内の列の合計を計算し、結果を含む数値配列を返します。

sumColumns パラメータ

  • matrix: 操作する行列

sumColumns 構文

sumColumns(matrix)

sumColumns の戻り値

数値配列: 列の合計

sumRows

sumRows 関数は、行列内の行の合計を計算し、結果を含む数値配列を返します。

sumRows パラメータ

  • matrix: 操作する行列

sumRows 構文

sumRows(matrix)

sumRows の戻り値

数値配列: 行の合計。

sumSq

sumSq 関数は、数値配列内の値の二乗和を返します。

sumSq パラメータ

  • 数値配列: sumSq を計算する数値配列。

sumSq 構文

sumSq(numericArray)

sumSq の戻り値

数値: sumSq 計算の結果

transpose

transpose 関数は、行列を転置します。

transpose パラメータ

  • 行列: 転置する行列

transpose 構文

transpose(matrix)

transpose の戻り値

行列: 転置された行列

triangularDistribution

triangularDistribution 関数は、パラメータに基づいて三角確率分布を返します。この関数は確率分布フレームワークの一部であり、sampleprobabilitycumulativeProbability の各関数と連携するように設計されています。

triangularDistribution パラメータ

  • double: 低い値

  • double: 最も可能性の高い値

  • double: 高い値

triangularDistribution 構文

triangularDistribution(10, 15, 20) // A triangular distribution with a low value of 10, most likely value of 15 and high value of 20.

triangularDistribution の戻り値

確率分布関数

uniformDistribution

uniformDistribution 関数は、パラメータに基づいて連続一様確率分布を返します。離散一様分布を扱うには、uniformIntegerDistribution を参照してください。この関数は確率分布フレームワークの一部であり、sample および cumulativeProbability の各関数と連携するように設計されています。

uniforDistribution パラメータ

  • double: 開始

  • double: 終了

uniformDistribution の戻り値

確率分布関数。

uniformDistribution 構文

uniformDistribution(0.0, 100.0)

uniformIntegerDistribution

uniformIntegerDistribution 関数は、パラメータに基づいて離散一様確率分布を返します。連続一様分布を扱うには、uniformDistribution を参照してください。この関数は確率分布フレームワークの一部であり、sampleprobabilitycumulativeProbability の各関数と連携するように設計されています。

uniformIntegerDistribution パラメータ

  • integer: 開始

  • integer: 終了

uniformIntegerDistribution の戻り値

確率分布関数。

uniformIntegerDistribution 構文

uniformDistribution(1, 6)

unitize

unitize 関数は、数値配列を 1 の大きさにスケーリングします。これは多くの場合、単位ベクトルと呼ばれます。unitize 関数は、数値配列と行列の両方で動作できます。

行列を操作する場合、unitize 関数は行列の各行を単位化します。

unitize パラメータ

  • 数値配列 | 行列: 単位化する配列または行列

unitize 構文

unitize(numericArray) // Unitize a numeric array
unitize(matrix) // Unitize each row in a matrix

unitize の戻り値

数値配列 | 行列

weibullDistribution

weibullDistribution 関数は、パラメータに基づいてワイブル確率分布を返します。この関数は確率分布フレームワークの一部であり、samplekolmogorovSmirnovcumulativeProbability の各関数と連携するように設計されています。

weibullDistribution パラメータ

  • double: 形状

  • double: スケール

weibullDistribution の戻り値

確率分布関数。

weibullDistribution 構文

weibullDistribution(.5, 10)

zipFDistribution

zipFDistribution 関数は、パラメータに基づいてZipF 分布を返します。この関数は確率分布フレームワークの一部であり、sampleprobabilitycumulativeProbability の各関数と連携するように設計されています。

zipFDistribution パラメータ

  • integer: サイズ

  • double: 指数

zipFDistribution の戻り値

確率分布関数。

zipFDistribution 構文

zipFDistribution(5000, 1.0)