Plan Documentation

Array Plans (0.9.2)

Plans to Get an Array


Custom

Summery

Make a custom array

Description

Make an array value-by-value. The output array is computed as the result of the text expression x.

Expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^) and modulus (%)
  • Numerical operations: sign, abs, ceil, floor, trunc, round, erf, sinc
  • Exponentiation operations: exp, pow, sqrt, logistic, logit
  • Combinatorial operations: fac, ncr, npr
  • Logarithmic operations: exp, ln (natural logarithm), log (base-10 logarithm), log10
  • Trigonometric functions: sin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc
  • Hyperbolic functions: sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
  • Conditional operations: clamp, clean, disc, replace, replaceri, replacerx
  • Constants: pi, e

Example

x = {10}{10}
x = {3*2-7,pi}{-1,3.14159}
x = $B1B1

Fill

Summery

Fill an array with values

Description

Fill an array of size n with values in array a. If enough values are not available in a, the last value is repeated.

Example

a = {3};n = {2}{3,3}
a = {1,3,5};n = {4}{1,3,5,5}

Expression

Summery

Fill an array using an expression

Description

Make an array of size n using expression f(i) for each i.

Expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^) and modulus (%)
  • Numerical operations: sign, abs, ceil, floor, trunc, round, erf, sinc
  • Exponentiation operations: exp, pow, sqrt, logistic, logit
  • Combinatorial operations: fac, ncr, npr
  • Logarithmic operations: exp, ln (natural logarithm), log (base-10 logarithm), log10
  • Trigonometric functions: sin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc
  • Hyperbolic functions: sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
  • Conditional operations: clamp, clean, disc, replace, replaceri, replacerx
  • Constants: pi, e

Example

n = {6};f = {i+1}{1,2,3,4,5,6}
n = {3};f = {2*i-3}{-3,-1,1}
n = {4};f = {i^2}{0,1,4,9}

Polynomial Expansion

Summery

Fill an array with a polynomial expansion

Description

Make an array of size n with polynomial expansion a[0]+a[1]×i+a[2]×i2+... for each i.

Example

n = {3};a = {0,1}{0,1,2}
n = {2};a = {1,2,3}{1,6,17}

Trigonometric Expansion

Summery

Fill an array with a trigonometric expansion

Description

Make an array of size n with trigonometric expansion a[0]+a[1]×sin(a[2]×i+a[3])+... for each i.

Example

n = {3};a = {0,1,1}{0,0.841471,0.909297}

Discrete Uniform Randomized

Summery

Randomize an array with discrete uniform distribution

Description

Make an array of size n with discrete uniform distribution in [a,b].

Example

n = {6};a = {0};b = {5}{0,5,0,2,5,1}

Continuous Uniform Randomized

Summery

Randomize an array with continuous uniform distribution

Description

Make an array of size n with continuous uniform distribution in [a,b].

Example

n = {3};a = {0};b = {5}{4.49707,3.66767,4.45034}

Normal Randomized

Summery

Randomize an array with normal distribution

Description

Make an array of size n with normal distribution (μ:mean and σ:standard deviation).

Example

n = {3};μ = {0};σ = {1}{1.78336,-1.01009,-1.02254}

Lognormal Randomized

Summery

Randomize an array with lognormal distribution

Description

Make an array of size n with lognormal distribution (μ:mean and σ:standard deviation of the natural logarithm of values).

Example

n = {3};μ = {0};σ = {1}{0.700991,2.64274,10.5239}

Chi-squared Randomized

Summery

Randomize an array with chi-squared distribution

Description

Make an array of size n with chi-squared distribution of k degrees of freedom.

Example

n = {3};k = {1}{0.438988, 1.37627, 15.1283}

Cauchy Randomized

Summery

Randomize an array with Cauchy distribution

Description

Make an array of size n with Cauchy distribution with parameters x0 and γ.

Example

n = {3};x0 = {0};y = {1}{4.49707,3.66767,4.45034}

Student Randomized

Summery

Randomize an array with Student's t-distribution

Description

Make an array of size n with Student's t-distribution of k degrees of freedom.

Example

n = {3};k = {1}{-4.17236,0.468947,-0.964786}

Poisson Randomized

Summery

Randomize an array with Poisson distribution

Description

Make an array of size n with (discrete) Poisson distribution of rate λ.

Example

n = {3};λ = {1}{0,3,0}

Exponential Randomized

Summery

Randomize an array with exponential distribution

Description

Make an array of size n with exponential distribution of rate λ.

Example

n = {3};λ = {1}{0.391728,0.413417,0.31972}

Weibull Randomized

Summery

Randomize an array with Weibull distribution

Description

Make an array of size n with Weibull distribution (λ:shape parameter and k:scale parameter).

Example

n = {3};λ = {1};k = {1}{0.590739,0.616865,0.495008}

Import From Text File Along Rows

Summery

Import an array from text file along rows

Description

Import an array from a text file at file name, starting from row and column (counted from 0), and separated by delimiter along rows.

Example

file name = {tests\mnist_test.csv};delimiter = {,};row = {1};col = {0}{2,0,0,...}
file name = {tests\rows.txt};delimiter = {;};row = {1};col = {0}{2,3}

Import From Text File Along Columns

Summery

Import an array from text file along columns

Description

Import an array from a text file at file name, starting from row and column (counted from 0), and separated by delimiter along columns.

Example

file name = {tests\data_sample.txt};delimiter = {;};row = {1};col = {0}{2,3,4}
file name = {tests\columns.txt};delimiter = {,};row = {1};col = {0}{2,3,3.14}

Import From Binary File

Summery

Import an array from binary file

Description

Import an array from a binary file at file name.

Example

file name = {tests\arrays.bin}{1,2,3,3.14159}

Scrape From JSON File

Summery

Scrape an array from JSON file

Description

Scrape an array from a JSON file at file name with a key.

Example

file name = {tests\stock_query_IBM.json};key = {4. close}{...}

Scrape From JSON on Network

Summery

Scrape an array from JSON on network

Description

Request and scrape an array from a JSON file at network address with a key.

Example

address = {https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=IBM&api key=demo};key = {4. close}{...}

Alpha Vantage - Stock Price

Summery

Import stock prices using Alpha Vantage API (third party)

Description

Import historical prices of a symbol using Alpha Vantage API. Requests require a function and are authorized by an api key. Some functions may also require definition of an exchange market or a time interval. Values assigned to a token (e.g. close for closing price, open for opening price, etc.) are collected to form the output array. If not_adjusted is empty, the data is adjusted by historical split and dividend events. If no_extended_hours is empty, the output will include the extended (pre- and post- market) trading hours (4:00am to 8:00pm Eastern Time for the US market). If is_full is empty, output is in compact form with the more recent data points in the time series.

Notes:

  1. To acquire an api key, go to https://www.alphavantage.co/support.
  2. To learn more about the api parameters, go to https://www.alphavantage.co/documentation.
  3. This plan requests data from Alpha Vantage servers by sharing the plan parameters. Alpha Vantage privacy policy is available at https://www.alphavantage.co/privacy.
  4. Network timeout (Settings/Connection Timeout) may need to be raised to allow enough time for API response to arrive.
  5. Plan to generate the complete API response is available under Text Plans/Get/Response of Third-Party API.

Example

function = {TIME_SERIES_DAILY};symbol = {IBM};token = {close};market = {};interval = {};api key = {demo}{...}
function = {CRYPTO_INTRADAY};symbol = {ETH};token = {high};market = {USD};interval = {5min};api key = {demo}{...}

Plans to Reorganize an Array


Copy

Summery

Copy array

Description

Copy values of array x.

Example

x = {1,2,3}{1,2,3}
x = {1-1,2+pi}{0,5.14159}

Resize From Start

Summery

Resize array from start

Description

Resize array x to n from start by cutting or filling with a at the end.

Example

x = {1,2,3};n = {5};a = {-1}{1,2,3,-1,-1}
x = {1,2,3};n = {2};a = {-1}{1,2}

Resize From End

Summery

Resize array from end

Description

Resize array x to n from end by cutting or filling with a at the start.

Example

x = {1,2,3};n = {5};a = {-1}{-1,-1,1,2,3}
x = {1,2,3};n = {2};a = {-1}{2,3}

Replicate

Summery

Replicate array

Description

Replicate array x by repeating each value m times and the array n times as {x[0](m times), x[1](m times), ...}(n times).

Example

x = {1,2,3};m = {2};n = {3}{1,1,2,2,3,3,1,1,2,2,3,3,1,1,2,2,3,3}

Reverse

Summery

Reverse array

Description

Reverse the order of values in array x.

Example

x = {1,2,3}{3,2,1}

Shift towards Start

Summery

Shift values toward start

Description

Shift and cycle each value in array x toward start by n spots.

Example

x = {1,2,3};n = {1}{2,3,1}

Shift towards End

Summery

Shift values toward end

Description

Shift and cycle each value in array x toward end by n spots.

Example

x = {1,2,3};n = {1}{3,1,2}

Sort in Ascending Order

Summery

Sort in ascending order

Description

Arrange values in array x from smallest to largest.

Example

x = {4,-1,3}{-1,3,4}

Sort in Descending Order

Summery

Sort in descending order

Description

Arrange values in array x from largest to smallest.

Example

x = {4,-1,3}{4,3,-1}

Reorder Randomly

Summery

Randomize the order

Description

Arrange values in array x randomly.

Example

x = {1,2,3}{3,1,2}

Reorder to Next Permutation

Summery

Permute the order

Description

Arrange values in array x to follow the next permutation.

Example

x = {1,2,3}{1,3,2}
x = {1,3,2}{2,1,3}
x = {2,1,3}{2,3,1}
x = {2,3,1}{3,1,2}
x = {3,1,2}{3,2,1}
x = {3,2,1}{1,2,3}

Copy the First Value

Summery

Copy first value of array

Description

Copy the first value in array x.

Example

x = {1,2,3,4,5}{1}

Copy the Last Value

Summery

Copy last value of array

Description

Copy the last value in array x.

Example

x = {1,2,3,4,5}{5}

Remove Values From Start

Summery

Remove indices counted from start

Description

Remove value at index n[k] for each k from array x.

Example

x = {1,2,3,4,5};n = {2}{1,2,4,5}
x = {1,2,3,4,5};n = {2,0,1,2,1,3}{5}

Remove Values From End

Summery

Remove indices counted from end

Description

Remove value at back-index n[k] for each k from array x.

Example

x = {1,2,3,4,5};n = {2}{1,2,4,5}
x = {1,2,3,4,5};n = {2,0,1,2,1,3}{1}

Keep Values From Start

Summery

Keep indices counted from start

Description

Keep value at index n[k] for each k from array x.

Example

x = {1,2,3,4,5};n = {2}{3}
x = {1,2,3,4,5};n = {2,0,1,2,1,3}{3,1,2,3,2,4}

Keep Values From End

Summery

Keep indices counted from end

Description

Keep only value at back-index n[k] for each k from array x.

Example

x = {1,2,3,4,5};n = {2}{3}
x = {1,2,3,4,5};n = {2,0,1,2,1,3}{3,5,4,3,4,2}

Remove Ranges From Start

Summery

Remove index ranges counted from start

Description

Remove values at indices in ranges [from[k], to[k]] for each k.

Example

x = {1,2,3,4,5,6};from = {1,3};to = {1,4}{1,3,6}

Remove Ranges From End

Summery

Remove index ranges counted from end

Description

Remove values at back-indices in ranges [from[k], to[k]] for each k.

Example

x = {1,2,3,4,5,6};from = {1,3};to = {1,4}{1,4,6}

Keep Ranges From Start

Summery

Keep index ranges counted from start

Description

Keep only values at indices in ranges [from[k], to[k]] for each k.

Example

x = {1,2,3,4,5,6};from = {1,3};to = {1,4}{2,4,5}

Keep Ranges From End

Summery

Keep index ranges counted from end

Description

Keep only values at back-indices in ranges [from[k], to[k]] for each k.

Example

x = {1,2,3,4,5,6};from = {1,3};to = {1,4}{2,3,5}

Remove After a Position From Start

Summery

Remove values after a position counted from start

Description

Remove values at indices greater than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{1,2,3}

Remove After a Position From End

Summery

Remove values after a position counted from end

Description

Remove values at back-indices greater than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{4,5,6}

Keep After a Position From Start

Summery

Keep values after a position counted from start

Description

Keep only values at indices greater than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{4,5,6}

Keep After a Position From End

Summery

Keep values after a position counted from end

Description

Keep only values at back-indices greater than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{1,2,3}

Remove Before a Position From Start

Summery

Remove values before a position counted from start

Description

Remove values at indices less than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{5,6}

Remove Before a Position From End

Summery

Remove values before a position counted from end

Description

Remove values at back-indices less than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{1,2}

Keep Before a Position From Start

Summery

Keep values before a position counted from start

Description

Keep only values at indices less than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{1,2,3,4}

Keep Before a Position From End

Summery

Keep values before a position counted from end

Description

Keep only values at back-indices less than or equal to n.

Example

x = {1,2,3,4,5,6};n = {3}{3,4,5,6}

Insert Values From Start

Summery

Insert values at positions counted from start

Description

Insert n[i] copies of a[k] at index p[k] for each k.

Example

x = {1,2,3,4,5,6};n = {1,2};a = {-1,-2};p = {0,3}{-1,1,2,3,-2,-2,4,5,6}

Insert Values From End

Summery

Insert values at positions counted from end

Description

Insert n[i] copies of a[k] at back-index p[k] for each k.

Example

x = {1,2,3,4,5,6};n = {1,2};a = {-1,-2};p = {0,3}{1,2,3,-2,-2,4,5,6,-1}

Copy Ranges From Start

Summery

Copy ranges counted from start

Description

Copy index range [from[k], to[k]] and insert at index p[k] for each k.

Example

x = {1,2,3,4,5,6};from = {1,4};to = {1,5};p = {0,3}{2,1,2,3,5,6,4,5,6}

Copy Ranges From End

Summery

Copy ranges counted from end

Description

Copy back-index range [from[k], to[k]] and insert at back-index p[k] for each k.

Example

x = {1,2,3,4,5,6};from = {1,4};to = {1,5};p = {0,3}{1,2,3,1,2,4,5,6,5}

Swap From Start

Summery

Swap ranges counted from start

Description

Swap values in index range [from, to] with the same-size partition starting from index p.

Example

x = {1,2,3,4,5,6};from = {4};to = {5};p = {0}{5,6,3,4,1,2}

Swap From End

Summery

Swap ranges counted from end

Description

Swap values in back-index range [from, to] with the same-size partition starting from back-index p.

Example

x = {1,2,3,4,5,6};from = {4};to = {5};p = {0}{5,6,3,4,1,2}

Remove Periodically From Start

Summery

Remove periodically from start

Description

Remove every other n values counting from and including the value at offset index.

Example

x = {1,2,3,4,5,6};n = {3};offset = {0}{2,3,5,6}
x = {1,2,3,4,5,6};n = {2};offset = {2}{1,2,4,6}

Remove Periodically From End

Summery

Remove periodically from end

Description

Remove every other n values counting from and including the value at offset back-index.

Example

x = {1,2,3,4,5,6};n = {3};offset = {0}{1,2,4,5}
x = {1,2,3,4,5,6};n = {2};offset = {2}{1,3,5,6}

Keep Periodically From Start

Summery

Keep periodically from start

Description

Keep only every other n values counting from and including the value at offset index.

Example

x = {1,2,3,4,5,6};n = {3};offset = {0}{1,4}
x = {1,2,3,4,5,6};n = {2};offset = {2}{3,5}

Keep Periodically From End

Summery

Keep periodically from end

Description

Keep only every other n values counting from and including the value at offset back-index.

Example

x = {1,2,3,4,5,6};n = {3};offset = {0}{3,6}
x = {1,2,3,4,5,6};n = {2};offset = {2}{2,4}

Optimizer - Iteration Input

Summery

Produce the next iteration input of an optimizer plan

Description

Partition optimizer array x to generate the input for next iteration or the optimized input if optimization is concluded.
An optimizer array is organized as {next | counter | ... | size | is_done}. Next is the input for next iteration or the optimized input if optimization is concluded, counter is the number of iterations since the beginning of optimization, size is the input size, and is_done is the termination flag.

Example

x = {1,2,3,0,0,0,4,2,1}{1,2}

Optimizer - Iteration Counter

Summery

Produce the iteration counter of an optimizer plan

Description

Partition optimizer array x to generate the number of iterations since the beginning of optimization.
An optimizer array is organized as {next | counter | ... | size | is_done}. Next is the input for next iteration or the optimized input if optimization is concluded, counter is the number of iterations since the beginning of optimization, size is the input size, and is_done is the termination flag.

Example

x = {1,2,3,0,0,0,4,2,1}{3}

Remove Values

Summery

Remove values

Description

Remove values equal to any value in a.

Example

x = {1,2,3,4,5,6};a = {4,3.2,1}{2,3,5,6}

Keep Values

Summery

Keep values

Description

Keep only values equal to any value in a.

Example

x = {1,2,3,4,5,6};a = {4,3.2,1}{1,4}

Remove Ranges of Values

Summery

Remove ranges of values

Description

Remove values in ranges [from[k], to[k]] for each k.

Example

x = {1,2,3,4,5,6};from = {1,3.2};to = {1,10}{2,3}

Keep Ranges of Values

Summery

Keep ranges of values

Description

Keep only values in ranges [from[k], to[k]] for each k.

Example

x = {1,2,3,4,5,6};from = {1,3.2};to = {1,10}{1,4,5,6}

Remove High Values

Summery

Remove high values

Description

Remove values greater than or equal to a. For each k, x[k] is removed if it is greater than or equal to a[k], or when unavailable, the last value in a.

Example

x = {1,2,3,4,5,6};a = {3}{1,2}
x = {1,2,3,4,5,6};a = {2,0,3}{1}

Keep High Values

Summery

Keep high values

Description

Keep only values greater than or equal to a. For each k, x[k] is kept only if it is greater than or equal to a[k], or when unavailable, the last value in a.

Example

x = {1,2,3,4,5,6};a = {3}{3,4,5,6}
x = {1,2,3,4,5,6};a = {2,0,3}{2,3,4,5,6}

Remove Low Values

Summery

Remove low values

Description

Remove values less than or equal to a. For each k, x[k] is removed if it is less than or equal to a[k], or when unavailable, the last value in a.

Example

x = {1,2,3,4,5,6};a = {3}{4,5,6}
x = {1,2,3,4,5,6};a = {2,0,3}{2,4,5,6}

Keep Low Values

Summery

Keep low values

Description

Keep only values less than or equal to a. For each k, x[k] is kept only if it is less than or equal to a[k], or when unavailable, the last value in a.

Example

x = {1,2,3,4,5,6};a = {3}{1,2,3}
x = {1,2,3,4,5,6};a = {2,0,3}{1,3}

Remove Far Values

Summery

Remove far values

Description

Remove values when their distance from o is greater than or equal to a. For each k, x[k] is removed when its distance to o[k] is greater than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

x = {1,2,3,4,5,6};a = {2};o = {3}{2,3,4}
x = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{1,3,4,5}

Keep Far Values

Summery

Keep far values

Description

Keep values only when their distance from o is greater than or equal to a. For each k, x[k] is kept only when its distance to o[k] is greater than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

x = {1,2,3,4,5,6};a = {2};o = {3}{1,5,6}
x = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{2,6}

Remove Close Values

Summery

Remove close values

Description

Remove values when their distance from o is less than or equal to a. For each k, x[k] is removed when its distance to o[k] is less than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

x = {1,2,3,4,5,6};a = {2};o = {3}{6}
x = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{2}

Keep Close Values

Summery

Keep close values

Description

Keep values only when their distance from o is less than or equal to a. For each k, x[k] is kept only when its distance to o[k] is less than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

x = {1,2,3,4,5,6};a = {2};o = {3}{1,2,3,4,5}
x = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{1,3,4,5,6}

Trim Sides

Summery

Trim start and end with value

Description

Remove values while they are equal to any value in a from start or any value in b from end.

Example

x = {1,1,2,3,4,5,6,6};a = {1};b = {6}{2,3,4,5}
x = {1,1,2,3,4,5,6,6};a = {2,1};b = {}{3,4,5,6,6}
x = {1,1,2,3,4,5,6,6};a = {};b = {2,3,6}{1,1,2,3,4,5}

Trim Equal Values From Sides

Summery

Trim start and end

Description

Remove values while they are equal to the first value from start or the last value from end.

Example

x = {1,1,2,3,4,5,6,6}{2,3,4,5}

Trim Equal Values From Start

Summery

Trim start

Description

Remove values while they are equal to the first value from start.

Example

x = {1,1,2,3,4,5,6,6}{2,3,4,5,6,6}

Trim Equal Values From End

Summery

Trim end

Description

Remove values while they are equal to the last value from end.

Example

x = {1,1,2,3,4,5,6,6}{1,1,2,3,4,5}

Keep Uniques

Summery

Keep unique values

Description

Remove consecutive repeating values.

Example

x = {1,2,2,3,4,4,5,6}{1,2,3,4,5,6}

Keep Finites

Summery

Keep finite values

Description

Remove occurrences of +/-inf and nan.

Example

x = {1,1/0,2,-2/0,3,nan,4}{1,2,3,4}

Keep Extremes (by Value)

Summery

Keep peaks and valleys

Description

Keep only peaks (values greater than neighboring values) and valleys (values less than neighboring values).

Example

x = {1,2,3,3,2,1}{1,3,1}
x = {1,2,3,3,2,1,2,2,3,3}{1,3,1,3}

Remove Small Variations (by Value)

Summery

Hysteresis filter by value

Description

Remove values where deviation from neighboring values is less then a.

Example

x = {1,2,2.2,3};a = {0.5}{1,2,3}

Remove Small Variations (by Ratio)

Summery

Hysteresis filter by ratio

Description

Remove values where deviation from neighboring values is less then a times their value.

Example

x = {1,2,2.2,3};a = {0.1}{1,2,3}

Remove Large Variations (by Value)

Summery

Remove spikes by value

Description

Remove peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from neighboring values is greater than a.

Example

x = {1,2,3,10,3,2,1};a = {5}{1,2,3,3,2,1}
x = {1,2,3,10,3,2,1};a = {9}{1,2,3,10,3,2,1}

Remove Large Variations (by Ratio)

Summery

Remove spikes by ratio

Description

Remove peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from neighboring values is greater than a times their value.

Example

x = {1,2,3,10,3,2,1};a = {2}{1,2,3,3,2,1}
x = {1,2,3,10,3,2,1};a = {3}{1,2,3,10,3,2,1}

Remove Large Deviations From Moving Average (by Value)

Summery

Remove spikes by distance from baseline

Description

Remove peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from moving average with window size w is greater than a.

Example

x = {1,2,3,10,3,2,1};w = {3};a = {4}{1,2,3,3,2,1}
x = {1,2,3,10,3,2,1};w = {3};a = {5}{1,2,3,10,3,2,1}

Remove Large Deviations From Moving Average (by Ratio)

Summery

Remove spikes by distance from baseline relative to average

Description

Remove peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from moving average with window size w is greater than a times the moving average.

Example

x = {1,2,3,10,3,2,1};w = {3};a = {0.5}{1,2,3,3,2,1}
x = {1,2,3,10,3,2,1};w = {3};a = {1}{1,2,3,10,3,2,1}

Remove Large Deviations From Moving Average (by σ-Ratio)

Summery

Remove spikes by distance from baseline relative to standard deviation

Description

Remove peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from moving average with window size w is greater than a times the moving standard deviation.

Example

x = {1,2,3,10,3,2,1};w = {3};a = {0.7}{1,2,3,3,2,1}
x = {1,2,3,10,3,2,1};w = {3};a = {1}{1,2,3,10,3,2,1}

Plans to Reorganize Across Arrays


Nth Array

Summery

Copy an array

Description

Copy values of the nth array.

Example

x0 = {1,2,3};x1 = {4,5};n = {1}{4,5}

First Non-Empty Array

Summery

Copy the first non-empty array

Description

Copy values of the first non-empty array between x0,x1,... . This plan does not cascade refresh requests to its parameters x0,x1,... .

Example

x0 = {};x1 = {};x2 = {7,6,8};x3 = {1,2}{7,6,8}

Values From Arrays

Summery

Copy from arrays

Description

Copy the k-th value of the n[k]th array for each k. If n[k] is not available, the last value in n is considered. If the k-th value is not available in the n[k]th array, a[k], or the last value in a when not available, is considered.

Example

x0 = {1,2,3};x1 = {4,5};n = {1};a = {-1}{4,5,-1}
x0 = {1,2,3};x1 = {4,5};n = {1,0,0};a = {0}{4,2,3}
x0 = {1,2,3};x1 = {4,5};n = {1,0,1};a = {-1.-2}{4,2,-2}

Stitch

Summery

Stitch arrays one-after-another

Description

Combine arrays as x0[0],x0[1],...,x1[0],x1[1],... .

Example

x0 = {1,2,3};x1 = {4,5}{1,2,3,4,5}

Shuffle

Summery

Shuffle arrays

Description

Combine arrays as x0[0],x1[0],...,x0[1],x1[1],... .

Example

x0 = {1,2,3};x1 = {4,5}{1,4,2,5,3}

Stitch and Repeat

Summery

Stitch arrays one-after-another and replicate

Description

Combine arrays by stitching m repeats of each array and replicating the result n times as ((x0[0],x0[1],...)×m,(x1[0],x1[1],...)×m,...)×n.

Example

x0 = {1,2,3};x1 = {4,5};m = {2};n = {3}{1,2,3,1,2,3,4,5,4,5, 1,2,3,1,2,3,4,5,4,5, 1,2,3,1,2,3,4,5,4,5}

Shuffle and Repeat

Summery

Shuffle arrays and replicate

Description

Combine arrays by shuffling m repeats of each array and replicating the result n times as ((x0[0],x1[0],...)×m,(x0[1],x1[1],...)×m,...)×n.

Example

x0 = {1,2,3};x1 = {4,5};m = {2};n = {3}{1,4,1,4,2,5,2,5,3,3, 1,4,1,4,2,5,2,5,3,3, 1,4,1,4,2,5,2,5,3,3}

Remove Values (Based on Another Array)

Summery

Conditionally remove values

Description

Remove source values when their corresponding reference values are equal to any value in a.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {4,3.2,1}{5,4,2,1}

Keep Values (Based on Another Array)

Summery

Conditionally keep values

Description

Keep source values only when their corresponding reference values are equal to any value in a.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {4,3.2,1}{6,3}

Remove Ranges of Values (Based on Another Array)

Summery

Conditionally remove ranges of values

Description

Remove source values when their corresponding reference values are in ranges [from[k], to[k]] for each k.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};from = {1,3.2};to = {1,10}{5,4}

Keep Ranges of Values (Based on Another Array)

Summery

Conditionally keep ranges of values

Description

Keep source values only when their corresponding reference values are in ranges [from[k], to[k]] for each k.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};from = {1,3.2};to = {1,10}{6,3,2,1}

Remove High Values (Based on Another Array)

Summery

Conditionally remove high values

Description

Remove source values when their corresponding reference values are greater than or equal to a. For each k, source[k] is removed when reference[k] is greater than or equal to a[k], or when unavailable, the last value in a.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {3}{6,5}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3}{6}

Keep High Values (Based on Another Array)

Summery

Conditionally keep high values

Description

Keep source values only when their corresponding reference values are greater than or equal to a. For each k, source[k] is kept only when reference[k] is greater than or equal to a[k], or when unavailable, the last value in a.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {3}{4,3,2,1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3}{5,4,3,2,1}

Remove Low Values (Based on Another Array)

Summery

Conditionally remove low values

Description

Remove source values when their corresponding reference values are less than or equal to a. For each k, source[k] is removed when reference[k] is less than or equal to a[k], or when unavailable, the last value in a.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {3}{3,2,1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3}{5,3,2,1}

Keep Low Values (Based on Another Array)

Summery

Conditionally keep low values

Description

Keep source values only when their corresponding reference values are less than or equal to a. For each k, source[k] is kept only when reference[k] is less than or equal to a[k], or when unavailable, the last value in a.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {3}{6,5,4}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3}{6,4}

Remove Far Values (Based on Another Array)

Summery

Conditionally remove far values

Description

Remove source values when the distance of their corresponding reference values from o is greater than or equal to a. For each k, source[k] is removed when the distance of reference[k] to o[k] is greater than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2};o = {3}{5,4,3}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{6,4,3,2}

Keep Far Values (Based on Another Array)

Summery

Conditionally keep far values

Description

Keep source values only when the distance of their corresponding reference values from o is greater than or equal to a. For each k, source[k] is kept only when the distance of reference[k] to o[k] is greater than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2};o = {3}{6,2,1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{5,1}

Remove Close Values (Based on Another Array)

Summery

Conditionally remove close values

Description

Remove source values when the distance of their corresponding reference values from o is less than or equal to a. For each k, source[k] is removed when the distance of reference[k] to o[k] is less than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2};o = {3}{1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{5}

Keep Close Values (Based on Another Array)

Summery

Conditionally keep close values

Description

Keep source values only when the distance of their corresponding reference values from o is less than or equal to a. For each k, source[k] is kept only when the distance of reference[k] to o[k] is less than or equal to a[k]. When unavailable, the last values in o and a are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2};o = {3}{6,5,4,3,2}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {2,0,3};o = {0,3}{6,4,3,2,1}

Trim Sides (Based on Another Array)

Summery

Conditionally trim start and end with value

Description

Remove source values while their corresponding reference values are equal to any value in a from start or any value in b from end.

Example

source = {8,7,6,5,4,3,2,1};reference = {1,1,2,3,4,5,6,6};a = {1};b = {6}{6,5,4,3}
source = {8,7,6,5,4,3,2,1};reference = {1,1,2,3,4,5,6,6};a = {2,1};b = {}{5,4,3,2,1}
source = {8,7,6,5,4,3,2,1};reference = {1,1,2,3,4,5,6,6};a = {};b = {2,3,6}{8,7,6,5,4,3}

Trim Equal Values From Sides (Based on Another Array)

Summery

Conditionally trim start and end

Description

Remove source values while their corresponding reference values are equal to the first value from start or the last value from end.

Example

source = {8,7,6,5,4,3,2,1};reference = {1,1,2,3,4,5,6,6}{6,5,4,3}

Trim Equal Values From Start (Based on Another Array)

Summery

Conditionally trim start

Description

Remove source values while their corresponding reference values are equal to the first value from start.

Example

source = {8,7,6,5,4,3,2,1};reference = {1,1,2,3,4,5,6,6};{6,5,4,3,2,1}

Trim Equal Values From End (Based on Another Array)

Summery

Conditionally trim end

Description

Remove source values while their corresponding reference values are equal to the last value from end.

Example

source = {8,7,6,5,4,3,2,1};reference = {1,1,2,3,4,5,6,6};{8,7,6,5,4,3}

Keep Uniques (Based on Another Array)

Summery

Conditionally keep unique values

Description

Remove source values where their corresponding reference values are consecutively repeating.

Example

source = {8,7,6,5,4,3,2,1};reference = {1,2,2,3,4,4,5,6}{8,7,5,4,2,1}

Keep Finites (Based on Another Array)

Summery

Conditionally keep finite values

Description

Remove source values where their corresponding reference values are +/-inf or nan.

Example

source = {1,2,3,4};reference = {1,1/0,2,-2/0}{1,3}

Union Set Operation

Summery

Apply set union

Description

Apply set union x0x1x2 ⋃ ... .Order is preserved and repeated values are ignored.

Example

x0 = {1,2,3};x1 = {2,3,4}{1,2,3,4}

Intersection Set Operation

Summery

Apply set intersection

Description

Apply set intersection x0x1x2 ⋂ ... .Order is preserved and repeated values are ignored.

Example

x0 = {1,2,3};x1 = {2,3,4}{2,3}

Exclusion Set Operation

Summery

Apply set exclusion

Description

Apply set exclusion x-s0-s1-... .Order is preserved and repeated values are ignored.

Example

x0 = {1,2,3};s0 = {2,3,4}{1}

Plans to Make an Array


Set Values From Start

Summery

Set values at indices counted from start

Description

Set value at index n[k] to a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4,5,6};n = {1,3};a = {0}{1,0,3,0,5,6}
x = {1,2,3,4,5,6};n = {1,3};a = {7,8}{1,7,3,8,5,6}

Set Values From End

Summery

Set values at indices counted from end

Description

Set value at back-index n[k] to a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4,5,6};n = {1,3};a = {0}{1,2,0,4,0,6}
x = {1,2,3,4,5,6};n = {1,3};a = {7,8}{1,2,8,4,7,6}

Set Ranges From Start

Summery

Set values at index ranges counted from start

Description

Set values at indices in ranges [from[k], to[k]] to a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4,5,6};from = {1,3};to = {1,4};a = {0}{1,0,3,0,0,6}
x = {1,2,3,4,5,6};from = {1,3};to = {1,4};a = {7,8}{1,7,3,8,8,6}
x = {1,2,3,4,5,6};from = {1,3};to = {1,20};a = {0}{1,0,3,0,0,0}

Set Ranges From End

Summery

Set values at index ranges counted from end

Description

Set values at back-indices in ranges [from[k], to[k]] to a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4,5,6};from = {1,3};to = {1,4};a = {0}{1,0,0,4,0,6}
x = {1,2,3,4,5,6};from = {1,3};to = {1,4};a = {7,8}{1,8,8,4,7,6}
x = {1,2,3,4,5,6};from = {1,3};to = {1,20};a = {0}{0,0,0,4,0,6}

Set After a Position From Start

Summery

Set values after a position counted from start

Description

Set values at indices greater than or equal to n to a.

Example

x = {1,2,3,4,5,6};n = {3};a = {0}{1,2,3,0,0,0}

Set After a Position From End

Summery

Set values after a position counted from end

Description

Set values at back-indices greater than or equal to n to a.

Example

x = {1,2,3,4,5,6};n = {3};a = {0}{0,0,0,4,5,6}

Set Before a Position From Start

Summery

Set values before a position counted from start

Description

Set values at indices less than or equal to n to a.

Example

x = {1,2,3,4,5,6};n = {3};a = {0}{0,0,0,0,5,6}

Set Before a Position From End

Summery

Set values before a position counted from end

Description

Set values at back-indices less than or equal to n to a.

Example

x = {1,2,3,4,5,6};n = {3};a = {0}{1,2,0,0,0,0}

Replace Values

Summery

Replace values

Description

Replace values equal to from[k] with a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4,5,6};from = {1};a = {-1}{-1,2,3,4,5,6}
x = {1,2,3,4,5,6};from = {4,2,3};a = {-1,-2,-3}{1,-2,-3,-1,5,6}

Replace Ranges of Values

Summery

Replace ranges of values

Description

Replace values in ranges [from[k], to[k]] with a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4,5,6};from = {1,3.2};to = {1,10};a = {0}{0,2,3,0,0,0}
x = {1,2,3,4,5,6};from = {1,3.2};to = {1,10};a = {7,8,9}{7,2,3,8,8,8}

Replace High Values

Summery

Replace high values

Description

Replace values greater than or equal to b with a. For each k, x[k] is replaced with a[k] if it is greater than or equal to b[k]. When unavailable, the last values in a and b are considered.

Example

x = {1,2,3,4,5,6};b = {3};a = {0}{1,2,0,0,0,0}
x = {1,2,3,4,5,6};b = {1,0,3};a = {2,0}{2,0,0,0,0,0}

Replace Low Values

Summery

Replace low values

Description

Replace values less than or equal to b with a. For each k, x[k] is replaced with a[k] if it is less than or equal to b[k]. When unavailable, the last values in a and b are considered.

Example

x = {1,2,3,4,5,6};b = {3};a = {0}{0,0,0,4,5,6}
x = {1,2,3,4,5,6};b = {1,0,3};a = {2,0}{2,2,0,4,5,6}

Replace Far Values

Summery

Replace far values

Description

Replace values with a when their distances from o are greater than or equal b. For each k, x[k] is replaced with a[k] if its distance to o[k] is greater than or equal to b[k]. When unavailable, the last values in a, b, and o are considered.

Example

x = {1,2,3,4,5,6};b = {2};o = {3};a = {0}{0,2,3,4,0,0}
x = {1,2,3,4,5,6};b = {1,0,2};o = {0,0,3};a = {6,7,0}{6,7,3,4,0,0}

Replace Close Values

Summery

Replace close values

Description

Replace values with a when their distances from o are less than or equal b. For each k, x[k] is replaced with a[k] if its distance to o[k] is less than or equal to b[k]. When unavailable, the last values in a, b, and o are considered.

Example

x = {1,2,3,4,5,6};b = {2};o = {3};a = {0}{0,0,0,0,0,6}
x = {1,2,3,4,5,6};b = {1,0,2};o = {0,0,3};a = {6,7,0}{6,2,0,0,0,6}

Replace inf

Summery

Replace ±inf values

Description

Replace occurrences of +/-inf with a.

Example

x = {1,1/0,2,-2/0};a = {0}{1,0,2,0}

Replace nan

Summery

Replace nan values

Description

Replace occurrences of nan with a.

Example

x = {1,nan,2,nan};a = {0}{1,0,2,0}

Replace Undefined

Summery

Replace non-finite values

Description

Replace occurrences of +/-inf and nan with a.

Example

x = {1,1/0,2,-2/0};a = {0}{1,0,2,0}

Clean

Summery

Zero small values

Description

Replace values when their absolute values are less than or equal to a with 0.

Example

x = {0.1,0.2,1e-5,-0.4};a = {1e-3}{0.1,0.2,0,-0.4}

Clamp

Summery

Limit values

Description

Limit values to [a, b] so that out-of-range values are replaced with the closest of a or b.

Example

x = {1,2,3,4,5,6};a = {2};b = {4}{2,2,3,4,4,4}

Discretize

Summery

Discretize values

Description

Replace values with a corresponding value in a and remove the rest. In the result, x[i] is replaced with a[k] if it is in range [a[k]-δn[k],a[k]+δp[k]]. When unavailable, the last values in δn and δp are considered.

Example

x = {1.2,-2.6,3.3,0.7,-2.1};a = {-3,-2,-1,0,1,2,3};δn = {0.5};δp = {0.5}{1,-3,3,1,-2}
x = {1.2,-2.6,3.3,0.7,-2.1};a = {-2,-1,0,1,2};δn = {0.5};δp = {0.5}{1,1,-2}
x = {1.2,-2.6,3.3,0.7,-2.1};a = {-2,-1,0,1,2};δn = {10,0.5,0.5,0.5,0.5};δp = {0.5,0.5,0.5,0.5,10}{1,-2,2,1,-2}

Scale Linearly

Summery

Shift and scale values

Description

Shift and, then, linearly scale values. The output array is computed as scale[k]×(x[k]+shift[k]) for each k or the last values in shift and scale when not available.

Example

x = {1,2,3,4,5,6};shift = {2};scale = {0.5}{1.5,2,2.5,3,3.5,4}
x = {1,2,3,4,5,6};shift = {2,-2,-2,2};scale = {1,0.5}{3,0,0.5,3,3.5,4}

Scale Linearly to Bounds

Summery

Linearly change the bounds

Description

Shift and linearly scale values to a new minimum and a new maximum.

Example

x = {1,2,3,4,5,6};minimum = {-1};maximum = {1}{-1,-0.6,-0.2,0.2,0.6,1}

Scale Uniformly

Summery

Uniformly change as polynomial

Description

Uniformly (but not necessarily linearly) scale values so that a[k] is moved to b[k] for each k. This scaling interpolates x[k] values on a Lagrange polynomial from values in array a to the corresponding values in array b.

Example

x = {1,2,3,4,5,6};a = {1,6};b = {-1,1}{-1,-0.6,-0.2,0.2,0.6,1}
x = {1,2,3,4,5,6};a = {1,2,6};b = {-1,0,1}{-1,0,0.7,1.1,1.2,1}

General Expression

Summery

Compute general-form expression

Description

Compute general-form expression f = {f[0],f[1],...} where f[i] is a function of i,x,x0,x1,xp1,xn1,... . The output array is computed as f[i] for each i < n or the last function in f when no corresponding f[i] is available. i is the index starting from 0 and x is the value of array x at that index. Fixed references are represented by x0=x[0], x1=x[1], and so on, and relative references by xp1=x[i-1], xn1=x[i+1], and so on. Out-of-range values are replaced with 0. If n is not provided, it is replaced with the count of values in x.

Expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^) and modulus (%)
  • Numerical operations: sign, abs, ceil, floor, trunc, round, erf, sinc
  • Exponentiation operations: exp, pow, sqrt, logistic, logit
  • Combinatorial operations: fac, ncr, npr
  • Logarithmic operations: exp, ln (natural logarithm), log (base-10 logarithm), log10
  • Trigonometric functions: sin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc
  • Hyperbolic functions: sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
  • Conditional operations: clamp, clean, disc, replace, replaceri, replacerx
  • Constants: pi, e

Example

x = {1,2,3,4};f = {i*x};n = {}{0,2,6,12}
x = {1,2,3,4};f = {x2,x1-x};n = {}{3,0,-1,-2}
x = {1,2,3,4};f = {2*x-xp1-xn1};n = {}{0,0,0,5}
x = {1,2,3,4};f = {2*x-xp1-xn1+i};n = {6}{0,1,2,8,0,5}

Fast Fourier Transform (Magnitude)

Summery

Compute fast Fourier transform (magnitude)

Description

Compute the magnitude part of the fast Fourier transform of x.

Example

x = {0,0.5,1,0.5,0, 0.5,1,0.5,0}{4,0.613341, 2.20574,0.5, 0.0923963,0.0923963, 0.5,2.20574, 0.613341}

Fast Fourier Transform (Phase)

Summery

Compute fast Fourier transform (phase)

Description

Compute the phase part of the fast Fourier transform of x.

Example

x = {0,0.5,1,0.5,0, 0.5,1,0.5,0}{0,-2.79253, -2.44346,1.0472, 1.39626,-1.39626, -1.0472,2.44346, 2.79253}

Fast Fourier Transform (Real)

Summery

Compute fast Fourier transform (real)

Description

Compute the real part of the fast Fourier transform of x.

Example

x = {0,0.5,1,0.5,0, 0.5,1,0.5,0}{4,-0.576352, -1.68969,0.25, 0.0160444,0.0160444, 0.25,-1.68969, -0.576352}

Fast Fourier Transform (Imaginary)

Summery

Compute fast Fourier transform (imaginary)

Description

Compute the imaginary part of the fast Fourier transform of x.

Example

x = {0,0.5,1,0.5,0, 0.5,1,0.5,0}{0,-0.209775, -1.41782,0.433013, 0.0909926,-0.0909926, -0.433013,1.41782, 0.209775}

Normalize (Min-to-Max)

Summery

Min-max normalize

Description

Scale to [0,1] following (x[k]-min(x))/(max(x)-min(x)) for each k.

Example

x = {1,2,3,4,5}{0,0.25,0.5,0.75,1}

Normalize (Mean)

Summery

Mean normalize

Description

Scale to [-1,1] following (x[k]-mean(x))/(max(x)-min(x)) for each k.

Example

x = {1,2,3,4,5}{-0.5,-0.25,0,0.25,0.5}

Normalize (Z-Score)

Summery

Z-score normalize

Description

Compute z-scores as (x[k]-mean(x))/σ(x) for each k. σ is the (population) standard deviation.

Example

x = {1,2,3,4,5}{-1.41421,-0.707107,0,0.707107,1.41421}

Normalize (P-Norm)

Summery

Normalize to unit p-norm

Description

Normalize x to unit p-norm by dividing each x[k] by p-norm of x (p≥1).

Example

x = {0,1,0,1};p = {2}{0,0.707107,0,0.707107}
x = {0,1,0,-1};p = {1}{0,0.5,0,-0.5}

Project onto Hyperplane

Summery

Project onto hyperplane

Description

Project x onto the hyperplane constructed with a as a[0]×x[0]+a[1]×x[1]+...+a[n-1]×x[n-1]=a[n]. Coefficients are replaced with 0 if there are not enough values available in a.

Example

x = {0,0,0};a = {1,1,1,1}{0.333333,0.333333,0.333333}
x = {2,5};a = {1,0}{0,5}

Project onto Line

Summery

Project onto line

Description

Project x onto the line constructed with points a and b.

Example

x = {1,0,0};a = {0,1,0};b = {0,0,1}{0,0.5,0.5}
x = {2,5};a = {0,-1};b = {0,1}{0,5}

Ceiling

Summery

Calculate ceiling

Description

Find the least integer not less than x[k] for each k.

Example

x = {1.2,2.7,-3.1,-4.8,0.5,-0.5}{2,3,-3,-4,1,0}

Floor

Summery

Calculate floor

Description

Find the greatest integer not greater than x[k] for each k.

Example

x = {1.2,2.7,-3.1,-4.8,0.5,-0.5}{1,2,-4,-5,0,-1}

Round

Summery

Round

Description

Find the nearest integer to x[k] for each k with halfway cases rounded away from zero.

Example

x = {1.2,2.7,-3.1,-4.8,0.5,-0.5}{1,3,-3,-5,1,-1}

Truncate

Summery

Truncate

Description

Find the integer part of x[k] for each k.

Example

x = {1.2,2.7,-3.1,-4.8,0.5,-0.5}{1,2,-3,-4,0,0}

Negate

Summery

Negate

Description

Apply - operator to x[k] for each k.

Example

x = {1,1.5,-3,-4}{-1,-1.5,3,4}

Add

Summery

Add

Description

Compute x[k]+a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4};a = {-1}{0,1,2,3}
x = {1,2,3,4};a = {1,2,3}{2,4,6,7}

Subtract

Summery

Subtract

Description

Compute x[k]-a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4};a = {-1}{2,3,4,5}
x = {1,2,3,4};a = {1,2,3}{0,0,0,1}

Subtract (From)

Summery

Subtract from

Description

Compute a[k]-x[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4};a = {-1}{-2,-3,-4,-5}
x = {1,2,3,4};a = {1,2,3}{0,0,0,-1}

Multiply

Summery

Multiply

Description

Compute x[k]×a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4};a = {-1}{-1,-2,-3,-4}
x = {1,2,3,4};a = {1,2,3}{1,4,9,12}

Divide

Summery

Divide

Description

Compute x[k]/a[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4};a = {-1}{-1,-2,-3,-4}
x = {1,2,3,4};a = {1,2,3}{1,1,1,1.33333}

Divide (From)

Summery

Divide from

Description

Compute a[k]/x[k] for each k or the last value in a when not available.

Example

x = {1,2,3,4};a = {-1}{-1,-0.5,-0.333333,-0.25}
x = {1,2,3,4};a = {1,2,3}{1,1,1,0.75}

Absolute Value

Summery

Compute absolute value

Description

Compute the non-negative value of x[k] for each k.

Example

x = {1,-2,0,3,-4}{1,2,0,3,4}

Sign

Summery

Compute sign value

Description

Compute the sign value, that is +1, -1 or 0 when x[k] is respectively positive, negative or 0, for each k.

Example

x = {1,-2,0,3,-4}{1,-1,0,1,-1}

Square

Summery

Compute square

Description

Compute the square of x[k] for each k.

Example

x = {1,4,0.25,-1}{1,16,0.0625,1}

Square Root

Summery

Compute square root

Description

Compute the square root of x[k] for each k.

Example

x = {1,4,0.25,-1}{1,2,0.5,nan}

Power

Summery

Compute power

Description

Compute x[k] to the power of a[k] as c[k]×x[k]a[k] for each k or the last values in a and c when not available.

Example

x = {1,2,3,4};a = {-1};c = {1}{1,0.5,0.3333333,0.25}
x = {1,2,3,4};a = {1,2,3};c = {1,0,2}{1,0,54,128}

Power (to)

Summery

Compute power to

Description

Compute a[k] to the power of x[k] as c[k]×a[k]x[k] for each k or the last values in a and c when not available.

Example

x = {1,2,3,4};a = {-1};c = {1}{-1,1,-1,1}
x = {1,2,3,4};a = {1,2,3};c = {1,0,2}{1,0,54,162}

Exponential

Summery

Compute exponential

Description

Compute e to the power of x[k] as c[k]×ex[k]+a[k] for each k or the last values in a and c when not available.

Example

x = {0,1,2};a = {0};c = {1}{1,2.71828,7.38906}
x = {0,1,2};a = {1,2};c = {0,1}{1,4.71828,9.38906}

Logarithm

Summery

Compute logarithm

Description

Compute the natural logarithm of x[k] as c[k]×log(x[k]+a[k]) for each k or the last values in a and c when not available.

Example

x = {0,1,2};a = {0};c = {1}{-inf,0,0.693147}
x = {0,1,2};a = {1,2};c = {0,1}{0,1.09861,1.38629}

Logistic

Summery

Compute logistic function

Description

Compute the logistic function of x[k] as 1/(1+e-x[k]) for each k.

Example

x = {0,0.1,-1}{0.5,0.524979,0.268941}

Logit

Summery

Compute logit function

Description

Compute the inverse logistic function of x[k] as log(x[k]/(1-x[k])) for each k.

Example

x = {0,0.1,-1}{-inf,-2.19722,nan}

Sine

Summery

Compute sine

Description

Compute the sine of x[k] as c[k]×sin(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{0,0.841471,ε,-1}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{0,-0.909297,ε,ε}
ε's are very small, system-dependent, floating point numbers.

Cosine

Summery

Compute cosine

Description

Compute the cosine of x[k] as c[k]×cos(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{1,0.540302,-1,ε}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{1,0.416147,-1,1}
ε is a very small, system-dependent, floating point number.

Tangent

Summery

Compute tangent

Description

Compute the tangent of x[k] as c[k]×tan(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{0,1.55741,ε,-L}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{0,2.18504,ε,ε}
ε's are very small, system-dependent, floating point numbers.
L is a very large, system-dependent, floating point number.

Cotangent

Summery

Compute cotangent

Description

Compute the cotangent of x[k] as c[k]×cot(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{inf,0.642093,-L,ε}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{inf,0.457658,L,-L}
ε is a very small, system-dependent, floating point number.
L's are very large, system-dependent, floating point numbers.

Secant

Summery

Compute secant

Description

Compute the secant of x[k] as c[k]×sec(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{1,1.85082.0,-1,L}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{1,2.403,-1,1}
L is a very large, system-dependent, floating point number.

Cosecant

Summery

Compute cosecant

Description

Compute the cosecant of x[k] as c[k]×csc(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{inf,1.1884,L,-1}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{inf,-1.09975,L,L}
L's are very large, system-dependent, floating point numbers.

Inverse Sine

Summery

Compute inverse sine

Description

Compute the inverse sine of x[k] as c[k]×sin-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,-1,0.5,2};a = {1};b = {0};c = {1}{0,-1.5708,0.523599,nan}
x = {0,-1,0.5,2};a = {1,2};b = {0};c = {1,-1}{0,nan,-1.5708,nan}

Inverse Cosine

Summery

Compute inverse cosine

Description

Compute the inverse cosine of x[k] as c[k]×cos-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,-1,0.5,2};a = {1};b = {0};c = {1}{1.5708,3.14159,1.0472,nan}
x = {0,-1,0.5,2};a = {1,2};b = {0};c = {1,-1}{1.5708,nan,0,nan}

Inverse Tangent

Summery

Compute inverse tangent

Description

Compute the inverse tangent of x[k] as c[k]×tan-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,-1,0.5,2};a = {1};b = {0};c = {1}{0,-0.785398,0.463648,1.10715}
x = {0,-1,0.5,2};a = {1,2};b = {0};c = {1,-1}{0,1.10715,-0.785398,-1.32582}

Inverse Cotangent

Summery

Compute inverse cotangent

Description

Compute the inverse cotangent of x[k] as c[k]×cot-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,-1,0.5,2};a = {1};b = {0};c = {1}{1.5708,-0.785398,1.10715,0.463648}
x = {0,-1,0.5,2};a = {1,2};b = {0};c = {1,-1}{1.5708,0.463648,-0.785398,-0.244979}

Inverse Secant

Summery

Compute inverse secant

Description

Compute the inverse secant of x[k] as c[k]×sec-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,-1,0.5,2};a = {1};b = {0};c = {1}{nan,3.14159,nan,1.0472}
x = {0,-1,0.5,2};a = {1,2};b = {0};c = {1,-1}{nan,-2.0944,0,-1.31812}

Inverse Cosecant

Summery

Compute inverse cosecant

Description

Compute the inverse cosecant of x[k] as c[k]×csc-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,-1,0.5,2};a = {1};b = {0};c = {1}{nan,-1.5708,nan,0.523599}
x = {0,-1,0.5,2};a = {1,2};b = {0};c = {1,-1}{nan,0.523599,-1.5708,-0.25268}

Sinc

Summery

Compute normalized sinc

Description

Compute the normalized sinc of x[k] as sin(πx[k])/(πx[k]) with sinc(0) = 1.

Example

x = {0,-1,0.5,2}{1,ε,0.63662,ε}
ε's are very small, system-dependent, floating point numbers.

Hyperbolic Sine

Summery

Compute hyperbolic sine

Description

Compute the hyperbolic sine of x[k] as c[k]×sinh(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,ln(2)};a = {1};b = {0};c = {1}{0,1.1752,-1.1752,0.75}

Hyperbolic Cosine

Summery

Compute hyperbolic cosine

Description

Compute the hyperbolic cosine of x[k] as c[k]×cosh(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,ln(2)};a = {1};b = {0};c = {1}{1,1.54308,1.54308,1.25}

Hyperbolic Tangent

Summery

Compute hyperbolic tangent

Description

Compute the hyperbolic tangent of x[k] as c[k]×tanh(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,ln(2)};a = {1};b = {0};c = {1}{0,0.761594,-0.761594,0.6}

Hyperbolic Cotangent

Summery

Compute hyperbolic cotangent

Description

Compute the hyperbolic cotangent of x[k] as c[k]×coth(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,ln(2)};a = {1};b = {0};c = {1}{inf,1.31304,-1.31304,1.66667}

Hyperbolic Secant

Summery

Compute hyperbolic secant

Description

Compute the hyperbolic secant of x[k] as c[k]×sech(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,ln(2)};a = {1};b = {0};c = {1}{1,0.648054,0.648054,0.8}

Hyperbolic Cosecant

Summery

Compute hyperbolic cosecant

Description

Compute the hyperbolic cosecant of x[k] as c[k]×csch(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,ln(2)};a = {1};b = {0};c = {1}{inf,0.850918,-0.850918,1.33333}

Inverse Hyperbolic Sine

Summery

Compute inverse hyperbolic sine

Description

Compute the inverse hyperbolic sine of x[k] as c[k]×sinh-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,0.5,2};a = {1};b = {0};c = {1}{0,0.881374,-0.881374,0.481212,1.44364}

Inverse Hyperbolic Cosine

Summery

Compute inverse hyperbolic cosine

Description

Compute the inverse hyperbolic cosine of x[k] as c[k]×cosh-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,0.5,2};a = {1};b = {0};c = {1}{nan,0,nan,nan,1.31696}

Inverse Hyperbolic Tangent

Summery

Compute inverse hyperbolic tangent

Description

Compute the inverse hyperbolic tangent of x[k] as c[k]×tanh-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,0.5,2};a = {1};b = {0};c = {1}{0,inf,-inf,0.549306,nan}

Inverse Hyperbolic Cotangent

Summery

Compute inverse hyperbolic cotangent

Description

Compute the inverse hyperbolic cotangent of x[k] as c[k]×coth-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,0.5,2};a = {1};b = {0};c = {1}{nan,inf,-inf,nan,0.549306}

Inverse Hyperbolic Secant

Summery

Compute inverse hyperbolic secant

Description

Compute the inverse hyperbolic secant of x[k] as c[k]×sech-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,0.5,2};a = {1};b = {0};c = {1}{inf,0,nan,1.31696,nan}

Inverse Hyperbolic Cosecant

Summery

Compute inverse hyperbolic cosecant

Description

Compute the inverse hyperbolic cosecant of x[k] as c[k]×csch-1(a[k]×x[k]+b[k]) for each k or the last values in a, b, and c when not available.

Example

x = {0,1,-1,0.5,2};a = {1};b = {0};c = {1}{inf,0.881374,-0.881374,1.44364,0.481212}

Difference

Summery

Compute changes in values

Description

Compute changes in values as x[k]-x[k-1] for each k > 0, and 0 for k = 0.

Example

x = {1,2,4,10,10,4}{0,1,2,6,0,-6}

Difference Ratio

Summery

Compute relative changes in values

Description

Compute relative changes in values as (x[k]-x[k-1])/x[k-1] for each k > 0, and 1 for k = 0.

Example

x = {1,2,4,10,10,4}{1,1,1,1.5,0,-0.6}

Polynomial Expression

Summery

Compute polynomial expression

Description

Compute the polynomial expression defined as a[0]+a[1]×x[k]+a[2]×x[k]2+... for each k.

Example

x = {1,2,3,4};a = {2,1}{3,4,5,6}
x = {1,2,3,4};a = {0,1,1}{2,6,12,20}

Trigonometric Expression

Summery

Compute trigonometric expression

Description

Compute the trigonometric expression defined as a[0]+a[1]×sin(a[2]×x[k]+a[3])+a[4]×sin(a[5]×x[k]+a[6])+... for each k.

Example

x = {0,pi/2,pi,2*pi};a = {2,1,1}{2,3,2,2}
x = {0,pi/2,pi,2*pi};a = {0,1,1,pi/2}{1,ε,-1,1}
ε is a very small, system-dependent, floating point number.

Count of Occurrences

Summery

Count occurrences of values

Description

Count the number of values equal to any value in a. The result at index i is the number of values in x, from start up to x[i], or in a window of size w preceding x[i] (inclusive) when w is specified, that are equal to any value in a.

Example

x = {1,0,-1,0,1/0,2};a = {};w = {}{0,0,0,0,0,0}
x = {1,0,-1,0,1/0,2};a = {0};w = {}{0,1,1,2,2,2}
x = {1,0,-1,0,1/0,2};a = {0,2,1};w = {}{1,2,2,3,3,4}
x = {1,0,-1,0,1/0,2};a = {0};w = {3}{0,1,1,2,1,1}

Count of Non-Occurrences

Summery

Count non-occurrences of values

Description

Count the number of values not equal to any value in a. The result at index i is the number of values in x, from start up to x[i], or in a window of size w preceding x[i] (inclusive) when w is specified, that are not equal to any value in a.

Example

x = {1,0,-1,0,1/0,2};a = {};w = {}{1,2,3,4,5,6}
x = {1,0,-1,0,1/0,2};a = {0};w = {}{1,1,2,2,3,4}
x = {1,0,-1,0,1/0,2};a = {0,2,1};w = {}{0,0,1,1,2,2}
x = {1,0,-1,0,1/0,2};a = {0};w = {3}{1,1,2,1,2,2}

Count Inside Ranges

Summery

Count values in ranges

Description

Count the number of values in ranges defined as [from[k], to[k]]. The result at index i is the number of values in x, from start up to x[i], or in a window of size w preceding x[i] (inclusive) when w is specified, that fall in any of ranges [from[k], to[k]].

Example

x = {1,0,-1,0,1/0,2};from = {0};to = {1};w = {}{1,2,2,3,3,3}
x = {1,0,-1,0,1/0,2};from = {0};to = {1};w = {3}{1,2,2,2,1,1}
x = {1,0,-1,0,1/0,2};from = {0,2};to = {1,3};w = {3}{1,2,2,2,1,2}

Count Outside Ranges

Summery

Count values outside ranges

Description

Count the number of values outside ranges defined as [from[k], to[k]]. The result at index i is the number of values in x, from start up to x[i], or in a window of size w preceding x[i] (inclusive) when w is specified, that do not fall in any of ranges [from[k], to[k]].

Example

x = {1,0,-1,0,1/0,2};from = {0};to = {1};w = {}{0,0,1,1,2,3}
x = {1,0,-1,0,1/0,2};from = {0};to = {1};w = {3}{0,0,1,1,2,2}
x = {1,0,-1,0,1/0,2};from = {0,2};to = {1,3};w = {3}{0,0,1,1,2,1}

Count of Finites

Summery

Count finite values

Description

Count the number of finite values. The result at index i is the number of finite values between start and x[i] (inclusive), or in a window of size w preceding x[i] (inclusive) when w is specified. Non-finite values are +/-inf and nan.

Example

x = {1,0,-1,nan,1/0,2};w = {}{1,2,3,3,3,4}
x = {1,0,-1,nan,1/0,2};w = {3}{1,2,3,2,1,1}

Count of Non-Finites

Summery

Count non-finite values

Description

Count the number of non-finite values. The result at index i is the number of non-finite values between start and x[i] (inclusive), or in a window of size w preceding x[i] (inclusive) when w is specified. Non-finite values are +/-inf and nan.

Example

x = {1,0,-1,nan,1/0,2};w = {}{0,0,0,1,2,2}
x = {1,0,-1,nan,1/0,2};w = {3}{0,0,0,1,2,2}

Minimum

Summery

Find minimum value

Description

Find the minimum value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{1,0,-1,-2,-2}
x = {1,3,-2,7,0,4};w = {3}{1,1,-2,-2,-2,0}

Index of Minimum

Summery

Find index of minimum value

Description

Find index of the first value equal to the minimum value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{0,1,2,3,3}
x = {1,3,-2,7,0,4};w = {3}{0,0,2,2,2,4}

Maximum

Summery

Find maximum value

Description

Find the maximum value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{1,1,1,1,3}
x = {1,3,-2,7,0,4};w = {3}{1,3,3,7,7,7}

Index of Maximum

Summery

Find index of maximum value

Description

Find index of the first value equal to the maximum value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{0,0,0,0,4}
x = {1,3,-2,7,0,4};w = {3}{0,1,1,3,3,3}

Minimum Magnitude

Summery

Find minimum magnitude value

Description

Find the minimum magnitude value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{1,0,0,0,0}
x = {1,3,-2,7,0,4};w = {3}{1,1,1,2,0,0}

Index of Minimum Magnitude

Summery

Find index of minimum magnitude value

Description

Find index of the first value with magnitude equal to the minimum magnitude value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{0,1,1,1,1}
x = {1,3,-2,7,0,4};w = {3}{0,0,0,2,4,4}

Maximum Magnitude

Summery

Find maximum magnitude value

Description

Find the maximum magnitude value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{1,1,1,2,3}
x = {1,3,-2,7,0,4};w = {3}{1,3,3,7,7,7}

Index of Maximum Magnitude

Summery

Find index of maximum magnitude value

Description

Find index of the first value with magnitude equal to the maximum magnitude value between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,-1,-2,3};w = {}{0,0,0,3,4}
x = {1,3,-2,7,0,4};w = {3}{0,1,1,3,3,3}

Mean

Summery

Compute arithmetic mean

Description

Compute the arithmetic mean, defined as Sum(x[i])/N, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. N is the count of these values.

Example

x = {1,0,-1,-2,3};w = {}{1,0.5,0,-0.5,0.2}
x = {1,0,-1,-2,3};w = {3}{1,0.5,0,-1,0}

Geometric Mean

Summery

Compute geometric mean

Description

Compute geometric mean, defined as Product(|x[i]|)1/N, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. N is the count of these values.

Example

x = {1,-1,1,-16,-2};w = {}{1,1,1,2,2}
x = {1,-4,0.25,27,0.5,-250};w = {3}{1,2,1,3,1.5,15}

Harmonic Mean

Summery

Compute harmonic mean

Description

Compute harmonic mean, defined as N/Sum(1/x[i]), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. N is the count of these values.

Example

x = {1,-1,1,-16,-2};w = {}{1,inf,3,4.26667,11.4286}
x = {1,-1,1,-16,-2};w = {3}{1,inf,3,-48,6.85714}

Weighted Mean

Summery

Compute weighted mean

Description

Compute weighted mean, defined as (N×x[k]+(N-1)×x[k-1]+...)/(½N×(N+1)), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. N is the count of these values.

Example

x = {1,0,-1,-2,3};w = {}{1,0.333333,-0.333333,-1,0.333333}
x = {1,3,-2,7,0,4};w = {3}{1,2.33333,0.166667,3.33333,2,3.16667}

Custom-Weighted Mean

Summery

Compute custom-weighted mean

Description

Compute custom-weighted mean, defined as (a[0]×x[k]+a[1]×x[k-1]+...)/(a[0]+a[1]+...), for each k.

Example

x = {1,3,-2,7,0,4};a = {2,1,-1}{1,2.33333,-1,4.5,4.5,0.5}

Exponential-Weighted Mean

Summery

Compute exponential mean

Description

Compute exponential mean or exponential moving average, EMA, defined as EMA[k] = αx[k] + (1-α)EMA[k-1], for each k. α is the smoothing factor.

Example

x = {1,3,-2,7,0,4};α = {0.9}{1,2.8,-1.52,6.148,0.6148,3.66148}

Median

Summery

Find median

Description

Find median, defined as the lowest value at or below which half of values, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, fall for each k.

Example

x = {1,0,-1,-2,-3};w = {}{1,0,0,-1,-1}
x = {1,3,-2,7,0,4};w = {3}{1,1,1,3,0,4}

Index of Median

Summery

Find index of median

Description

Find index of median, defined as index of a value equal to the lowest value at or below which half of values, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, fall for each k.

Example

x = {1,0,-1,-2,-3};w = {}{0,1,1,2,2}
x = {1,3,-2,7,0,4};w = {3}{0,0,0,1,4,5}

Mode

Summery

Find mode

Description

Find mode, defined as the most frequent value, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,0,1,2,2,2,2};w = {}{1,1,0,1,1,1,2,2}
x = {1,3,-2,3,-2,-2};w = {3}{1,1,1,3,-2,-2}

Index of Mode

Summery

Find index of mode

Description

Find index of mode, defined as index of the first value equal to the most frequent value, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,0,1,2,2,2,2};w = {}{0,0,1,0,0,0,4,4}
x = {1,3,-2,3,-2,-2};w = {3}{0,0,0,1,2,4}

Range

Summery

Compute range

Description

Compute range, defined as the difference between minimum and maximum of values, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0,1,-2,-3};w = {}{0,1,1,3,4}
x = {1,3,-2,7,0,4};w = {3}{0,2,5,9,9,7}

Root Mean Square

Summery

Compute root mean square

Description

Compute root mean square, defined as √(Sum(x[i]2)/N), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. N is the count of these values.

Example

x = {1,0,1,-2,-3};w = {}{1,0.707107,0.816497,1.22474,1.73205}
x = {1,0,1,-2,-3};w = {3}{1,0.707107,0.816497,1.29099,2.16025}

Moment

Summery

Compute moment

Description

Compute moment, defined as Sum(x[i]p)/N, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. N is the count of these values.

Example

x = {1,-1,1,-2,-3};p = {2};w = {}{1,1,1,1.75,3.2}
x = {1,-1,1,-2,-3};p = {-1};w = {}{1,0,0.333333,0.125,0.0333333}
x = {1,-1,1,-2,-3};p = {2};w = {3}{1,1,1,2,4.66667}
x = {1,-1,1,-2,-3};p = {-1};w = {3}{1,0,0.333333,-0.166667,0.0555556}

Central Moment

Summery

Compute central moment

Description

Compute central moment, defined as Sum((x[i]-μ)p)/N, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and N is the count of these values.

Example

x = {1,-1,1,-2,-3};p = {2};w = {}{0,1,0.888889,1.6875,2.56}
x = {1,-1,1,-2,-3};p = {-1};w = {}{inf,0,0.75,-0.0761905,-1.03535}
x = {1,-1,1,-2,-3};p = {2};w = {3}{0,1,0.888889,1.55556,2.88889}
x = {1,-1,1,-2,-3};p = {-1};w = {3}{inf,0,0.75,-1.05,-0.557143}

Standardized Moment

Summery

Compute standardized moment

Description

Compute standardized moment, defined as Sum((x[i]-μ)p)/(σpN), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average, σ is the population standard deviation, and N is the count of these values.

Example

x = {1,-1,1,-2,-3};p = {2};w = {}{nan,1,1,1,1}
x = {1,-1,1,-2,-3};p = {-1};w = {}{nan,0,0.707107,-0.0989743,-1.65657}
x = {1,-1,1,-2,-3};p = {2};w = {3}{nan,1,1,1,1}
x = {1,-1,1,-2,-3};p = {-1};w = {3}{nan,0,0.707107,-1.30958,-0.946961}

Standard Deviation (Sample)

Summery

Compute sample standard deviation

Description

Compute sample standard deviation, defined as √{Sum((x[i]-μ)2)/(N-1)}, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and N is the count of these values.

Example

x = {1,0,1,-2,-3};w = {}{0,0.707107,0.57735,1.41421,1.81659}
x = {1,0,1,-2,-3};w = {3}{0,0.707107,0.57735,1.52753, 2.08167}

Standard Deviation (Population)

Summery

Compute population standard deviation

Description

Compute population standard deviation, defined as √{Sum((x[i]-μ)2)/N}, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and N is the count of these values.

Example

x = {1,0,1,-2,-3};w = {}{0,0.5,0.471405,1.22474,1.62481}
x = {1,0,1,-2,-3};w = {3}{0,0.5,0.471405,1.24722,1.69967}

Variance (Sample)

Summery

Compute sample variance

Description

Compute sample (unbiased) variance, defined as Sum((x[i]-μ)2)/(N-1), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and N is the count of these values.

Example

x = {1,0,1,-2,-3};w = {}{0,0.5,0.333333,2,3.3}
x = {1,0,1,-2,-3};w = {3}{0,0.5,0.333333,2.33333,4.33333}

Variance (Population)

Summery

Compute population variance

Description

Compute population (biased) variance, defined as Sum((x[i]-μ)2)/N, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and N is the count of these values.

Example

x = {1,0,1,-2,-3};w = {}{0,0.25,0.222222,1.5,2.64}
x = {1,0,1,-2,-3};w = {3}{0,0.25,0.222222,1.55556,2.88889}

Skewness (Sample)

Summery

Compute sample skewness

Description

Compute sample skewness (adjusted Fisher–Pearson standardized moment coefficient), defined as G1[k] = m3/m21.5×{√[N(N-1)]}/(N-2), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average, mp is the p-th central moment, and N is the count of these values.

Example

x = {1,3,3,4,5};w = {}{0,0,-1.73205,-1.12934,-0.551618}
x = {1,0,1,-2,-3};w = {3}{0,0,-1.73205,-0.93522,1.29334}

Skewness (Population)

Summery

Compute population skewness

Description

Compute population skewness, defined as g1[k] = m3/m21.5, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and mp is the p-th central moment of these values.

Example

x = {1,3,3,4,5};w = {}{0,0,-0.707107,-0.652024,-0.370037}
x = {1,0,1,-2,-3};w = {3}{0,0,-0.707107,-0.381802,0.528005}

Kurtosis (Sample)

Summery

Compute sample excess kurtosis

Description

Compute sample excess kurtosis, defined as G2[k] = {(N-1)/[(N-2)(N-3)]}[(N+1)m4/m22-3N+3], between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average, mp is the p-th central moment, and N is the count of these values.

Example

x = {1,3,3,4,5};w = {}{0,0,0,2.22715,0.867769}
x = {1,0,1,-2,-3};w = {4}{0,0,0,1.5,-3.3}

Kurtosis (Population)

Summery

Compute population excess kurtosis

Description

Compute population excess kurtosis, defined as g2[k] = m4/m22-3 for each k, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k. μ is the average and mp is the p-th central moment of these values.

Example

x = {1,3,3,4,5};w = {}{0,-2,-1.5,-0.903047,-0.783058}
x = {1,0,1,-2,-3};w = {4}{0,-2,-1.5,-1,-1.64}

Crest Factor

Summery

Compute crest factor

Description

Compute crest factor, defined as maximum magnitude divided by root mean square of values, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0.5,-1,-2,-3};w = {}{1,1.26491,1.1547,1.6,1.7178}
x = {1,0.5,-1,-2,-3};w = {3}{1,1.26491,1.1547,1.51186,1.38873}

Percentile

Summery

Find k-th percentile

Description

Find k-th percentile, defined as the lowest value at or below which k percentage (k=1.0 for 100%) of values, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, fall for each k.

Example

x = {1,0.5,-1,-2,-3};k = {0.7};w = {}{1,1,1,0.5,0.5}
x = {1,0.5,-1,-2,-3};k = {0.7};w = {4}{1,1,1,0.5,-1}

Index of Percentile

Summery

Find index of k-th percentile

Description

Find index of k-th percentile, defined as index of a value equal to the lowest value at or below which k percentage (k=1.0 for 100%) of values, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, fall for each k.

Example

x = {1,0.5,-1,-2,-3};k = {0.7};w = {}{0,0,0,1,1}
x = {1,0.5,-1,-2,-3};k = {0.7};w = {4}{0,0,0,1,2}

Sum

Summery

Compute sum

Description

Compute sum of values between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0.5,-1,-2,-3};w = {}{1,1.5,0.5,-1.5,-4.5}
x = {1,0.5,-1,-2,-3};w = {3}{1,1.5,0.5,-2.5,-6}

Sum of Powers

Summery

Compute sum of powers

Description

Compute sum of powers of values, defined as Sum(x[i]p), between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0.5,-1,-2,-3};p = {2};w = {}{1,1.25,2.25,6.25,15.25}
x = {1,0.5,-1,-2,-3};p = {2};w = {3}{1,1.25,2.25,5.25,14}

Product

Summery

Compute product

Description

Compute product of values between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0.5,-1,-2,-3};w = {}{1,0.5,-0.5,1,-3}
x = {1,0.5,-1,-2,-3};w = {3}{1,0.5,-0.5,1,-6}

Integral

Summery

Compute integral (trapezoidal rule)

Description

Compute integral with trapezoidal rule of values, defined as {Sum(x[i])-0.5x[first]-0.5x[last]}×dx, between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0.5,-1,-2,-3};dx = {4};w = {}{0,3,2,-4,-14}
x = {1,0.5,-1,-2,-3};dx = {4};w = {3}{0,3,2,-7,-16}

Norm

Summery

Compute p-norm

Description

Compute p-norm of values between start and x[k] (inclusive), or in a window of size w preceding x[k] (inclusive) when w is specified, for each k.

Example

x = {1,0.5,-1,-2,-3};p = {2};w = {}{1,1.11803,1.5,2.5,3.90512}
x = {1,0.5,-1,-2,-3};p = {1};w = {}{1,1.5,2.5,4.5,7.5}
x = {1,0.5,-1,-2,-3};p = {1/0};w = {}{1,1,1,2,3}
x = {1,0.5,-1,-2,-3};p = {2};w = {3}{1,1.11803,1.5,2.29129,3.74166}
x = {1,0.5,-1,-2,-3};p = {1};w = {3}{1,1.5,2.5,3.5,6}

Smooth Large Variations (by Value)

Summery

Smooth spikes by value

Description

Smooth peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from neighboring values is greater than a.

Example

x = {1,2,3,10,3,2,1};a = {5}{1,2,3,3,3,2,1}
x = {1,2,3,10,3,2,1};a = {9}{1,2,3,10,3,2,1}

Smooth Large Variations (by Ratio)

Summery

Smooth spikes by ratio

Description

Smooth peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from neighboring values is greater than a times their value.

Example

x = {1,2,3,10,3,2,1};a = {2}{1,2,3,3,3,2,1}
x = {1,2,3,10,3,2,1};a = {3}{1,2,3,10,3,2,1}

Smooth Large Deviations From Moving Average (by Value)

Summery

Smooth spikes by distance from baseline

Description

Smooth peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from moving average with window size w is greater than a.

Example

x = {1,2,3,10,3,2,1};w = {3};a = {4}{1,2,3,3,3,2,1}
x = {1,2,3,10,3,2,1};w = {3};a = {5}{1,2,3,10,3,2,1}

Smooth Large Deviations From Moving Average (by Ratio)

Summery

Smooth spikes by distance from baseline relative to average

Description

Smooth peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from moving average with window size w is greater than a times the moving average.

Example

x = {1,2,3,10,3,2,1};w = {3};a = {0.5}{1,2,3,3,3,2,1}
x = {1,2,3,10,3,2,1};w = {3};a = {1}{1,2,3,10,3,2,1}

Smooth Large Deviations From Moving Average (by σ-Ratio)

Summery

Smooth spikes by distance from baseline relative to standard deviation

Description

Smooth peaks (values greater than neighboring values) and valleys (values less than neighboring values) where deviation from moving average with window size w is greater than a times the moving population standard deviation.

Example

x = {1,2,3,10,3,2,1};w = {3};a = {0.7}{1,2,3,3,3,2,1}
x = {1,2,3,10,3,2,1};w = {3};a = {1}{1,2,3,10,3,2,1}

Low-Pass Butterworth Filter

Summery

Apply low-pass Butterworth filter

Description

Apply digital second-order low-pass Butterworth filter n times with timestep T and cutoff frequency fc. Every other repeat is applied backwards. Filter warping is applied following SAE J211. Set n=2 to generate CFC filer (SAE J211).

Example

x = {1,1,1,0,0,0};T = {1};fc = {0.1};n = {1}{1,1,1,0.780769,0.273928,-0.0619892}
x = {1,1,1,0,0,0};T = {1};fc = {0.1};n = {2}{1.05312,0.995235,0.710816,0.293026,0.0116545,-0.0619892}

High-Pass Butterworth Filter

Summery

Apply high-pass Butterworth filter

Description

Apply digital second-order high-pass Butterworth filter n times with timestep T and cutoff frequency fc. Every other repeat is applied backwards. Filter warping is applied following SAE J211.

Example

x = {1,1,1,0,0,0};T = {1};fc = {0.1};n = {1}{0,0,0,-0.37518,0.258162,0.151362}
x = {1,1,1,0,0,0};T = {1};fc = {0.1};n = {2}{-0.0546581,-0.000829026,0.288099,-0.265189,0.0400693,0}

First-Order Filter

Summery

Apply general first-order filter

Description

Apply digital first-order filter, H(s)=(b0s+b1)/(a0s+a1), n times. T is the step size and f0 is the warping frequency where digital and analog filters agree. Every other repeat is applied backwards.

Example

x = {1,1,1,0,0,0};T = {1};f0 = {0.1};a0 = {1};a1 = {1};b0 = {0};b1 = {1};n = {1}{1,1,1,0.659141,0.209793,0.0667734}
x = {1,1,1,0,0,0};T = {1};f0 = {0.1};a0 = {1};a1 = {1};b0 = {0};b1 = {1};n = {2}{0.966722,0.895446,0.671506,0.332953,0.115523,0.0667734}

Second-Order Filter

Summery

Apply general second-order filter

Description

Apply digital second-order filter, H(s)=(b0s2+b1s+b2)/(a0s2+a1s+a2), n times. T is the step size and f0 is the warping frequency where digital and analog filters agree. Every other repeat is applied backwards.

Example

x = {1,1,1,0,0,0};T = {1};f0 = {0.1};a0 = {1};a1 = {sqrt(2)};a2 = {1};b0 = {0};b1 = {0};b2 = {1};n = {1}{1,1,1,0.866207,0.500544,0.13459}
x = {1,1,1,0,0,0};T = {1};f0 = {0.1};a0 = {1};a1 = {sqrt(2)};a2 = {1};b0 = {0};b1 = {0};b2 = {1};n = {2}{1.01777,0.896842,0.651823,0.366291,0.183552,0.13459}

Check Equality

Summery

Check equality of values

Description

Generate pass flag, p[k], when values up to the k-th value in x are equal to one another, and fail flag, f[k], otherwise. When a corresponding flag is not available, the last pass or fail flags are considered.

Example

x = {1,1,1,2,3,2,1};p = {0};f = {1}{0,0,0,1,1,1,1}
x = {1,1,0,-1,3,2};p = {-1,-2,-3,-4,-5};f = {1,2,3,4,5}{-1,-2,3,4,5,5}

Check Ascending Order

Summery

Check ascending order of values

Description

Generate pass flag, p[k], when values up to the k-th value in x are in ascending order, and fail flag, f[k], otherwise. When a corresponding flag is not available, the last pass or fail flags are considered.

Example

x = {1,1,1,2,3,2,1};p = {0};f = {1}{0,0,0,0,0,1,1}
x = {1,1,0,-1,3,2};p = {-1,-2,-3,-4,-5};f = {1,2,3,4,5}{-1,-2,3,4,5,5}

Check Descending Order

Summery

Check descending order of values

Description

Generate pass flag, p[k], when values up to the k-th value in x are in descending order, and fail flag, f[k], otherwise. When a corresponding flag is not available, the last pass or fail flags are considered.

Example

x = {1,1,1,2,3,2,1};p = {0};f = {1}{0,0,0,1,1,1,1}
x = {1,1,0,-1,3,2};p = {-1,-2,-3,-4,-5};f = {1,2,3,4,5}{-1,-2,-3,-4,5,5}

SA Optimizer

Summery

Optimize using Simulated Annealing (SA) algorithm

Description

Minimize x[0] using Simulated Annealing algorithm with exponential cooling schedule. x depends on an input with size n. The input array for next iteration is extracted using an Optimizer - Iteration Input plan.
In plan parameters, maxIters is the maximum number of allowed iterations, initT is the Initial temperature, initMoves is the number of initial iterations without changing temperature, moveCtrlSweep is the sweeps per feedback move control, tol is the tolerance to consider system frozen, maxTolSweep is the maximum sweeps below tolerance to consider system frozen, maxMoveCoef is the maximum move size, initMoveCoef is the initial move size, gain is the proportional control in feedback move control, and λ is the exponential cooling speed.

Example

x = {1};n = {4}...
Typical Implementation: array 0 (initial input) & array 1 (input for next iteration) → select array 1 when available → use new input to recalculate x → apply optimizer plan → reproduce input array 1 by partitioning the optimizer array. Repeat the last four steps.

CNE Optimizer

Summery

Optimize using Conventional Neural Evolution (CNE) algorithm

Description

Minimize x[0] using Conventional Neural Evolution algorithm that creates new generations by mutation and crossover. x depends on an input with size n. The input array for next iteration is extracted using an Optimizer - Iteration Input plan.
In plan parameters, popSize is the number of candidates in the population (≥4), maxGens is the maximum number of generations allowed, mutProb is the probability that a weight will get mutated, mutSize is the upper bound of the mutation noise to be added, and selPercent is the percentage of candidates to select to become the next generation. tol is the final value of the objective function for termination. If set to negative value, tolerance is not considered.

Example

x = {1};n = {4}...
Typical Implementation: array 0 (initial input) & array 1 (input for next iteration) → select array 1 when available → use new input to recalculate x → apply optimizer plan → reproduce input array 1 by partitioning the optimizer array. Repeat the last four steps.

DE Optimizer

Summery

Optimize using Differential Evolution (DE) algorithm

Description

Minimize x[0] using Differential Evolution algorithm that creates new generations by mutation and crossover. x depends on an input with size n. The input array for next iteration is extracted using an Optimizer - Iteration Input plan.
In plan parameters, popSize is the number of candidates in the population (≥3), maxGens is the maximum number of generations allowed, crossoverRate is the probability that a candidate will undergo crossover, and diffWeight is the amplification factor for differentiation. tol is the final value of the objective function for termination. If set to negative value, tolerance is not considered.

Example

x = {1};n = {4}...
Typical Implementation: array 0 (initial input) & array 1 (input for next iteration) → select array 1 when available → use new input to recalculate x → apply optimizer plan → reproduce input array 1 by partitioning the optimizer array. Repeat the last four steps.

PS Optimizer

Summery

Optimize using Particle Swarm (PS) algorithm

Description

Minimize x[0] using Particle Swarm algorithm where the particles share fitness information so that they can collectively get close to the global optimum. x depends on an input with size n. The input array for next iteration is extracted using an Optimizer - Iteration Input plan.
In plan parameters, numParticles is the number of particles in the swarm, lBound is the lower bound of the coordinates of the initial population, uBound is the upper bound of the coordinates of the initial population, maxIters is the maximum number of iterations allowed, and horizonSize is the size of the lookback-horizon for computing improvement. tol is the final value of the objective function for termination. If set to negative value, tolerance is not considered. exploit factor controls the influence of the personal best of the particle and explore factor controls the influence of the neighbors of the particle.

Example

x = {1};n = {4}...
Typical Implementation: array 0 (initial input) & array 1 (input for next iteration) → select array 1 when available → use new input to recalculate x → apply optimizer plan → reproduce input array 1 by partitioning the optimizer array. Repeat the last four steps.

SPSA Optimizer

Summery

Optimize using Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm

Description

Minimize x[0] using Simultaneous Perturbation Stochastic Approximation algorithm with gradient approximation. x depends on an input with size n. The input array for next iteration is extracted using an Optimizer - Iteration Input plan.
In plan parameters, α is the scaling exponent for the step size, γ is the scaling exponent for evaluation step size, stepSize is the scaling parameter for step size, evalStepSize is the scaling parameter for evaluation step size, and maxIters is the maximum number of iterations allowed (0 means no limit). tol is the maximum absolute tolerance to terminate algorithm.

Example

x = {1};n = {4}...
Typical Implementation: array 0 (initial input) & array 1 (input for next iteration) → select array 1 when available → use new input to recalculate x → apply optimizer plan → reproduce input array 1 by partitioning the optimizer array. Repeat the last four steps.

Plans to Make Across Arrays


Replace Values (Based on Another Array)

Summery

Conditionally replace values

Description

Replace source values with a[k] when their corresponding reference values are equal to from[k] for each k. When unavailable, the last value in a is considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};from = {1};a = {-1}{-1,5,4,3,2,1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};from = {4,2,3};a = {-1,-2}{6,-2,-2,-1,2,1}

Replace Ranges of Values (Based on Another Array)

Summery

Conditionally replace ranges of values

Description

Replace source values with a[k] when their corresponding reference values are in ranges [from[k], to[k]] for each k. When unavailable, the last value in a is considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};from = {1,3.2};to = {1,10};a = {0}{0,5,4,0,0,0}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};from = {1,3.2};to = {1,10};a = {7,8,9}{7,5,4,8,8,8}

Replace High Values (Based on Another Array)

Summery

Conditionally replace high values

Description

Replace source values with a when their corresponding reference values are greater than or equal to b. For each k, source[k] is replaced with a[k] when reference[k] is greater than or equal to b[k]. When unavailable, the last values in a and b are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {3};a = {0}{6,5,0,0,0,0}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {1,0,3};a = {2,0}{2,0,0,0,0,0}

Replace Low Values (Based on Another Array)

Summery

Conditionally replace low values

Description

Replace source values with a when their corresponding reference values are less than or equal to b. For each k, source[k] is replaced with a[k] when reference[k] is less than or equal to b[k]. When unavailable, the last values in a and b are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {3};a = {0}{0,0,0,3,2,1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {1,0,3};a = {2,0}{2,5,0,3,2,1}

Replace Far Values (Based on Another Array)

Summery

Conditionally replace far values

Description

Replace source values with a when their corresponding reference values have a distance greater than or equal to b from o. For each k, source[k] is replaced with a[k] when the distance of reference[k] to o[k] is greater than or equal to b[k]. When unavailable, the last values in a, b, and o are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {2};o = {3};a = {0}{0,5,4,3,0,0}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {1,0,2};o = {0,0,3};a = {6,7,0}{6,7,4,3,0,0}

Replace Close Values (Based on Another Array)

Summery

Conditionally replace close values

Description

Replace source values with a when their corresponding reference values have a distance less than or equal to b from o. For each k, source[k] is replaced with a[k] when the distance of reference[k] to o[k] is less than or equal to b[k]. When unavailable, the last values in a, b, and o are considered.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {2};o = {3};a = {0}{0,0,0,0,0,1}
source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};b = {1,0,2};o = {0,0,3};a = {6,7,0}{6,5,0,0,0,1}

Replace inf (Based on Another Array)

Summery

Conditionally replace ±inf values

Description

Replace source values when their corresponding reference values are equal to +/-inf with a.

Example

source = {6,5,4,3,2};reference = {1,1/0,2,-2/0};a = {0}{6,0,4,0,2}

Replace nan (Based on Another Array)

Summery

Conditionally replace nan values

Description

Replace source values when their corresponding reference values are equal to nan with a.

Example

source = {6,5,4,3,2};reference = {1,nan,2,nan};a = {0}{6,0,4,0,2}

Replace Undefined (Based on Another Array)

Summery

Conditionally replace non-finite values

Description

Replace source values when their corresponding reference values are equal to +/-inf or nan with a.

Example

source = {6,5,4,3,2};x = {1,1/0,2,-2/0};a = {0}{6,0,4,0,2}

Clean (Based on Another Array)

Summery

Conditionally zero small values

Description

Replace source values when their corresponding reference values have a magnitude less than or equal to a with 0.

Example

source = {6,5,4,3,2};reference = {0.1,0.2,1e-5,-0.4};a = {1e-3}{6,5,0,3,2}

Linear Expression

Summery

Compute linear combination of values at the same index

Description

Compute linear combination of values across arrays as a[0]+a[1]×x0[k]+a[2]×x1[k]+... for each k. The output array is as large as the largest xi and the out-of-range values are replaced with 0.

Example

a = {1,-1,1,-1};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};{-5,-2,8,3}

Simple Expression

Summery

Compute simple expression at the same index

Description

Compute simple expression f(i,x0,x1,...,x20) for each i. The output array is as large as the largest xi and the out-of-range values are replaced with 0.

Expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^) and modulus (%)
  • Numerical operations: sign, abs, ceil, floor, trunc, round, erf, sinc
  • Exponentiation operations: exp, pow, sqrt, logistic, logit
  • Combinatorial operations: fac, ncr, npr
  • Logarithmic operations: exp, ln (natural logarithm), log (base-10 logarithm), log10
  • Trigonometric functions: sin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc
  • Hyperbolic functions: sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
  • Conditional operations: clamp, clean, disc, replace, replaceri, replacerx
  • Constants: pi, e

Example

f = {1+i+x0-2*x1+x2*(x3^2)};x0 = {1,-1,1,-1};x1 = {1,2,3};x2 = {-1,-2,-3};x3 = {0,2,0};{0,-11,-2,3}

Advanced Expression

Summery

Compute general-form expression at the same index

Description

Compute general-form expression f = {f[0],f[1],...} where f[i] is a function of i,x,y,z,u,v,w,x0,xp1,xn1,yp1,yn1,... . The output array is computed as f[i] for each i or the last function in f when no corresponding f[i] is available. i is the index starting from 0 and x,y,z,u,v,w are the values of arrays x,y,z,u,v,w at the same index across arrays. Fixed references are represented by x0=x[0], x1=x[1], and so on, and relative references by xp1=x[i-1], xn1=x[i+1], and so on. The output array is as large as the largest xi and the out-of-range values are replaced with 0.

Expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^) and modulus (%)
  • Numerical operations: sign, abs, ceil, floor, trunc, round, erf, sinc
  • Exponentiation operations: exp, pow, sqrt, logistic, logit
  • Combinatorial operations: fac, ncr, npr
  • Logarithmic operations: exp, ln (natural logarithm), log (base-10 logarithm), log10
  • Trigonometric functions: sin, cos, tan, cot, sec, csc, asin, acos, atan, atan2, acot, asec, acsc
  • Hyperbolic functions: sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
  • Conditional operations: clamp, clean, disc, replace, replaceri, replacerx
  • Constants: pi, e

Example

f = {i+x-y};x = {1,2,3,4};y = {1,-1,1}{0,4,4,7}
f = {x2+y2,x1-x-y1};x = {1,2,3,4};y = {1,-1,1}{4,1,0,-1}
f = {2*x-xp1-xn1+yp1*yn1};x = {1,2,3,4};y = {1,-1,1}{0,1,0,5}

Cross Product

Summery

Compute cross product of two arrays

Description

Compute vector cross product of arrays x and y as {x[1]×y[2]-x[2]×y[1],x[2]×y[0]-x[0]×y[2],x[0]×y[1]-x[1]×y[0]}.

Example

x = {1,0,-1};y = {0,0,-1}{0,1,0}

Convolution (Full)

Summery

Compute full convolution of two arrays

Description

Compute full convolution of arrays x and y as x[k]×y[0]+x[k-1]×y[1]+x[k-2]×y[2]+... for 0 ≤ k < Nx+Ny-1. Nx and Ny are the sizes of the arrays x and y.

Example

x = {1,2,-1,-2};y = {1,2,0,-3}{1,4,3,-7,-10,3,6}
x = {1,2,-1,-2};y = {1,0,-1}{1,2,-2,-4,1,2}

Convolution (Central)

Summery

Compute central convolution of two arrays

Description

Compute central part of convolution of arrays x and y as x[k]×y[0]+x[k-1]×y[1]+x[k-2]×y[2]+... for Ny/2 ≤ k < Nx+Ny/2. Nx and Ny are the sizes of the arrays x and y.

Example

x = {1,2,-1,-2};y = {1,2,0,-3}{3,-7,-10,3}
x = {1,2,-1,-2};y = {1,0,-1}{2,-2,-4,1}

Interpolate to Nearest

Summery

Interpolate to nearest neighbor

Description

Interpolate values in x to their nearest neighbor. Each x[k] is mapped onto a y0 value that corresponds to the nearest x0 value. Out-of-range values are mapped to nan.

Example

x = {1,-1.4,3};x0 = {1,2,-1,-2};y0 = {1,2,0,-3}{1,0,nan}

Interpolate Linearly

Summery

Interpolate linearly between nearest neighbors

Description

Interpolate values in x linearly between their nearest neighbors. Each x[k] is mapped onto a line between two nearest x0 values as x-coordinates and their corresponding y0 values as y-coordinates. Out-of-range values are mapped to nan.

Example

x = {1,-1.4,3};x0 = {1,2,-1,-2};y0 = {1,2,0,-3}{1,-1.2,nan}

Count of Occurrences Across

Summery

Count occurrences of values at the same index

Description

Count the number of values equal to any value in a across arrays. The result at index i is the number of i-th values in arrays xk that are equal to any value in a.

Example

a = {};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{0,0,0,0}
a = {0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{1,3,0,0}
a = {0,1/0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{2,3,0,0}

Count of Non-Occurrences Across

Summery

Count non-occurrences of values at the same index

Description

Count the number of values not equal to any value in a across arrays. The result at index i is the number of i-th values in arrays xk that are not equal to any value in a.

Example

a = {};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{3,3,3,1}
a = {0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{2,0,3,1}
a = {0,1/0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{1,0,3,1}

Count Inside Ranges Across

Summery

Count values in ranges at the same index

Description

Count the number of values in ranges defined as [from[k], to[k]] across arrays. The result at index i is the number of i-th values in arrays xk that fall in any of ranges [from[k], to[k]].

Example

from = {0};to = {1};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{2,3,0,0}
from = {0,2};to = {1,3};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{2,3,0,1}

Count Outside Ranges Across

Summery

Count values outside ranges at the same index

Description

Count the number of values outside ranges defined as [from[k], to[k]] across arrays. The result at index i is the number of i-th values in arrays xk that do not fall in any of ranges [from[k], to[k]].

Example

from = {0};to = {1};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{1,0,3,1}
from = {0,2};to = {1,3};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{1,0,3,0}

Count of Finites Across

Summery

Count finite values at the same index

Description

Count the number of finite values across arrays. The result at index i is the number of i-th values in arrays xk that are finite. Non-finite values are +/-inf and nan.

Example

x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{2,3,2,1}

Count of Non-Finites Across

Summery

Count non-finite values at the same index

Description

Count the number of non-finite values across arrays. The result at index i is the number of i-th values in arrays xk that are not finite. Non-finite values are +/-inf and nan.

Example

x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{1,0,1,0}

Correlation Coefficient

Summery

Compute correlation coefficient

Description

Compute Pearson product-moment correlation coefficient between arrays x and y, defined as Sum((x[i]-μx)(y[i]-μy))/√{Sum((x[i]-μx)2)Sum((y[i]-μy)2)}, between start and k-th values (inclusive), or in a window of size w preceding the k-th values (inclusive) when w is specified, for each k. μx and μy are the averages of these values in x and y. When the sizes of x and y are different, the extra values are ignored.

Example

x = {1,2,-1,-2};y = {1,2,0,-3};w = {}{0,1,0.981981,0.92967}
x = {1,2,-1,-2};y = {1,2,0,-3};w = {3}{0,1,0.981981,0.922613}

Minimum Across

Summery

Find minimum value at the same index

Description

Find the minimum value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{0,0,-7,-2}

Array Index of Minimum Across

Summery

Find array index of minimum value at the same index

Description

Find array index of the first value equal to the minimum value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{1,0,2,2}

Maximum Across

Summery

Find maximum value at the same index

Description

Find the maximum value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{5,3,-1,-2}

Array Index of Maximum Across

Summery

Find array index of maximum value at the same index

Description

Find array index of the first value equal to the maximum value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{2,2,0,2}

Minimum Magnitude Across

Summery

Find minimum magnitude value at the same index

Description

Find the minimum magnitude value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{0,0,1,2}

Array Index of Minimum Magnitude Across

Summery

Find array index of minimum magnitude value at the same index

Description

Find array index of the first value with magnitude equal to the minimum magnitude value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{1,0,0,2}

Maximum Magnitude Across

Summery

Find maximum magnitude value at the same index

Description

Find the maximum magnitude value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{5,3,7,2}

Array Index of Maximum Magnitude Across

Summery

Find array index of maximum magnitude value at the same index

Description

Find array index of the first value with magnitude equal to the maximum magnitude value at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{2,2,2,2}

Mean Across

Summery

Compute arithmetic mean at the same index

Description

Compute arithmetic mean across arrays as Sum(xi[k])/Nk for each k. Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{2,2.25,-2.5,-2}

Geometric Mean Across

Summery

Compute geometric mean at the same index

Description

Compute geometric mean across arrays as Product(|xi[k]|)1/Nk for each k. Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{0,0,1.62658,2}

Harmonic Mean Across

Summery

Compute harmonic mean at the same index

Description

Compute harmonic mean across arrays as Nk/Sum(1/xi[k]) for each k. Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{nan,nan,-1.27273,-2}

Weighted Mean Across

Summery

Compute weighted mean at the same index

Description

Compute weighted mean across arrays as (Nk×xNk-1[k]+(Nk-1)×xNk-2[k]+...)/(½Nk×(Nk+1)) for each k. Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{2.4,3.3,-2.8,-2}

Custom-Weighted Mean Across

Summery

Compute custom-weighted mean at the same index

Description

Compute custom-weighted mean across arrays as (a[0]×xNk-1[k]+a[1]×xNk-2[k]+...)/(a[0]+a[1]+...) for each k. Nk is the number of available values at the same index, k, across arrays.

Example

a = {2,1,-1};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{4.5,7.5,-4,-2}

Exponential-Weighted Mean Across

Summery

Compute exponential mean at the same index

Description

Compute exponential mean or the last value in the exponential moving average across arrays, EMA[k,Nk-1], defined as EMA[k,i] = αxi[k] + (1-α)EMA[k,i-1], for each k. α is the smoothing factor and Nk is the number of available values at the same index, k, across arrays.

Example

α = {0.9};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{2.251,5.67,-1.54,-2}

Median Across

Summery

Find median at the same index

Description

Find median across arrays defined as the lowest value at or below which half of available values at each index fall.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1,0,-1,-2}

Array Index of Median Across

Summery

Find array index of median at the same index

Description

Find array index of median across arrays defined as array index of a value equal to the lowest value at or below which half of available values at each index fall.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{0,1,0,2}

Mode Across

Summery

Find mode at the same index

Description

Find mode across arrays defined as the most frequent value at each index.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1,0,-1,-2}

Array Index of Mode Across

Summery

Find array index of mode at the same index

Description

Find array index of mode across arrays defined as array index of the first value equal to the most frequent value at each index.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{0,0,0,2}

Range Across

Summery

Compute range at the same index

Description

Compute range across arrays defined as the difference between minimum and maximum of available values at each index.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{5,6,6,0}

Root Mean Square Across

Summery

Compute root mean square at the same index

Description

Compute root mean square across arrays defined as √{Sum(xi[k]2)/Nk} for each k. Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{2.73861,3.3541,3.60555,2}

Moment Across

Summery

Compute moment at the same index

Description

Compute moment across arrays defined as Sum(xi[k]p)/Nk for each k. Nk is the number of available values at the same index, k, across arrays.

Example

p = {2};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{7.5,11.25,13,4}

Central Moment Across

Summery

Compute central moment at the same index

Description

Compute central moment across arrays defined as mp = Sum((xi[k]-μk)p)/Nk for each k. μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

p = {2};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{3.5,6.1875,6.75,0}

Standardized Moment Across

Summery

Compute standardized moment at the same index

Description

Compute standardized moment across arrays defined as Sum((xi[k]-μk)p)/(σkpNk) for each k. μk is the average, σk is the population standard deviation, and Nk is the number of available values at the same index, k, across arrays.

Example

p = {-1};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{inf,0.442217,1.1547,nan}

Standard Deviation Across (Sample)

Summery

Compute sample standard deviation at the same index

Description

Compute sample standard deviation across arrays defined as √{Sum((xi[k]-μk)2)/(Nk-1)} for each k. μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{2.16025,2.87228,3,0}

Standard Deviation Across (Population)

Summery

Compute population standard deviation at the same index

Description

Compute population standard deviation across arrays defined as √{Sum((xi[k]-μk)2)/Nk} for each k. μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1.87083,2.48747,2.59808,0}

Variance Across (Sample)

Summery

Compute sample variance at the same index

Description

Compute sample (unbiased) variance across arrays defined as Sum((xi[k]-μk)2)/(Nk-1) for each k. μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{4.66667,8.25,9,0}

Variance Across (Population)

Summery

Compute population variance at the same index

Description

Compute population (biased) variance across arrays defined as Sum((xi[k]-μk)2)/Nk for each k. μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{3.5,6.1875,6.75,0}

Skewness Across (Sample)

Summery

Compute sample skewness at the same index

Description

Compute sample skewness (adjusted Fisher–Pearson standardized moment coefficient) across arrays defined as G1 = m3/m21.5×{√[Nk(Nk-1)]}/(Nk-2) for each k. mp is the p-th central moment defined as mp = Sum((xi[k]-μk)p)/Nk, μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1.19034,0.854563,-2,0}

Skewness Across (Population)

Summery

Compute population skewness at the same index

Description

Compute population skewness across arrays defined as g1 = m3/m21.5 for each k. mp is the p-th central moment defined as mp = Sum((xi[k]-μk)p)/Nk, μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{0.687243,0.493382,-1.1547,nan}

Kurtosis Across (Sample)

Summery

Compute sample excess kurtosis at the same index

Description

Compute sample excess kurtosis across arrays defined as G2 = {(Nk-1)/[(Nk-2)(Nk-3)]}[(Nk+1)m4/m22-3(Nk-1)] for each k. mp is the p-th central moment defined as mp = Sum((xi[k]-μk)p)/Nk, μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1.5,-1.28926,4,0}

Kurtosis Across (Population)

Summery

Compute population excess kurtosis at the same index

Description

Compute population excess kurtosis across arrays defined as g2 = m4/m22-3 for each k. mp is the p-th central moment defined as mp = Sum((xi[k]-μk)p)/Nk, μk is the average and Nk is the number of available values at the same index, k, across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{-1,-1.3719,-0.666667,nan}

Crest Factor Across

Summery

Compute crest factor at the same index

Description

Compute crest factor across arrays defined as maximum magnitude divided by root mean square of available values at each index.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1.82574,1.78885,1.94145,1}

Percentile Across

Summery

Find k-th percentile at the same index

Description

Find k-th percentile across arrays defined as the lowest value at or below which k percentage (k=1.0 for 100%) of available values at each index fall.

Example

k = {0.7};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{2,3,-1,-2}

Array Index of Percentile Across

Summery

Find array index of k-th percentile at the same index

Description

Find array index of k-th percentile across arrays defined as array index of a value equal to the lowest value at or below which k percentage (k=1.0 for 100%) of available values at each index fall.

Example

k = {0.7};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{3,2,1,2}

Sum Across

Summery

Compute sum at the same index

Description

Compute sum of available values at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{8,9,-10,-2}

Sum of Powers Across

Summery

Compute sum of powers at the same index

Description

Compute sum of powers of available values at each index across arrays defined as Sum(xi[k]p).

Example

p = {2};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{30,45,52,4}

Product Across

Summery

Compute product at the same index

Description

Compute product (multiplication) of available values at each index across arrays.

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{0,0,7,-2}

Integral Across

Summery

Compute integral (trapezoidal rule) at the same index

Description

Compute integral with trapezoidal rule across arrays defined as {Sum(xi[k])-0.5x0[k]-0.5xNk-1[k]}×dx for each k. Nk is the number of available values at the same index, k, across arrays.

Example

dx = {4};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{26,24,-36,0}

Norm Across

Summery

Compute p-norm at the same index

Description

Compute p-norm of available values at each index across arrays.

Example

p = {2};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{5.47723,6.7082,7.2111,2}
p = {1};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{8,9,10,2}

Check Equality

Summery

Check equality of values at the same index

Description

Generate pass flag, p[k], when xi values at index k are equal to one another, and fail flag, f[k], otherwise. When a corresponding flag is not available, the last pass or fail flag is considered.

Example

p = {0};f = {1};x0 = {1,2,-1,-2};x1 = {1,2,0,-3};x2 = {3,2,1,-5}{1,0,1,1}

Check Ascending Order

Summery

Check ascending order of values at the same index

Description

Generate pass flag, p[k], when xi values at index k are in ascending order, and fail flag, f[k], otherwise. When a corresponding flag is not available, the last pass or fail flag is considered.

Example

p = {0};f = {1};x0 = {1,2,-1,-2};x1 = {1,2,0,-3};x2 = {3,2,1,-5}{0,0,0,1}

Check Descending Order

Summery

Check descending order of values at the same index

Description

Generate pass flag, p[k], when xi values at index k are in descending order, and fail flag, f[k], otherwise. When a corresponding flag is not available, the last pass or fail flag is considered.

Example

p = {0};f = {1};x0 = {1,2,-1,-2};x1 = {1,2,0,-3};x2 = {3,2,1,-5}{1,0,1,0}

Linear Regression - No Offset - LBFGS

Summery

Compute coefficients for linear regression without 0-offset using L-BFGS optimization algorithm

Description

Find the linear regression coefficients a so that a[0]xk[0]+a[1]xk[1]+...+a[n-1]xk[n-1]-yk[0] is norm-minimized using limited-memory Broyden-Fletcher-Goldfarb-Shanno (BFGS) optimization algorithm. xk and yk pairs are entered as xy2k and xy2k+1 for each k.
In this algorithm, numBasis is the number of stored memory points. maxIters is the maximum number of iterations and maxIters=0 indicates no limit. armijo controls the accuracy of the line search routine to determine the Armijo condition. wolfe is a parameter for detecting the Wolfe condition. minGradNorm is the minimum required gradient norm and factr is the minimum relative function value decrease to continue the optimization. maxLineTrials is the maximum number of trials for the line search. minStep and maxStep limit step size in the line search.

Example

numBasis = {10};maxIters = {100000};armijo = {1e-4};wolfe = {0.9};minGradNorm = {1e-6};factr = {1e-15};maxLineTrials = {50};minStep = {1e-20};maxStep = {1e20};
xy0 = {1,1};xy1 = {2};xy2 = {0,0};xy3 = {0};xy4 = {1,-1};xy5 = {0};{1,1}
Note: Depending on the randomized initial value, the outcome may be slightly different.

Linear Regression - LBFGS

Summery

Compute coefficients for linear regression with 0-offset using L-BFGS optimization algorithm

Description

Find the linear regression coefficients a so that a[0]xk[0]+a[1]xk[1]+...+a[n-1]xk[n-1]+a[n]-yk[0] is norm-minimized using limited-memory Broyden-Fletcher-Goldfarb-Shanno (BFGS) optimization algorithm. xk and yk pairs are entered as xy2k and xy2k+1 for each k.
In this algorithm, numBasis is the number of stored memory points. maxIters is the maximum number of iterations and maxIters=0 indicates no limit. armijo controls the accuracy of the line search routine to determine the Armijo condition. wolfe is a parameter for detecting the Wolfe condition. minGradNorm is the minimum required gradient norm and factr is the minimum relative function value decrease to continue the optimization. maxLineTrials is the maximum number of trials for the line search. minStep and maxStep limit step size in the line search.

Example

numBasis = {10};maxIters = {100000};armijo = {1e-4};wolfe = {0.9};minGradNorm = {1e-6};factr = {1e-15};maxLineTrials = {50};minStep = {1e-20};maxStep = {1e20};
xy0 = {1,1};xy1 = {2};xy2 = {0,0};xy3 = {0};xy4 = {1,-1};xy5 = {0};{1,1,0}
Note: Depending on the randomized initial value, the outcome may be slightly different.

Linear Regression - No Offset - Gradient Descent

Summery

Compute coefficients for linear regression without 0-offset using gradient descent optimization algorithm

Description

Find the linear regression coefficients a so that a[0]xk[0]+a[1]xk[1]+...+a[n-1]xk[n-1]-yk[0] is norm-minimized using gradient descent optimization algorithm. xk and yk pairs are entered as xy2k and xy2k+1 for each k.
In this algorithm, stepSize is the step size in each iteration. maxIters is the maximum number of iterations and maxIters=0 indicates no limit. tol is the maximum absolute tolerance to terminate the algorithm.

Example

stepSize = {0.01};maxIters = {100000};tol = {1e-5};
xy0 = {1,1};xy1 = {2};xy2 = {0,0};xy3 = {0};xy4 = {1,-1};xy5 = {0};{1,1}
Note: Depending on the randomized initial value, the outcome may be slightly different.

Linear Regression - Gradient Descent

Summery

Compute coefficients for linear regression with 0-offset using gradient descent optimization algorithm

Description

Find the linear regression coefficients a so that a[0]xk[0]+a[1]xk[1]+...+a[n-1]xk[n-1]+a[n]-yk[0] is norm-minimized using gradient descent optimization algorithm. xk and yk pairs are entered as xy2k and xy2k+1 for each k.
In this algorithm, stepSize is the step size in each iteration. maxIters is the maximum number of iterations and maxIters=0 indicates no limit. tol is the maximum absolute tolerance to terminate the algorithm.

Example

stepSize = {0.01};maxIters = {100000};tol = {1e-5};
xy0 = {1,1};xy1 = {2};xy2 = {0,0};xy3 = {0};xy4 = {1,-1};xy5 = {0};{1,1,0}
Note: Depending on the randomized initial value, the outcome may be slightly different.

Plans to Derive From an Array


Count of Occurrences

Summery

Count occurrences of values in array

Description

Count the number of values equal to any value in a. The result is the number of values in x that are equal to any value in a.

Example

x = {1,0,-1,0,1/0,2};a = {}{0}
x = {1,0,-1,0,1/0,2};a = {0}{2}
x = {1,0,-1,0,1/0,2};a = {0,2,1}{4}

Count of Non-Occurrences

Summery

Count non-occurrences of values in array

Description

Count the number of values not equal to any value in a. The result is the number of values in x that are not equal to any value in a.

Example

x = {1,0,-1,0,1/0,2};a = {}{6}
x = {1,0,-1,0,1/0,2};a = {0}{4}
x = {1,0,-1,0,1/0,2};a = {0,2,1}{2}

Count Inside Ranges

Summery

Count values in ranges in array

Description

Count the number of values in ranges defined as [from[k], to[k]]. The result is the number of values in x that fall in any of ranges [from[k], to[k]].

Example

x = {1,0,-1,0,1/0,2};from = {0};to = {1}{3}
x = {1,0,-1,0,1/0,2};from = {0,2};to = {1,3}{4}

Count Outside Ranges

Summery

Count values outside ranges in array

Description

Count the number of values outside ranges defined as [from[k], to[k]]. The result is the number of values in x that do not fall in any of ranges [from[k], to[k]].

Example

x = {1,0,-1,0,1/0,2};from = {0};to = {1}{3}
x = {1,0,-1,0,1/0,2};from = {0,2};to = {1,3}{2}

Count of Finites

Summery

Count finite values in array

Description

Count the number of finite values. The result is the number of finite values in x. Non-finite values are +/-inf and nan.

Example

x = {1,0,-1,0,1/0,2}{5}

Count of Non-Finites

Summery

Count non-finite values in array

Description

Count the number of non-finite values. The result is the number of non-finite values in x. Non-finite values are +/-inf and nan.

Example

x = {1,0,-1,0,1/0,2}{1}

Binning by Occurrence (Histogram)

Summery

Count occurrences in bins to prepare a histogram

Description

Count the number of values that belong to bins listed in a. The result at index i is the number of values that fall in range [a[i]-δn[i],a[i]+δp[i]]. When unavailable, the last values in δn and δp are considered.

Example

x = {1.2,-2.6,3.3,0.7,-2.1};a = {-3,-2,-1,0,1,2,3};δn = {0.5};δp = {0.5}{1,1,0,0,2,0,1}
x = {1.2,-2.6,3.3,0.7,-2.1};a = {-2,-1,0,1,2};δn = {0.5};δp = {0.5}{1,0,0,2,0}
x = {1.2,-2.6,3.3,0.7,-2.1};a = {-2,-1,0,1,2};δn = {10,0.5,0.5,0.5,0.5};δp = {0.5,0.5,0.5,0.5,10}{2,0,0,2,1}

Binning by Positive Crossing

Summery

Count positive level crossings

Description

Count positive level crossings with levels listed in a. The result at index i is the number of indices k where x[k]≤a[i] and x[k+1]>a[i].

Example

x = {0.9,0,-1.1,0,1.1};a = {-1,0,1}{1,1,1}

Binning by Negative Crossing

Summery

Count negative level crossings

Description

Count negative level crossings with levels listed in a. The result at index i is the number of indices k where x[k]≥a[i] and x[k+1]<a[i].

Example

x = {0.9,0,-1.1,0,1.1};a = {-1,0,1}{1,1,0}

Minimum

Summery

Find minimum value in array

Description

Find the minimum value in array x.

Example

x = {1,0,-1,-2,3}{-2}

Index of Minimum

Summery

Find index of minimum value in array

Description

Find index of the first value equal to the minimum value in array x.

Example

x = {1,0,-1,-2,3}{3}

Maximum

Summery

Find maximum value in array

Description

Find the maximum value in array x.

Example

x = {1,0,-1,-2,3}{3}

Index of Maximum

Summery

Find index of maximum value in array

Description

Find index of the first value equal to the maximum value in array x.

Example

x = {1,0,-1,-2,3}{4}

Minimum Magnitude

Summery

Find minimum magnitude value in array

Description

Find the minimum magnitude value in array x.

Example

x = {1,0,-1,-2,3}0}

Index of Minimum Magnitude

Summery

Find index of minimum magnitude value in array

Description

Find index of the first value with magnitude equal to the minimum magnitude value in array x.

Example

x = {1,0,-1,-2,3}{1}

Maximum Magnitude

Summery

Find maximum magnitude value in array

Description

Find the maximum magnitude value in array x.

Example

x = {1,0,-1,-2,3}{3}

Index of Maximum Magnitude

Summery

Find index of maximum magnitude value in array

Description

Find index of the first value with magnitude equal to the maximum magnitude value in array x.

Example

x = {1,0,-1,-2,3}{4}

Mean

Summery

Compute arithmetic mean in array

Description

Compute the arithmetic mean, defined as Sum(x[i])/N, for array x. N is the size of the array.

Example

x = {1,0,-1,-2,3}{0.2}

Geometric Mean

Summery

Compute geometric mean in array

Description

Compute geometric mean, defined as Product(|x[i]|)1/N, for array x. N is the size of the array.

Example

x = {1,-1,1,-16,-2}{2}

Harmonic Mean

Summery

Compute harmonic mean in array

Description

Compute harmonic mean, defined as N/Sum(1/x[i]), for array x. N is the size of the array.

Example

x = {1,-1,1,-16,-2}{11.4286}

Weighted Mean

Summery

Compute weighted mean in array

Description

Compute weighted mean, defined as (x[0]+2×x[1]+...)/(½N×(N+1)), for array x. N is the size of the array.

Example

x = {1,0,-1,-2,3}{0.333333}

Custom-Weighted Mean

Summery

Compute custom-weighted mean in array

Description

Compute custom-weighted mean, defined as (a[0]×x[N-1]+a[1]×x[N-2]+...)/(a[0]+a[1]+...), for array x. N is the size of the array.

Example

x = {1,3,-2,7,0,4};a = {2,1,-1}{0.5}

Exponential-Weighted Mean

Summery

Compute exponential mean in array

Description

Compute exponential mean or the last value in the exponential moving average, EMA[N-1], defined as EMA[k] = αx[k] + (1-α)EMA[k-1], for array x. N is the size of the array and α is the smoothing factor.

Example

x = {1,3,-2,7,0,4};α = {0.9}{3.66148}

Median

Summery

Find median in array

Description

Find median defined as the lowest value at or below which half of values in array x fall.

Example

x = {1,0,-1,-2,-3}{-1}

Index of Median

Summery

Find index of median in array

Description

Find index of median defined as index of a value equal to the lowest value at or below which half of values in array x fall.

Example

x = {1,0,-1,-2,-3}{2}

Mode

Summery

Find mode in array

Description

Find mode defined as the most frequent value in array x.

Example

x = {1,0,0,1,2,2,2,2}{2}

Index of Mode

Summery

Find index of mode in array

Description

Find index of mode defined as index of the first value equal to the most frequent value in array x.

Example

x = {1,0,0,1,2,2,2,2}{4}

Range

Summery

Compute range in array

Description

Compute range, defined as the difference between minimum and maximum of values, for array x.

Example

x = {1,0,1,-2,-3}{4}

Root Mean Square

Summery

Compute root mean square in array

Description

Compute root mean square, defined as √(Sum(x[i]2)/N), for array x. N is the size of the array.

Example

x = {1,0,1,-2,-3}{1.73205}

Moment

Summery

Compute moment in array

Description

Compute moment, defined as Sum(x[i]p)/N, for array x. N is the size of the array.

Example

x = {1,-1,1,-2,-3};p = {2}{3.2}
x = {1,-1,1,-2,-3};p = {-1}{0.0333333}

Central Moment

Summery

Compute central moment in array

Description

Compute central moment, defined as Sum((x[i]-μ)p)/N, for array x. μ is the average and N is the size of the array.

Example

x = {1,-1,1,-2,-3};p = {2}{2.56}
x = {1,-1,1,-2,-3};p = {-1}{-1.03535}

Standardized Moment

Summery

Compute standardized moment in array

Description

Compute standardized moment, defined as Sum((x[i]-μ)p)/(σpN), for array x. μ is the average, σ is the population standard deviation, and N is the size of the array.

Example

x = {1,-1,1,-2,-3};p = {2}{1}
x = {1,-1,1,-2,-3};p = {-1}{-1.65657}

Standard Deviation (Sample)

Summery

Compute sample standard deviation in array

Description

Compute sample standard deviation, defined as √{Sum((x[i]-μ)2)/(N-1)}, for array x. μ is the average and N is the size of the array.

Example

x = {1,0,1,-2,-3}{1.81659}

Standard Deviation (Population)

Summery

Compute population standard deviation in array

Description

Compute population standard deviation, defined as √{Sum((x[i]-μ)2)/N}, for array x. μ is the average and N is the size of the array.

Example

x = {1,0,1,-2,-3}{1.62481}

Variance (Sample)

Summery

Compute sample variance in array

Description

Compute sample (unbiased) variance, defined as Sum((x[i]-μ)2)/(N-1), for array x. μ is the average and N is the size of the array.

Example

x = {1,0,1,-2,-3}{3.3}

Variance (Population)

Summery

Compute population variance in array

Description

Compute population (biased) variance, defined as Sum((x[i]-μ)2)/N, for array x. μ is the average and N is the size of the array.

Example

x = {1,0,1,-2,-3}{2.64}

Skewness (Sample)

Summery

Compute sample skewness in array

Description

Compute sample skewness (adjusted Fisher–Pearson standardized moment coefficient), defined as G1 = m3/m21.5×{√[N(N-1)]}/(N-2), for array x. μ is the average, mp is the p-th central moment, and N is the size of the array.

Example

x = {1,3,3,4,5}{-0.551618}

Skewness (Population)

Summery

Compute population skewness in array

Description

Compute population skewness, defined as g1 = m3/m21.5, for array x. μ is the average, mp is the p-th central moment, and N is the size of the array.

Example

x = {1,3,3,4,5}{-0.370037}

Kurtosis (Sample)

Summery

Compute sample excess kurtosis in array

Description

Compute sample excess kurtosis, defined as G2 = {(N-1)/[(N-2)(N-3)]}[(N+1)m4/m22-3N+3], for array x. μ is the average, mp is the p-th central moment, and N is the size of the array.

Example

x = {1,3,3,4,5}{0.867769}

Kurtosis (Population)

Summery

Compute population excess kurtosis in array

Description

Compute population excess kurtosis, defined as g2 = m4/m22-3, for array x. μ is the average, mp is the p-th central moment, and N is the size of the array.

Example

x = {1,3,3,4,5}{-0.783058}

Crest Factor

Summery

Compute crest factor in array

Description

Compute crest factor, defined as maximum magnitude divided by root mean square of values, for array x.

Example

x = {1,0.5,-1,-2,-3}{1.7178}

Percentile

Summery

Find k-th percentile in array

Description

Find k-th percentile defined as the lowest value at or below which k percentage (k=1.0 for 100%) of values in array x fall.

Example

x = {1,0.5,-1,-2,-3};k = {0.7}{0.5}

Index of Percentile

Summery

Find index of k-th percentile in array

Description

Find index of k-th percentile defined as index of a value equal to the lowest value at or below which k percentage (k=1.0 for 100%) of values in array x fall.

Example

x = {1,0.5,-1,-2,-3};k = {0.7}{1}

Sum

Summery

Compute sum in array

Description

Compute sum of values for array x.

Example

x = {1,0.5,-1,-2,-3}{-4.5}

Sum of Powers

Summery

Compute sum of powers in array

Description

Compute sum of powers of values, defined as Sum(x[i]p), for array x.

Example

x = {1,0.5,-1,-2,-3};p = {2}{15.25}

Product

Summery

Compute product in array

Description

Compute product (multiplication) of values for array x.

Example

x = {1,0.5,-1,-2,-3}{-3}

Integral

Summery

Compute integral (trapezoidal rule) in array

Description

Compute integral with trapezoidal rule, defined as {Sum(x[i])-0.5x[0]-0.5x[N-1]}×dx, for array x. N is the size of the array.

Example

x = {1,0.5,-1,-2,-3};dx = {4}{-14}

Norm

Summery

Compute p-norm in array

Description

Compute p-norm of values for array x.

Example

x = {1,0.5,-1,-2,-3};p = {2}{3.90512}
x = {1,0.5,-1,-2,-3};p = {1/0}{3}
x = {1,0.5,-1,-2,-3};p = {1}{7.5}

Distance to Hyperplane

Summery

Distance to hyperplane

Description

Compute the distance between point x and the hyperplane constructed with a as a[0]x[0]+a[1]x[1]+...+a[n-1]x[n-1]=a[n]. Coefficients are replaced with 0 if there are not enough values available in a.

Example

x = {0,0,0};a = {1,1,1,1}{0.57735}
x = {2,5};a = {1,0}{2}

Distance to Line

Summery

Distance to line

Description

Compute the distance between point x and the line constructed on points a and b.

Example

x = {1,0,0};a = {0,1,0};b = {0,0,1}{1.22474}
x = {2,5};a = {0,-1};b = {0,1}{2}

Plans to Derive Across Arrays


Total Count of Occurrences

Summery

Count occurrences of values in arrays

Description

Count the number of values equal to any value in a in arrays. The result is the number of values in arrays xk that are equal to any value in a.

Example

a = {};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{0}
a = {0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{4}
a = {0,1/0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{5}

Total Count of Non-Occurrences

Summery

Count non-occurrences of values in arrays

Description

Count the number of values not equal to any value in a in arrays. The result is the number of values in arrays xk that are not equal to any value in a.

Example

a = {};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{10}
a = {0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{6}
a = {0,1/0};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{5}

Total Count Inside Ranges

Summery

Count values in ranges in arrays

Description

Count the number of values in ranges defined as [from[k], to[k]] in arrays. The result is the number of values in arrays xk that fall in any of ranges [from[k], to[k]].

Example

from = {0};to = {1};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{5}
from = {0,2};to = {1,3};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{6}

Total Count Outside Ranges

Summery

Count values outside ranges in arrays

Description

Count the number of values outside ranges defined as [from[k], to[k]] in arrays. The result is the number of values in arrays xk that do not fall in any of ranges [from[k], to[k]].

Example

from = {0};to = {1};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{5}
from = {0,2};to = {1,3};x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{4}

Total Count of Finites

Summery

Count finite values in arrays

Description

Count the number of finite values in arrays. The result is the number of values in arrays xk that are finite. Non-finite values are +/-inf and nan.

Example

x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{8}

Total Count of Non-Finites

Summery

Count non-finite values in arrays

Description

Count the number of non-finite values in arrays. The result is the number of values in arrays xk that are not finite. Non-finite values are +/-inf and nan.

Example

x0 = {1,0,-1/0};x1 = {0,0,-1};x2 = {5/0,0,-7,2}{2}

Total Binning by Occurrence (Histogram)

Summery

Count occurrences in bins to prepare a histogram for arrays

Description

Count the number of values in arrays x0,x1,... that belong to bins listed in a. The result at index i is the number of values that fall in range [a[i]-δn[i],a[i]+δp[i]]. When unavailable, the last values in δn and δp are considered.

Example

a = {-3,-2,-1,0,1,2,3};δn = {0.5};δp = {0.5};x0 = {1.2,-2.6};x1 = {3.3};x2 = {0.7,-2.1}{1,1,0,0,2,0,1}
a = {-2,-1,0,1,2};δn = {0.5};δp = {0.5};x0 = {1.2,-2.6};x1 = {3.3};x2 = {0.7,-2.1}{1,0,0,2,0}
a = {-2,-1,0,1,2};δn = {10,0.5,0.5,0.5,0.5};δp = {0.5,0.5,0.5,0.5,10};x0 = {1.2,-2.6};x1 = {3.3};x2 = {0.7,-2.1}{2,0,0,2,1}

Total Binning by Positive Crossing

Summery

Count positive level crossings in arrays

Description

Count total positive level crossings in arrays x0,x1,... with levels listed in a. The result at index i is the number of indices k where xj[k]≤a[i] and xj[k+1]>a[i].

Example

a = {-1,0,1};x0 = {0.9,0,-1.1,0,1.1};x1 = {-2,2}{2,2,2}

Total Binning by Negative Crossing

Summery

Count negative level crossings in arrays

Description

Count total negative level crossings in arrays x0,x1,... with levels listed in a. The result at index i is the number of indices k where xj[k]≥a[i] and xj[k+1]<a[i].

Example

a = {-1,0,1};x0 = {0.9,0,-1.1,0,1.1};x1 = {-2,2}{1,1,0}

Total Minimum

Summery

Find minimum value in arrays

Description

Find the minimum value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{-7}

Array Index of Total Minimum

Summery

Find array index of minimum value in arrays

Description

Find array index of the first value equal to the minimum value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{2}

Total Maximum

Summery

Find maximum value in arrays

Description

Find the maximum value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{5}

Array Index of Total Maximum

Summery

Find array index of maximum value in arrays

Description

Find array index of the first value equal to the maximum value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{2}

Total Minimum Magnitude

Summery

Find minimum magnitude value in arrays

Description

Find the minimum magnitude value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{0}

Array Index of Total Minimum Magnitude

Summery

Find array index of minimum magnitude value in arrays

Description

Find array index of the first value equal to the minimum magnitude value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{0}

Total Maximum Magnitude

Summery

Find maximum magnitude value in arrays

Description

Find the maximum magnitude value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{7}

Array Index of Total Maximum Magnitude

Summery

Find array index of maximum magnitude value in arrays

Description

Find array index of the first value equal to the maximum magnitude value in arrays x0,x1,... .

Example

x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2}{2}

Total Mean

Summery

Compute arithmetic mean of values in arrays

Description

Compute arithmetic mean of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {-1};x2 = {-2,3}{0.2}

Total Geometric Mean

Summery

Compute geometric mean of values in arrays

Description

Compute geometric mean of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,-1};x1 = {1};x2 = {-16,-2}{2}

Total Harmonic Mean

Summery

Compute harmonic mean of values in arrays

Description

Compute harmonic mean of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,-1};x1 = {1};x2 = {-16,-2}{11.4286}

Total Weighted Mean

Summery

Compute weighted mean of values in arrays

Description

Compute weighted mean of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {-1};x2 = {-2,3}{0.333333}

Total Custom-Weighted Mean

Summery

Compute custom-weighted mean of values in arrays

Description

Compute custom-weighted mean of the flat array of arrays {x0,x1,...}. Weights are listed in a

Example

a = {2,1,-1};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{1}

Total Exponential-Weighted Mean

Summery

Compute exponential mean of values in arrays

Description

Compute exponential mean or the last value in the exponential moving average of the flat array of arrays {x0,x1,...}. α is the smoothing factor.

Example

α = {0.9};x0 = {1,0,-1};x1 = {0,0,-1};x2 = {5,3,-7,-2};x3 = {2,6,-1}{-0.344399}

Total Median

Summery

Find median of values in arrays

Description

Find median in the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {-1};x2 = {-2,3}{0}

Array Index of Total Median

Summery

Find array index of median of values in arrays

Description

Find array index of median in the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {-1};x2 = {-2,3}{0}

Total Mode

Summery

Find mode of values in arrays

Description

Find mode in the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0,0};x1 = {1,2,2};x2 = {2,2}{2}

Array Index of Total Mode

Summery

Find array index of mode of values in arrays

Description

Find array index of mode in the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0,0};x1 = {1,2,2};x2 = {2,2}{1}

Total Range

Summery

Compute range of values in arrays

Description

Compute range of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {1};x2 = {-2,-3}{4}

Total Root Mean Square

Summery

Compute root mean square of values in arrays

Description

Compute root mean square of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {1};x2 = {-2,-3}{1.73205}

Total Moment

Summery

Compute moment of values in arrays

Description

Compute moment the flat array of arrays {x0,x1,...}.

Example

p = {2};x0 = {1,-1};x1 = {1};x2 = {-2,-3}{3.2}
p = {-1};x0 = {1,-1};x1 = {1};x2 = {-2,-3}{0.0333333}

Total Central Moment

Summery

Compute central moment of values in arrays

Description

Compute central moment of the flat array of arrays {x0,x1,...}.

Example

p = {2};x0 = {1,-1};x1 = {1};x2 = {-2,-3}{2.56}
p = {-1};x0 = {1,-1};x1 = {1};x2 = {-2,-3}{-1.03535}

Total Standardized Moment

Summery

Compute standardized moment of values in arrays

Description

Compute standardized moment of the flat array of arrays {x0,x1,...}.

Example

p = {2};x0 = {1,-1};x1 = {1};x2 = {-2,-3}{1}
p = {-1};x0 = {1,-1};x1 = {1};x2 = {-2,-3}{-1.65657}

Total Standard Deviation (Sample)

Summery

Compute sample standard deviation of values in arrays

Description

Compute sample standard deviation of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {1};x2 = {-2,-3}{1.81659}

Total Standard Deviation (Population)

Summery

Compute population standard deviation of values in arrays

Description

Compute population standard deviation of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {1};x2 = {-2,-3}{1.62481}

Total Variance (Sample)

Summery

Compute sample variance of values in arrays

Description

Compute sample (unbiased) variance of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {1};x2 = {-2,-3}{3.3}

Total Variance (Population)

Summery

Compute population variance of values in arrays

Description

Compute population (biased) variance of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0};x1 = {1};x2 = {-2,-3}{2.64}

Total Skewness (Sample)

Summery

Compute sample skewness of values in arrays

Description

Compute sample skewness of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{-0.551618}

Total Skewness (Population)

Summery

Compute population skewness of values in arrays

Description

Compute population skewness of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{-0.370037}

Total Kurtosis (Sample)

Summery

Compute sample excess kurtosis of values in arrays

Description

Compute sample excess kurtosis of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{0.867769}

Total Kurtosis (Population)

Summery

Compute population excess kurtosis of values in arrays

Description

Compute population excess kurtosis of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{-0.783058}

Total Crest Factor

Summery

Compute crest factor of values in arrays

Description

Compute crest factor of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{1.7178}

Total Percentile

Summery

Find k-th percentile of values in arrays

Description

Find k-th percentile in the flat array of arrays {x0,x1,...}.

Example

k = {0.7};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{0.5}

Array Index Total Percentile

Summery

Find array index of k-th percentile of values in arrays

Description

Find array index of k-th percentile in the flat array of arrays {x0,x1,...}.

Example

k = {0.7};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{0}

Total Sum

Summery

Compute sum of values in arrays

Description

Compute sum of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{-4.5}

Total Sum of Powers

Summery

Compute sum of powers of values in arrays

Description

Compute sum of powers of the flat array of arrays {x0,x1,...}.

Example

p = {2};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{15.25}

Total Product

Summery

Compute product of values in arrays

Description

Compute product of the flat array of arrays {x0,x1,...}.

Example

x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{-3}

Total Integral

Summery

Compute integral (trapezoidal rule) of values in arrays

Description

Compute integral with trapezoidal rule of the flat array of arrays {x0,x1,...}.

Example

dx = {4};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{-14}

Total Norm

Summery

Compute p-norm of values in arrays

Description

Compute p-norm of the flat array of arrays {x0,x1,...}.

Example

p = {2};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{3.90512}
p = {1};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{7.5}

Dot Product

Summery

Compute dot product of arrays

Description

Compute scalar (dot) product as the sum of products of available values at the same index across arrays x0,x1,... .

Example

x0 = {3,4,5};x1 = {-1,0,1}{2}
x0 = {3,4,5};x1 = {-1,0,1};x2 = {1,2,1,2}{4}

Normalized Dot Product

Summery

Compute normalized dot product of two arrays

Description

Compute dot product of two Euclidean-normalized arrays x/|x| and y/|y|. x and y must have the same size.

Example

x = {3,4,5};y = {-1,0,1}{0.2}

Script in Text

Summery

Execute JavaScript function of arrays from text script

Description

Run JavaScript function under function name from a script text. Input arrays x0,x1,... are passed to function name in order.

Example

function name = {main};script = {function main(){ return [3, test()]; } function test(){ return 7; }}{3,7}
function name = {"main2"};script = {function main2(a,b,c){ let d = b[1]*c[1]; return [1, a.length, d]; }};x0 = {1,2,3,4};x1 = {2,3};x2 = {1,-2}{1,4,-6}

Script in File

Summery

Execute JavaScript function of arrays from file script

Description

Run JavaScript function under function name from a file with file name. Input arrays x0,x1,... are passed to function name in order.

Example

function name = {main};file name = {tests\test.js}{3,7}
function name = {"main2"};file name = {tests\test.js};x0 = {1,2,3,4};x1 = {2,3};x2 = {1,-2}{1,4,-6}

Plans to Post an Array


Export to Text File Along Rows

Summery

Export arrays to text file along rows

Description

Export arrays x0,x1,... to a text file at file name along rows with values separated by delimiter. If append is nonempty, the array values are appended to the end of the file. Floating-point format is set by width and precision parameters.

Example

file name = {tests\rows.txt};append = {};delimiter = {; };width = {};precision = {};x0 = {1,2,3,pi};x1 = {2,3};x2 = {1,-2}

Export to Text File Along Columns

Summery

Export arrays to text file along columns

Description

Export arrays x0,x1,... to a text file at file name along columns with columns separated by delimiter. If append is nonempty, the array values are appended to the end of the file. To make arrays similar in size, extra zeros are added to the end of arrays when needed. Floating-point format is set by width and precision parameters.

Example

file name = {tests\columns.txt};append = {1};delimiter = {, };width = {8};precision = {3};x0 = {1,2,3,pi};x1 = {2,3};x2 = {1,-2}

Export To Binary File

Summery

Export an array to binary file

Description

Export array x to a binary file at file name. If append is nonempty, the array values are appended to the end of the file.

Example

file name = {tests\arrays.bin};append = {};x = {1,2,3,pi}

Pass to Script in Text

Summery

Pass arrays to JavaScript function from text script

Description

Run JavaScript function under function name from a script text asynchronously. Input arrays x0,x1,... are passed to function name in order.

Example

function name = {main};script = {function main(){ return [3, test()]; } function test(){ return 7; }}
function name = {"main2"};script = {function main2(a,b,c){ let d = b[1]*c[1]; return [1, a.length, d]; }};x0 = {1,2,3,4};x1 = {2,3};x2 = {1,-2}

Pass to Script in File

Summery

Pass arrays to JavaScript function from file script

Description

Run JavaScript function under function name from a file at file name asynchronously. Input arrays x0,x1,... are passed to function name in order.

Example

function name = {main};file name = {tests\test.js}
function name = {"main2"};file name = {tests\test.js};x0 = {1,2,3,4};x1 = {2,3};x2 = {1,-2}