Plan Documentation

Array Plans (Paternova™ v.0.9.9)

An array is an ordered list of floating-point numbers. The following functions, or "plans," can be used to create, modify, calculate, read, write, and otherwise manipulate arrays in Paternova.


Get an Array

These plans create an array using the information provided by the user.


Custom Array

Plan to generate a custom array.

Description

This plan generates an array based on the specified array x. The array parameter can be specified either as an array expression or as a reference to the output array in another cell. For example, B1 specifies a relative reference to the array in cell B1; $B$1 specifies an absolute reference to the array in that cell; and B$1 or $B1 specify mixed references, where only the row or the column is absolute. When an array expression is provided, this plan computes the output array by evaluating the array expression x value by value, with array values separated by commas.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

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

Fill Array

Plan to generate a filled array.

Description

This plan fills an array of length n with the values in the array a. If there are not enough values available in a, its last value is used to fill the remainder of the output array.

Example

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

Generating Expressions

Plan to generate values with expression.

Description

This plan generates an array of length n by evaluating the expression f(i) at each index i.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and 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

Plan to generate values with polynomial expansion.

Description

This plan generates an array of length n by evaluating the polynomial expansion: a[0]+a[1]×i+a[2]×i2+... at each index i.

Example

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

Fourier Expansion

Plan to generate values with Fourier expansion.

Description

This plan generates an array of length n by evaluating the sine-cosine Fourier expansion: a[0]+a[1]×cos(2πi/p)+b[1]×sin(2πi/p)+a[2]×cos(2πi×2/p)+... at each index i. In this expansion, p is the period, and b[0] is omitted.

Example

n = {3};p = {3};a = {0,1,1};b = {0,-1,1}{2,-2.73205,0.732051}

Randomized - Discrete Uniform

Plan to randomize values with discrete uniform distribution.

Description

This plan generates an array of n random integers with a discrete uniform distribution in the interval [a, b].

Example

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

Randomized - Continuous Uniform

Plan to randomize values with continuous uniform distribution.

Description

This plan generates an array of n random (floating-point) numbers with a continuous uniform distribution in the interval [a, b].

Example

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

Randomized - Normal

Plan to randomize values with normal distribution.

Description

This plan generates an array of n random numbers with a normal distribution, using the parameters μ (mean) and σ (standard deviation).

Example

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

Randomized - Lognormal

Plan to randomize values with lognormal distribution.

Description

This plan generates an array of n random numbers with a lognormal distribution, using the parameters μ (mean) and σ (standard deviation) of the natural logarithm of the values.

Example

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

Randomized - Chi-squared

Plan to randomize values with chi-squared distribution.

Description

This plan generates an array of n random numbers with a chi-squared distribution of k degrees of freedom.

Example

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

Randomized - Cauchy

Plan to randomize values with Cauchy distribution.

Description

This plan generates an array of n random numbers with a Cauchy distribution, using the parameters x₀ and γ.

Example

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

Randomized - Student-t

Plan to randomize values with Student’s t-distribution.

Description

This plan generates an array of n random numbers with a Student’s t-distribution of k degrees of freedom.

Example

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

Randomized - Poisson

Plan to randomize values with Poisson distribution.

Description

This plan generates an array of n random integers with a (discrete) Poisson distribution of rate λ.

Example

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

Randomized - Exponential

Plan to randomize values with exponential distribution.

Description

This plan generates an array of n random numbers with an exponential distribution of rate λ.

Example

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

Randomized - Weibull

Plan to randomize values with Weibull distribution.

Description

This plan generates an array of n random numbers with a Weibull distribution, using the parameters k (shape parameter), and λ (scale parameter).

Example

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

Import From Text File Along Rows

Plan to import an array from a text file row by row.

Description

This plan imports an array from a row in a text file with the given file name. The import starts from the value located at the specified row and column (both counted from 0). The columns are separated by the specified delimiter.

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

Plan to import an array from a text file along column by column.

Description

This plan imports an array from a column in a text file with the given file name. The import starts from the value located at the specified row and column (both counted from 0). The rows are separated by the specified delimiter.

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

Plan to import an array from a binary file.

Description

This plan imports an array from a binary file with the given file name.

Example

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

Extract From JSON File

Plan to extract an array from a JSON file.

Description

This plan extracts an array from a JSON file with the given file name, where the values collected in the output array are identified by the specified key.

Example

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

Extract From JSON on Network

Plan to extract an array from a JSON on network.

Description

This plan requests and extracts an array from a JSON file at a network address, where the values collected in the output array are identified by the specified key.

Example

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

Convert Matrix Along Rows

Plan to generate an array from matrix rows.

Description

This plan generates an array from the real parts of the rows in the matrix x. When the parameter rows is specified, only the elements in those rows are used to produce the output array; otherwise, all matrix elements are listed along the rows. More specialized plans for generating an array from a matrix are available under Matrix Plans/Highlight a Matrix/Array Converters.

Example

x = {1,2,3;4,5,6};rows = {}{1,2,3,4,5,6}
x = {1,2,3;4,5,6};rows = {1,0,1}{4,5,6,1,2,3,4,5,6}
x = {1,2*sqrt(-1);4,5};rows = {}{1,0,4,5}

Convert Matrix Along Columns

Plan to generate an array from matrix columns.

Description

This plan generates an array from the real parts of the columns in the matrix x. When the parameter columns is specified, only the elements in those columns are used to produce the output array; otherwise, all matrix elements are listed along the columns. More specialized plans for generating an array from a matrix are available under Matrix Plans/Highlight a Matrix/Array Converters.

Example

x = {1,2,3;4,5,6};columns = {}{1,4,2,5,3,6}
x = {1,2,3;4,5,6};columns = {1,0,1}{2,5,1,4,2,5}
x = {1,2*sqrt(-1);4,5};columns = {}{1,4,0,5}

Convert Text

Plan to generate an array from a text.

Description

This plan generates an array from the text x. The value tokens in x are separated by the specified delimiter. Alternatively, when the ltag and rtag parameters are specified, value tokens are detected when they are enclosed by ltag on the left and rtag on the right. Each value token is evaluated to generate a value for the output array.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {1;2;3;4};delimiter = {;};ltag = {};rtag = {}{1,2,3,4}
x = {1<2>3<4>};delimiter = {};ltag = {<};rtag = {>}{2,4}

Convert Text List

Plan to generate an array from a text list.

Description

This plan generates an array from the text list x. Each text item in the specified text list is evaluated to generate a value for the output array.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {"1",2,3,"4"}{1,2,3,4}
x = {1,2-3,sqrt(4),3-5}{1,-1,2,-2}

Alpha Vantage - Stock and Security Prices

Plan to import historical prices from Alpha Vantage API.

Description

This plan imports historical prices for a stock or cryptocurrency symbol from the Alpha Vantage API. Requests are made using the specified function and are authenticated with an api key. Some functions may require specifying an exchange market or a time interval. Values assigned to a token (e.g., close for the closing price, open for the opening price, etc.) are collected in the output array. If not_adjusted is empty, the response will be adjusted for historical split and dividend events. If no_extended_hours is empty, the response will include the extended (pre- and post-market) trading hours (4:00 a.m. to 8:00 p.m. EST for the US market). If is_full is empty, the response will include only the most recent data.

Notes:

  1. To acquire an api key, go to https://www.alphavantage.co/support.
  2. To learn more about the API parameters, visit https://www.alphavantage.co/documentation.
  3. This plan requests data from Alpha Vantage's servers by sharing the plan parameters. The Alpha Vantage privacy policy is available at https://www.alphavantage.co/privacy.
  4. You may need to increase the network timeout (Preferences > Network Timeout) to allow enough time for the API response to arrive.
  5. A corresponding plan to generate the complete API response is available under Text Plans/Get/3rd-Party Importers - Raw Response.

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}{...}


Rearrange an Array

These plans produce an array by rearranging another array.


Copy Array

Plan to copy an array.

Description

This plan copies all the values in the array x.

Example

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

Replicate Array

Plan to replicate an array.

Description

This plan replicates the array x by duplicating each value m times, and then repeating the resulting array n times, producing {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}

Resize Array From Start

Plan to resize an array from the beginning.

Description

This plan resizes a copy of array x to a length of n by either removing values from the end or filling the end with repeats of the array a.

Example

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

Resize Array From End

Plan to resize an array from the end.

Description

This plan resizes a copy of array x to a length of n by either removing values from the beginning or filling the beginning with repeats of the array a.

Example

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

Reverse Array

Plan to reverse an array.

Description

This plan reverses the order of the values in a copy of array x.

Example

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

Shift Values Toward Start

Plan to shift values toward the beginning.

Description

This plan shifts and cycles each value in a copy of array x toward the beginning by n positions.

Example

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

Shift Values Toward End

Plan to shift values toward the end.

Description

This plan shifts and cycles each value in a copy of array x toward the end by n positions.

Example

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

Sort Values in Ascending Order

Plan to sort values in ascending order.

Description

This plan arranges the values in a copy of array x from smallest to largest.

Example

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

Sort Values in Descending Order

Plan to sort values in descending order.

Description

This plan arranges the values in a copy of array x from largest to smallest.

Example

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

Order Values Randomly

Plan to randomize the order of values.

Description

This plan randomly arranges the values in a copy of array x.

Example

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

Permute Values into Next Permutation

Plan to permute values into the next permutation.

Description

This plan arranges the values in a copy of array x to form the next permutation. The set of all permutations of the array x is ordered lexicographically with respect to the less-than predicate.

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}

Permute Values into Previous Permutation

Plan to permute values into the previous permutation.

Description

This plan arranges the values in a copy of array x to form the previous permutation. The set of all permutations of the array x is ordered lexicographically with respect to the less-than predicate.

Example

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

First Value

Plan to copy the first value.

Description

This plan copies the first value in the array x.

Example

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

Last Value

Plan to copy the last value.

Description

This plan copies the last value in the array x.

Example

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

Copy Values From Start

Plan to copy values at indices counted from the beginning.

Description

This plan copies the values at the indices specified by n from the array x to produce the output array. The result at index i is a copy of the n[i]-th value in the array x, counted from the beginning.

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}

Copy Values From End

Plan to copy values at indices counted from the end.

Description

This plan copies the values at the reverse indices specified by n from the array x to produce the output array. The result at index i is a copy of the n[i]-th value in the array x, counted from the end. Reverse indices traverse the array in reverse order.

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 Values From Start

Plan to remove values at indices counted from the beginning.

Description

This plan removes, from a copy of array x, the values at the indices specified by n[k] for each k.

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

Plan to remove values at indices counted from the end.

Description

This plan removes, from a copy of array x, the values at the reverse indices specified by n[k] for each k. Reverse indices traverse the array in reverse order.

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 Ranges From Start

Plan to keep values in index ranges counted from the beginning.

Description

This plan retains, in a copy of array x, only the values at indices that fall within any of the ranges [a[k], b[k]).

Example

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

Keep Ranges From End

Plan to keep values in index ranges counted from the end.

Description

This plan retains, in a copy of array x, only the values at reverse indices that fall within any of the ranges [a[k], b[k]). Reverse indices traverse the array in reverse order.

Example

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

Remove Ranges From Start

Plan to remove values in index ranges counted from the beginning.

Description

This plan removes, from a copy of array x, the values at indices that fall within any of the ranges [a[k], b[k]).

Example

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

Remove Ranges From End

Plan to remove values in index ranges counted from the end.

Description

This plan removes, from a copy of array x, the values at reverse indices that fall within any of the ranges [a[k], b[k]). Reverse indices traverse the array in reverse order.

Example

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

Keep After Position From Start

Plan to keep values after an index counted from the beginning.

Description

This plan retains, in a copy of array x, only the values at indices greater than or equal to n.

Example

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

Keep After Position From End

Plan to keep values after an index counted from the end.

Description

This plan retains, in a copy of array x, only the values at reverse indices greater than or equal to n. Reverse indices traverse the array in reverse order.

Example

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

Remove After Position From Start

Plan to remove values after an index counted from the beginning.

Description

This plan removes, from a copy of array x, the values at indices greater than or equal to n.

Example

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

Remove After Position From End

Plan to remove values after an index counted from the end.

Description

This plan removes, from a copy of array x, the values at reverse indices greater than or equal to n. Reverse indices traverse the array in reverse order.

Example

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

Keep Before Position From Start

Plan to keep values before an index counted from the beginning.

Description

This plan retains, in a copy of array x, only the 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 Position From End

Plan to keep values before an index counted from the end.

Description

This plan retains, in a copy of array x, only the values at reverse indices less than or equal to n. Reverse indices traverse the array in reverse order.

Example

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

Remove Before Position From Start

Plan to remove values before an index counted from the beginning.

Description

This plan removes, from a copy of array x, the values at indices less than or equal to n.

Example

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

Remove Before Position From End

Plan to remove values before an index counted from the end.

Description

This plan removes, from a copy of array x, the values at reverse indices less than or equal to n. Reverse indices traverse the array in reverse order.

Example

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

Keep Periodically From Start

Plan to keep values periodically from the beginning.

Description

This plan retains, in a copy of array x, only every nth value, starting at (and including) the value at the offset index, and continuing to the end.

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

Plan to keep values periodically from the end.

Description

This plan retains, in a copy of array x, only every nth value, starting at (and including) the value at the offset reverse index, and continuing to the beginning. Reverse indices traverse the array in reverse order.

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}

Remove Periodically From Start

Plan to remove values periodically from the beginning.

Description

This plan removes, from a copy of array x, every nth value, starting at (and including) the value at the offset index, and continuing to the end.

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

Plan to remove values periodically from the end.

Description

This plan removes, from a copy of array x, every nth value, starting at (and including) the value at the offset reverse index, and continuing to the beginning. Reverse indices traverse the array in reverse order.

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}

Optimizer - Iteration Input

Plan to generate the next iteration input for an optimizer plan.

Description

This plan partitions the array x as an optimization array to generate the input for the next optimization iteration or to provide the optimized input if the optimization is complete.
An optimization array is organized as follows: {next | counter | ... | size | is_done}. The next partition contains the input for the next iteration, or the optimized input if the optimization is complete. The counter partition stores the number of iterations since the start of the optimization. The size partition contains the input size, and the is_done partition contains the termination flag. Optimizer plans are available under Array Plans/Modify an Array/Optimizers.

Example

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

Optimizer - Iteration Counter

Plan to generate the iteration counter of an optimizer plan.

Description

This plan partitions the array x as an optimization array to generate the number of iterations since the start of the optimization.
An optimization array is organized as follows: {next | counter | ... | size | is_done}. The next partition contains the input for the next iteration, or the optimized input if the optimization is complete. The counter partition stores the number of iterations since the start of the optimization. The size partition contains the input size, and the is_done partition contains the termination flag. Optimizer plans are available under Array Plans/Modify an Array/Optimizers.

Example

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

Insert Values From Start

Plan to insert values at indices counted from the beginning.

Description

This plan inserts N[k] copies of a[k] into a copy of array x at index p[k] for each k. The last values in a and N are used when k is out of bounds.

Example

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

Insert Values From End

Plan to insert values at indices counted from the end.

Description

This plan inserts N[k] copies of a[k] into a copy of array x at reverse index p[k] for each k. The last values in a and N are used when k is out of bounds. Reverse indices traverse the array in reverse order.

Example

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

Swap Ranges From Start

Plan to swap values in index ranges counted from the beginning.

Description

This plan swaps the values at the indices in the range [a[k], b[k]) in a copy of array x with a segment of the same length starting at index p[k] for each k. The last values in a and b are used when k is out of bounds.

Example

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

Swap Ranges From End

Plan to swap values in index ranges counted from the end.

Description

This plan swaps the values at the reverse indices in the range [a[k], b[k]) in a copy of array x with a segment of the same length starting at reverse index p[k] for each k. The last values in a and b are used when k is out of bounds. Reverse indices traverse the array in reverse order.

Example

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

Keep Values

Plan to keep values.

Description

This plan retains, in a copy of array x, only those values that are equal to any of the values in the array a.

Example

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

Remove Values

Plan to remove values.

Description

This plan removes, from a copy of array x, any values that are equal to any of the values in the array a.

Example

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

Keep Ranges of Values

Plan to keep ranges of values.

Description

This plan retains, in a copy of array x, only those values that fall within any of the ranges [a[k], b[k]).

Example

x = {1,2,3,4,5,6};a = {1,3.2};b = {1,10}{4,5,6}
x = {12,3.5,-3.5,2*e,-sqrt(2)};a = {2,-4};b = {6,-3}{3.5,-3.5,5.43656}

Remove Ranges of Values

Plan to remove ranges of values.

Description

This plan removes, from a copy of array x, any values that fall within any of the ranges [a[k], b[k]).

Example

x = {1,2,3,4,5,6};a = {1,3.2};b = {1,10}{1,2,3}
x = {12,3.5,-3.5,2*e,-sqrt(2)};a = {2,-4};b = {6,-3}{12,-1.41421}

Keep Large Values

Plan to keep large values.

Description

This plan retains, in a copy of array x, only those values that are greater than or equal to a. For each index k, the copy of x[k] is kept only if it is greater than or equal to a[k]. The last value in a is used when k is out of bounds.

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 Large Values

Plan to remove large values.

Description

This plan removes, from a copy of array x, any values that are greater than or equal to a. For each index k, the copy of x[k] is removed if it is greater than or equal to a[k]. The last value in a is used when k is out of bounds.

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 Small Values

Plan to keep small values.

Description

This plan retains, in a copy of array x, only those values that are less than or equal to a. For each index k, the copy of x[k] is kept only if it is less than or equal to a[k]. The last value in a is used when k is out of bounds.

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 Small Values

Plan to remove small values.

Description

This plan removes, from a copy of array x, any values that are less than or equal to a. For each index k, the copy of x[k] is removed if it is less than or equal to a[k]. The last value in a is used when k is out of bounds.

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 Far Values

Plan to keep far values.

Description

This plan retains, in a copy of array x, only those values whose distance to o is greater than or equal to a. For each index k, the copy of x[k] is kept only when its distance to o[k] is greater than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Remove Far Values

Plan to remove far values.

Description

This plan removes, from a copy of array x, any values whose distance to o is greater than or equal to a. For each index k, the copy of x[k] is removed when its distance to o[k] is greater than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Keep Close Values

Plan to keep close values.

Description

This plan retains, in a copy of array x, only those values whose distance to o is less than or equal to a. For each index k, the copy of x[k] is kept only when its distance to o[k] is less than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Remove Close Values

Plan to remove close values.

Description

This plan removes, from a copy of array x, any values whose distance to o is less than or equal to a. For each index k, the copy of x[k] is removed when its distance to o[k] is less than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Trim Side Values

Plan to trim values from the ends while equal to given values.

Description

This plan removes values from the beginning of a copy of array x as long as they are equal to any value in the array a, and removes values from the end as long as they are equal to any value in the array b.

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 Same Side Values

Plan to trim values from the ends while equal to the ends.

Description

This plan removes values from the beginning of a copy of array x as long as they are equal to the first value in x, and removes values from the end as long as they are equal to the last value in x.

Example

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

Trim Same Starting Values

Plan to trim values from the beginning while equal to the beginning.

Description

This plan removes values from the beginning of a copy of array x as long as they are equal to the first value in x.

Example

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

Trim Same Ending Values

Plan to trim values from the end while equal to the end.

Description

This plan removes values from the end of a copy of array x as long as they are equal to the last value in x.

Example

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

Keep Unique Values

Plan to keep unique values.

Description

This plan removes consecutive repeating values from a copy of array x.

Example

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

Keep Finite Values

Plan to keep finite values.

Description

This plan removes occurrences of inf, -inf, and nan from a copy of array x.

Example

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

Keep Extreme Values

Plan to keep peaks and valleys.

Description

This plan retains, in a copy of array x, only the peaks (values greater than their neighboring values) and valleys (values less than their 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 - Value

Plan to apply a hysteresis filter based on value.

Description

This plan removes, from a copy of array x, any values whose deviation from the previous neighboring value is less than a.

Example

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

Remove Small Variations - Ratio

Plan to apply a hysteresis filter based on ratio.

Description

This plan removes, from a copy of array x, any values whose deviation from the previous neighboring value is less than a times their own value.

Example

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

Remove Large Variations - Value

Plan to remove spikes based on their value.

Description

This plan removes, from a copy of array x, any peaks (values greater than their neighboring values) or valleys (values less than their neighboring values) whose deviation from both 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 - Ratio

Plan to remove spikes based on their ratio.

Description

This plan removes, from a copy of array x, any peaks (values greater than their neighboring values) or valleys (values less than their neighboring values) whose deviation from both neighboring values is greater than a times their own 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 - Value

Plan to remove values based on their distance to average.

Description

This plan removes, from a copy of array x, any values whose deviation from the 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 - Ratio

Plan to remove values based on their distance to average relative to average.

Description

This plan removes, from a copy of array x, any values whose deviation from the 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 - σ-Ratio

Plan to remove values based on their distance to average relative to standard deviation.

Description

This plan removes, from a copy of array x, any values whose deviation from the 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}


Rearrange Multiple Arrays

These plans produce an array by rearranging multiple arrays.


Nth Array

Plan to copy the nth array.

Description

This plan copies the nth array.

Example

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

Conditional Copy

Plan to conditionally copy an array.

Description

This plan copies the array x if array z is not empty; otherwise, it copies the array y. Note that refresh requests are not propagated to the parameters x, y, and z.

Example

x = {1,2,3};y = {7,6,8};z = {1,2}{1,2,3}
x = {1,2,3};y = {7,6,8};z = {}{7,6,8}

Stitch

Plan to stitch arrays.

Description

This plan combines copies of the given arrays in the following order: {x0[0],x0[1],...,x1[0],x1[1],...} to produce the output array.

Example

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

Interleave

Plan to interleave arrays.

Description

This plan combines copies of the given arrays in the following order: {x0[0],x1[0],...,x0[1],x1[1],...} to produce the output array.

Example

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

Stitch and Repeat

Plan to stitch and replicate arrays.

Description

This plan produces the output array by copying each of the given arrays m times and then replicating the resulting array n times. The output is structured as follows: {(x0[0],x0[1],...)(m times),(x1[0],x1[1],...)(m times),...}(n times).

Example

m = {2};n = {3};x0 = {1,2,3};x1 = {4,5}{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}

Interleave and Repeat

Plan to interleave and replicate arrays.

Description

This plan produces the output array by interleaving m copies of the given arrays and then replicating the resulting array n times. The output is structured as follows: {(x0[0],x1[0],...)(m times),(x0[1],x1[1],...)(m times),...}(n times).

Example

m = {2};n = {3};x0 = {1,2,3};x1 = {4,5}{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}

Insert Arrays From Start

Plan to insert arrays at indices counted from the beginning.

Description

This plan inserts a copy of the array yk into a copy of array x at index p[k] for each k. The last array among the y arrays is used when k is out of bounds.

Example

x = {1,2,3,4,5,6};p = {0,3};y0 = {-2,-3};y1 = {-4,-1}{-2,-3,1,2,3,-4,-1,4,5,6}
x = {1,2,3,4};p = {3,1,4,8};y0 = {-2,-3};y1 = {-4,-1}{1,-4,-1,2,3,-2,-3,4,-4,-1,-4,-1}

Insert Arrays From End

Plan to insert arrays at indices counted from the end.

Description

This plan inserts a copy of the array yk into a copy of array x at reverse index p[k] for each k. The last array among the y arrays is used when k is out of bounds. Reverse indices traverse the array in reverse order.

Example

x = {1,2,3,4,5,6};p = {0,3};y0 = {-2,-3};y1 = {-4,-1}{1,2,3,-4,-1,4,5,6,-2,-3}
x = {1,2,3,4};p = {3,1,4,8};y0 = {-2,-3};y1 = {-4,-1}{-4,-1,-4,-1,1,-2,-3,2,3,-4,-1,4}

Values From Arrays

Plan to copy values from arrays.

Description

This plan copies the k-th value of the n[k]-th array for each index k, when available.

Example

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

Conditionally Keep Values

Plan to keep when corresponding values match given values.

Description

This plan retains, in a copy of array source, only those values whose corresponding reference value is equal to any value in the array a. The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

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

Conditionally Remove Values

Plan to remove when corresponding values match given values.

Description

This plan removes, from a copy of array source, any values whose corresponding reference value is equal to any value in the array a. The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

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

Conditionally Keep Ranges of Value

Plan to keep when corresponding values fall in given ranges.

Description

This plan retains, in a copy of array source, only those values whose corresponding reference value falls within any of the ranges [a[k], b[k]). The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {1,3.2};b = {1,10}{3,2,1}
source = {6,5,4,3,2,1};reference = {pi,e,-sqrt(2),3.6,-5.5};a = {2.7,-3};b = {10,-1}{6,5,4,3}

Conditionally Remove Ranges of Values

Plan to remove when corresponding values fall in given ranges.

Description

This plan removes, from a copy of array source, any values whose corresponding reference value falls within any of the ranges [a[k], b[k]). The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

source = {6,5,4,3,2,1};reference = {1,2,3,4,5,6};a = {1,3.2};b = {1,10}{6,5,4}
source = {6,5,4,3,2,1};reference = {pi,e,-sqrt(2),3.6,-5.5};a = {2.7,-3};b = {10,-1}{2,1}

Conditionally Keep Large Values

Plan to keep when corresponding values are large.

Description

This plan retains, in a copy of array source, only those values whose corresponding reference value is greater than or equal to a. For each index k, the copy of source[k] is kept only when reference[k] is greater than or equal to a[k]. The last value in a is used when k is out of bounds.

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}

Conditionally Remove Large Values

Plan to remove when corresponding values are large.

Description

This plan removes, from a copy of array source, any values whose corresponding reference value is greater than or equal to a. For each index k, the copy of source[k] is removed when reference[k] is greater than or equal to a[k]. The last value in a is used when k is out of bounds.

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}

Conditionally Keep Small Values

Plan to keep when corresponding values are small.

Description

This plan retains, in a copy of array source, only those values whose corresponding reference value is less than or equal to a. For each index k, the copy of source[k] is kept only when reference[k] is less than or equal to a[k]. The last value in a is used when k is out of bounds.

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}

Conditionally Remove Small Values

Plan to remove when corresponding values are small.

Description

This plan removes, from a copy of array source, any values whose corresponding reference value is less than or equal to a. For each index k, the copy of source[k] is removed when reference[k] is less than or equal to a[k]. The last value in a is used when k is out of bounds.

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}

Conditionally Keep Far Values

Plan to keep when corresponding values are far.

Description

This plan retains, in a copy of array source, only those values whose corresponding reference value has a distance to o that is greater than or equal to a. For each index k, the copy of source[k] is kept only when the distance between reference[k] and o[k] is greater than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Conditionally Remove Far Values

Plan to remove when corresponding values are far.

Description

This plan removes, from a copy of array source, any values whose corresponding reference value has a distance to o that is greater than or equal to a. For each index k, the copy of source[k] is removed when the distance between reference[k] and o[k] is greater than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Conditionally Keep Close Values

Plan to keep when corresponding values are close.

Description

This plan retains, in a copy of array source, only those values whose corresponding reference value has a distance to o that is less than or equal to a. For each index k, the copy of source[k] is kept only when the distance between reference[k] and o[k] is less than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Conditionally Remove Close Values

Plan to remove when corresponding values are close.

Description

This plan removes, from a copy of array source, any values whose corresponding reference value has a distance to o that is less than or equal to a. For each index k, the copy of source[k] is removed when the distance between reference[k] and o[k] is less than or equal to a[k]. The last values in o and a are used when k is out of bounds.

Example

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

Conditionally Trim Side Values

Plan to trim when corresponding values from the ends match given values.

Description

This plan removes values from the beginning of a copy of array source as long as their corresponding reference values are equal to any value in the array a, and removes values from the end as long as their corresponding reference values are equal to any value in the array b. The reference value for source[i] is defined as the value at index i in the specified reference array.

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}

Conditionally Trim Same Side Values

Plan to trim when corresponding values from the ends are equal to the corresponding ends.

Description

This plan removes values from the beginning of a copy of array source as long as their corresponding reference values are equal to the first value in the reference array, and removes values from the end as long as their corresponding reference values are equal to the last value in the reference array. The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

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

Conditionally Trim Same Starting Values

Plan to trim when corresponding values from the beginning are equal to the corresponding beginning.

Description

This plan removes values from the beginning of a copy of array source as long as their corresponding reference values are equal to the first value in the reference array. The reference value for source[i] is defined as the value at index i in the specified reference array.

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}

Conditionally Trim Same Ending Values

Plan to trim when corresponding values from the end are equal to the corresponding end.

Description

This plan removes values from the end of a copy of array source as long as their corresponding reference values are equal to the last value in the reference array. The reference value for source[i] is defined as the value at index i in the specified reference array.

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}

Conditionally Keep Unique Values

Plan to keep when corresponding values are unique.

Description

This plan removes any value from a copy of array source when its corresponding reference value is repeated consecutively. The reference value for source[i] is defined as the value at index i in the specified reference array.

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}

Conditionally Keep Finite Values

Plan to keep when corresponding values are finite.

Description

This plan removes any value from a copy of array source when its corresponding reference value is equal to inf, -inf, or nan. The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

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

Union - Set Operation

Plan to apply a set union.

Description

This plan applies the set union x0x1x2 ⋃ ... to produce the output array. While this plan preserves the original order of values, repeated values are omitted.

Example

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

Intersection - Set Operation

Plan to apply a set intersection.

Description

This plan applies the set intersection x0x1x2 ⋂ ... to produce the output array. While this plan preserves the original order of values, repeated values are omitted.

Example

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

Exclusion - Set Operation

Plan to apply a set exclusion.

Description

This plan applies the set exclusion x - s0 - s1 - ... to produce the output array. While this plan preserves the original order of values, repeated values are omitted.

Example

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


Modify an Array

These plans produce an array by modifying another array.


Set Values From Start

Plan to set values at indices counted from the beginning.

Description

This plan sets, in a copy of array x, the value at index n[k] to c[k] for each k. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Set Values From End

Plan to set values at indices counted from the end.

Description

This plan sets, in a copy of array x, the value at reverse index n[k] to c[k] for each k. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead. Reverse indices traverse the array in reverse order.

Example

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

Set Ranges From Start

Plan to set values in index ranges counted from the beginning.

Description

This plan sets, in a copy of array x, the values at indices that fall within the ranges [a[k], b[k]) to c[k] for each k. The last values in a, b, and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Set Ranges From End

Plan to set values in index ranges counted from the end.

Description

This plan sets, in a copy of array x, the values at reverse indices that fall within the ranges [a[k], b[k]) to c[k] for each k. The last values in a, b, and c are used when k is out of bounds. If c is not specified, those values are removed instead. Reverse indices traverse the array in reverse order.

Example

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

Set After Position From Start

Plan to set values after a position counted from the beginning.

Description

This plan sets, in a copy of array x, the values at indices greater than or equal to n to c. If c is not specified, those values are removed instead.

Example

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

Set After Position From End

Plan to set values after a position counted from the end.

Description

This plan sets, in a copy of array x, the values at reverse indices greater than or equal to n to c. If c is not specified, those values are removed instead. Reverse indices traverse the array in reverse order.

Example

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

Set Before Position From Start

Plan to set values before a position counted from the beginning.

Description

This plan sets, in a copy of array x, the values at indices less than or equal to n to c. If c is not specified, those values are removed instead.

Example

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

Set Before Position From End

Plan to set values before a position counted from the end.

Description

This plan sets, in a copy of array x, the values at reverse indices less than or equal to n to c. If c is not specified, those values are removed instead. Reverse indices traverse the array in reverse order.

Example

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

Replace Values

Plan to replace values.

Description

This plan replaces, in a copy of array x, any values that are equal to a[k] with c[k] for each k. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Replace Ranges of Values

Plan to replace ranges of values.

Description

This plan replaces, in a copy of array x, any values that fall within the range [a[k], b[k]) with c[k] for each k. The last values in a, b, and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

x = {1,2,3,4,5,6};a = {1,3.2};b = {1,10};c = {0}{1,2,3,0,0,0}
x = {1,2,3,4,5,6};a = {3.2,-1};b = {10,2};c = {7,8,9}{8,2,3,7,7,7}
x = {1,2,3,4,5,6};a = {3.2,-1};b = {10,2};c = {}{2,3}

Replace Large Values

Plan to replace large values.

Description

This plan replaces, in a copy of array x, any values that are greater than or equal to a with c. For each index k, the copy of x[k] is replaced with c[k] if it is greater than or equal to a[k]. The last values in a and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Replace Small Values

Plan to replace small values.

Description

This plan replaces, in a copy of array x, any values that are less than or equal to a with c. For each index k, the copy of x[k] is replaced with c[k] if it is less than or equal to a[k]. The last values in a and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Replace Far Values

Plan to replace far values.

Description

This plan replaces, in a copy of array x, any values whose distance from o is greater than or equal to a with c. For each index k, the copy of x[k] is replaced with c[k] if the distance between x[k] and o[k] is greater than or equal to a[k]. The last values in o, a, and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Replace Close Values

Plan to replace close values.

Description

This plan replaces, in a copy of array x, any values whose distance from o is less than or equal to a with c. For each index k, the copy of x[k] is replaced with c[k] if the distance between x[k] and o[k] is less than or equal to a[k]. The last values in o, a, and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Replace Infinite Values

Plan to replace ±inf values.

Description

This plan replaces infinite values in a copy of array x with values from c. For each index k, the copy of x[k] is replaced with c[k] if it is equal to inf or -inf. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

x = {1,1/0,2,-inf};c = {0}{1,0,2,0}
x = {1,1/0,2,-inf};c = {}{1,2}

Replace NAN Values

Plan to replace nan values.

Description

This plan replaces NaN (not a number) values in a copy of array x with values from c. For each index k, the copy of x[k] is replaced with c[k] if it is equal to nan. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

x = {1,nan,2,nan,-inf};c = {0}{1,0,2,0,-inf}
x = {1,nan,2,nan,-inf};c = {0}{1,2,-inf}

Replace Non-Finite Values

Plan to replace non-finite values.

Description

This plan replaces non-finite values in a copy of array x with values from c. For each index k, the copy of x[k] is replaced with c[k] if it is equal to inf, -inf, or nan. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

x = {1,1/0,2,-inf};c = {0}{1,0,2,0}
x = {1,1/0,2,-inf};c = {0}{1,2}

Clean Values

Plan to zero small values.

Description

This plan replaces, in a copy of array x, any values whose magnitude is less than or equal to a with 0. For each index k, the copy of x[k] is replaced with 0 if its magnitude is less than or equal to a[k]. The last value in a is used when k is out of bounds.

Example

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

Clamp Values

Plan to limit values.

Description

This plan limits the values in a copy of array x to the range [a, b]. For each index k, the copy of x[k] is limited to [ a[k], b[k] ] by replacing values outside this range with the closest of a[k] or b[k]. The last values in a and b are used when k is out of bounds, and when they are not specified, the corresponding side of the bound is not checked.

Example

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

Discretize Values

Plan to discretize values.

Description

This plan replaces the values in a copy of array x with the corresponding close values from the array a when possible. For each index i, a[k] is copied to the output array if x[i] falls within the range [a[k]-δn[k], a[k]+δp[k]]. Otherwise, nan is copied to the output array. The last values in δn and δp are used when k is out of bounds.

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,nan,nan,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 Values Linearly - Factors

Plan to shift and scale values.

Description

This plan shifts and linearly scales all values in a copy of array x. The output values are computed as scale[k]×(x[k]+shift[k]) for each index k. The last values in shift and scale are used when k is out of bounds.

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 Values Linearly - Limits

Plan to linearly change the bounds of values.

Description

This plan shifts and linearly scales all values in a copy of array x so that they fall between a specified minimum and maximum.

Example

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

Scale Values Uniformly

Plan to uniformly change values.

Description

This plan uniformly, though not necessarily linearly, scales all values in a copy of array x such that a[k] is mapped to b[k] for each index k. This scaling interpolates each x[k] using a Lagrange polynomial derived from mapping the values in the array a to the corresponding values in the 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}

Modifying Expressions

Plan to compute values with expressions.

Description

This plan sets the values in an output array of length n by evaluating the expressions in f = {f[0],f[1],...}, where f[i] is a function of i, x, x0, x1, xp1, xn1, and so on. The output array is computed as f[i] for each index i<n, or as the last function in f if there is no corresponding f[i] available. In these expressions, i is the index starting from 0, and x is the value of the array x at that index. Fixed references are represented as x0=x[0], x1=x[1], and so on; relative references are represented as xp1=x[i-1], xn1=x[i+1], and so forth. Out-of-range values are replaced with 0. If the parameter n is not specified, it is set to the length of the array x.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and 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}

Value Magnitude

Plan to compute the magnitudes of values.

Description

This plan computes the non-negative value of x[k] for each index k to produce the output array.

Example

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

Value Sign Function

Plan to compute the sign function of each value.

Description

This plan computes the sign function of x[k] for each index k to produce the output array. The sign function of x is +1 when x is positive, -1 when x is negative, and 0 when x is zero.

Example

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

Polynomial Expression

Plan to compute the polynomial expressions of values.

Description

This plan computes the polynomial expression: a[0]+a[1]×x[k]+a[2]×x[k]2+... for each index k, to produce the output array.

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}

Fourier Expression

Plan to compute the Fourier expressions of values.

Description

This plan computes the sine-cosine Fourier expression: a[0]+a[1]×cos(2πx[k]/p)+b[1]×sin(2πx[k]/p)+a[2]×cos(2πx[k]×2/p)+... for each index k, to produce the output array. In this expression, p is the period, and b[0] is omitted.

Example

x = {0,1,2,3};p = {3};a = {0,1,1};b = {0,-1,1}{2,-2.73205,0.732051,2}

Fast Fourier Transform - Magnitude

Plan to apply a fast Fourier transform (magnitude).

Description

This plan computes the magnitudes of the coefficients of the fast Fourier transform of the array x to produce the output array.

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 Angle

Plan to apply a fast Fourier transform (phase angle).

Description

This plan computes the phase angles (in radians) of the coefficients of the fast Fourier transform of the array x to produce the output array.

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 Part

Plan to apply a fast Fourier transform (real part).

Description

This plan computes the real parts of the coefficients of the fast Fourier transform of the array x to produce the output array.

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 Part

Plan to apply a fast Fourier transform (imaginary part).

Description

This plan computes the imaginary parts of the coefficients of the fast Fourier transform of the array x to produce the output array.

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 Values - Min-Max

Plan to min-max normalize values.

Description

This plan normalizes a copy of array x by scaling each value as follows: (x[k]-min(x)) / (max(x)-min(x)), for each index k. After this normalization, the output values are constrained to the range [0, 1].

Example

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

Normalize Values - Mean

Plan to mean normalize values.

Description

This plan normalizes a copy of array x by scaling each value as follows: (x[k]-μ) / (max(x)-min(x)), for each index k. Here, μ is the arithmetic mean of the values in the array x. After this normalization, the output values are constrained to the range (-1, 1).

Example

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

Normalize Values - Z-Score

Plan to z-score normalize values.

Description

This plan computes the z-scores of the values in the array x, defined as (x[k]-μ)/σ for each index k, to produce the output array. Here, μ is the arithmetic mean and σ is the population standard deviation of the values in the array x.

Example

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

Normalize Values - P-Norm

Plan to normalize values to unit p-norm.

Description

This plan normalizes a copy of array x to have a unit p-norm by dividing each value by the p-norm of the array x. The norm parameter p can be any real number ≥1 or inf.

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 Array to Hyperplane

Plan to project onto a hyperplane as point.

Description

This plan finds the projection of the point specified by the array x onto the hyperplane in N-dimensional space defined by the equation a[0]x[0]+a[1]x[1]+...+a[N-1]x[N-1] = a[N]. The plane coefficients are given in the array a. The right-hand side of the plane equation is set to 0 when a[N] is out of range.

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 Array to Line

Plan to project onto a line as point.

Description

This plan finds the projection of the point specified by the array x onto the line defined by the 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}

Value Ceiling

Plan to calculate the ceiling of each value.

Description

This plan finds the smallest integer greater than or equal to x[k] for each index k to produce the output array.

Example

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

Value Floor

Plan to calculate the floor of each value.

Description

This plan finds the greatest integer less than or equal to x[k] for each index k to produce the output array.

Example

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

Value Round

Plan to round values.

Description

This plan finds the nearest integer to x[k] for each index k, rounding halfway cases away from zero, to produce the output array.

Example

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

Value Truncate

Plan to truncate values.

Description

This plan finds the integer part of x[k] for each index k to produce the output array.

Example

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

Value Negation

Plan to negate values.

Description

This plan applies the negation operator "-" to x[k] for each index k to produce the output array.

Example

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

Value Addition

Plan to add given values to array values.

Description

This plan computes x[k]+a[k] for each index k to produce the output array. The last value in a is used when k is out of bounds.

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}

Value Subtraction - Minuend

Plan to subtract given values from array values.

Description

This plan computes x[k]-a[k] for each index k to produce the output array. The last value in a is used when k is out of bounds.

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}

Value Subtraction - Subtracted

Plan to subtract array values from given values.

Description

This plan computes a[k]-x[k] for each index k to produce the output array. The last value in a is used when k is out of bounds.

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}

Value Multiplication

Plan to multiply array values by given values.

Description

This plan computes x[k]×a[k] for each index k to produce the output array. The last value in a is used when k is out of bounds.

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}

Value Division - Numerator

Plan to divide array values by given values.

Description

This plan computes x[k]/a[k] for each index k to produce the output array. The last value in a is used when k is out of bounds.

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}

Value Division - Denominator

Plan to divide given values by array values.

Description

This plan computes a[k]/x[k] for each index k to produce the output array. The last value in a is used when k is out of bounds.

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}

Value Square

Plan to compute the square of each value.

Description

This plan computes the square of x[k] for each index k to produce the output array.

Example

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

Value Square Root

Plan to compute the square root of each value.

Description

This plan computes the square root of x[k] for each index k to produce the output array.

Example

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

Value Exponentiation - Base

Plan to raise array values to the power of given values.

Description

This plan computes c[k]×x[k]a[k] for each index k to produce the output array. The last values in a and c are used when k is out of bounds.

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}

Value Exponentiation - Exponent

Plan to raise given values to the power of array values.

Description

This plan computes c[k]×a[k]x[k] for each index k to produce the output array. The last values in a and c are used when k is out of bounds.

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}

Value Exponential Function

Plan to compute the exponential function of each value.

Description

This plan computes the exponential function of x[k] as c[k]×ea[k]x[k] for each index k to produce the output array. The last values in a and c are used when k is out of bounds.

Example

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

Value Logarithm

Plan to compute the logarithm of each value.

Description

This plan computes the natural logarithm of x[k] as c[k]×log(x[k]+a[k]) for each index k to produce the output array. The last values in a and c are used when k is out of bounds.

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}

Value Logistic Function

Plan to compute the logistic function of each value.

Description

This plan computes the logistic function of x[k] as 1/(1+e-x[k]) for each index k to produce the output array.

Example

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

Value Logit Function

Plan to compute the logit function of each value.

Description

This plan computes the inverse logistic (logit) function of x[k] as log(x[k] / (1-x[k])) for each index k to produce the output array.

Example

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

Value Sine

Plan to compute the sine of each value.

Description

This plan computes the sine of x[k] as c[k]×sin(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{0,0.841471,0,-1}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{0,-0.909297,0,0}

Value Cosine

Plan to compute the cosine of each value.

Description

This plan computes the cosine of x[k] as c[k]×cos(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{1,0.540302,-1,0}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{1,0.416147,-1,1}

Value Tangent

Plan to compute the tangent of each value.

Description

This plan computes the tangent of x[k] as c[k]×tan(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{0,1.55741,0,-inf}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{0,2.18504,0,0}

Value Cotangent

Plan to compute the cotangent of each value.

Description

This plan computes the cotangent of x[k] as c[k]×cot(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{inf,0.642093,-inf,0}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{inf,0.457658,inf,-inf}

Value Secant

Plan to compute the secant of each value.

Description

This plan computes the secant of x[k] as c[k]×sec(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{1,1.85082.0,-1,inf}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{1,2.403,-1,1}

Value Cosecant

Plan to compute the cosecant of each value.

Description

This plan computes the cosecant of x[k] as c[k]×csc(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

x = {0,1,pi,-pi/2};a = {1};b = {0};c = {1}{inf,1.1884,inf,-1}
x = {0,1,pi,-pi/2};a = {1,2};b = {0};c = {1,-1}{inf,-1.09975,inf,inf}

Value Inverse Sine

Plan to compute the inverse sine of each value.

Description

This plan computes the inverse sine of x[k] as c[k]×sin-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

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}

Value Inverse Cosine

Plan to compute the inverse cosine of each value.

Description

This plan computes the inverse cosine of x[k] as c[k]×cos-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

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}

Value Inverse Tangent

Plan to compute the inverse tangent of each value.

Description

This plan computes the inverse tangent of x[k] as c[k]×tan-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

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}

Value Inverse Cotangent

Plan to compute the inverse cotangent of each value.

Description

This plan computes the inverse cotangent of x[k] as c[k]×cot-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

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}

Value Inverse Secant

Plan to compute the inverse secant of each value.

Description

This plan computes the inverse secant of x[k] as c[k]×sec-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

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}

Value Inverse Cosecant

Plan to compute the inverse cosecant of each value.

Description

This plan computes the inverse cosecant of x[k] as c[k]×csc-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

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}

Value Hyperbolic Sine

Plan to compute the hyperbolic sine of each value.

Description

This plan computes the hyperbolic sine of x[k] as c[k]×sinh(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Hyperbolic Cosine

Plan to compute the hyperbolic cosine of each value.

Description

This plan computes the hyperbolic cosine of x[k] as c[k]×cosh(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Hyperbolic Tangent

Plan to compute the hyperbolic tangent of each value.

Description

This plan computes the hyperbolic tangent of x[k] as c[k]×tanh(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Hyperbolic Cotangent

Plan to compute the hyperbolic cotangent of each value.

Description

This plan computes the hyperbolic cotangent of x[k] as c[k]×coth(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Hyperbolic Secant

Plan to compute the hyperbolic secant of each value.

Description

This plan computes the hyperbolic secant of x[k] as c[k]×sech(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Hyperbolic Cosecant

Plan to compute the hyperbolic cosecant of each value.

Description

This plan computes the hyperbolic cosecant of x[k] as c[k]×csch(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Inverse Hyperbolic Sine

Plan to compute the inverse hyperbolic sine of each value.

Description

This plan computes the inverse hyperbolic sine of x[k] as c[k]×sinh-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Inverse Hyperbolic Cosine

Plan to compute the inverse hyperbolic cosine of each value.

Description

This plan computes the inverse hyperbolic cosine of x[k] as c[k]×cosh-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Inverse Hyperbolic Tangent

Plan to compute the inverse hyperbolic tangent of each value.

Description

This plan computes the inverse hyperbolic tangent of x[k] as c[k]×tanh-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Inverse Hyperbolic Cotangent

Plan to compute the inverse hyperbolic cotangent of each value.

Description

This plan computes the inverse hyperbolic cotangent of x[k] as c[k]×coth-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Inverse Hyperbolic Secant

Plan to compute the inverse hyperbolic secant of each value.

Description

This plan computes the inverse hyperbolic secant of x[k] as c[k]×sech-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Inverse Hyperbolic Cosecant

Plan to compute the inverse hyperbolic cosecant of each value.

Description

This plan computes the inverse hyperbolic cosecant of x[k] as c[k]×csch-1(a[k]×x[k]+b[k]) for each index k to produce the output array. The last values in a, b, and c are used when k is out of bounds.

Example

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

Value Sinc Function

Plan to compute the normalized sinc function of each value.

Description

This plan computes the normalized sinc function of x[k] as sin(πx[k]) / (πx[k]), with sinc(0)=1, for each index k to produce the output array.

Example

x = {0,-1,0.5,2}{1,0,0.63662,0}

Value Variation

Plan to compute the change in values.

Description

This plan computes the change in values as x[k]-x[k-1] for each positive index k, and as 0 when k is zero, to produce the output array.

Example

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

Value Variation Ratio

Plan to compute the relative change in values.

Description

This plan computes the relative change in values as (x[k]-x[k-1]) / x[k-1] for each positive index k, and as 1 when k is zero, to produce the output array.

Example

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

Sliding Count of Values

Plan to count values.

Description

This plan counts the number of values in the array x. The result at index i is the number of values in x either from the beginning of x up to and including x[i] (i.e. i+1), or, when the parameter w is specified, within the sliding window of size w preceding and including x[i].

Example

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

Sliding Count of Value Occurrences

Plan to count occurrences of given values.

Description

This plan counts the number of values in the array x that are equal to any of the values in the array a. The result at index i is the number of values in x that match any value in a, either from the beginning of x up to and including x[i], or, when the parameter w is specified, within the sliding window of size w preceding and including x[i].

Example

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

Sliding Count of Values Inside Ranges

Plan to count values in given ranges.

Description

This plan counts the number of values in the array x that fall within any of the ranges [a[k], b[k]). The result at index i is the number of values in x that fall within any of these ranges, either from the beginning of x up to and including x[i], or, when the parameter w is specified, within the sliding window of size w preceding and including x[i].

Example

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

Sliding Count of Finite Values

Plan to count finite values.

Description

This plan counts the number of finite values in the array x. The result at index k is the number of finite values in x, either from the beginning of x up to and including x[k], or, when the parameter w is specified, within the sliding window of size w preceding and including x[k]. Non-finite values are inf, -inf, and nan.

Example

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

Sliding Minimum in Array

Plan to find minimum values.

Description

This plan finds the minimum value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the minimum value within the sliding window of size w preceding and including x[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}
x = {1,3,3,3,3,1,1,3};w = {4}{1,1,1,1,3,1,1,1}

Index of Sliding Minimum in Array

Plan to find the indices of minimum values.

Description

This plan finds the index of the first occurrence of the minimum value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the minimum value within the sliding window of size w preceding and including x[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}
x = {1,3,3,3,3,1,1,3};w = {4}{0,0,0,0,1,5,5,5}

Sliding Maximum in Array

Plan to find maximum values.

Description

This plan finds the maximum value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the maximum value within the sliding window of size w preceding and including x[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}
x = {1,3,3,3,3,1,1,3};w = {4}{1,3,3,3,3,3,3,3}

Index of Sliding Maximum in Array

Plan to find the indices of sliding maximum values.

Description

This plan finds the index of the first occurrence of the maximum value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the maximum value within the sliding window of size w preceding and including x[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}
x = {1,3,3,3,3,1,1,3};w = {4}{0,1,1,1,1,2,3,4}

Sliding Minimum Magnitude in Array

Plan to find minimum magnitude values.

Description

This plan finds the minimum magnitude value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the minimum magnitude value within the sliding window of size w preceding and including x[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}
x = {1,3,-3,3,-3,1,-1,3};w = {4}{1,1,1,1,3,1,1,1}

Index of Sliding Minimum Magnitude in Array

Plan to find the indices of minimum magnitude values.

Description

This plan finds the index of the first occurrence of the minimum magnitude value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the minimum magnitude value within the sliding window of size w preceding and including x[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}
x = {1,3,-3,3,-3,1,-1,3};w = {4}{0,0,0,0,1,5,5,5}

Sliding Maximum Magnitude in Array

Plan to find maximum magnitude values.

Description

This plan finds the maximum magnitude value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the maximum magnitude value within the sliding window of size w preceding and including x[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}
x = {1,3,-3,3,-3,1,-1,3};w = {4}{1,3,3,3,3,3,3,3}

Index of Sliding Maximum Magnitude in Array

Plan to find the indices of maximum magnitude values.

Description

This plan finds the index of the first occurrence of the maximum magnitude value among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the maximum magnitude value within the sliding window of size w preceding and including x[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}
x = {1,3,-3,3,-3,1,-1,3};w = {4}{0,1,1,1,1,2,3,4}

Sliding Arithmetic Mean in Array

Plan to compute arithmetic means.

Description

This plan computes the arithmetic mean, defined as

Sum(x[i]) / N,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the arithmetic mean within the sliding window of size w preceding and including x[k]. Here, N is the number 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}

Sliding Geometric Mean in Array

Plan to compute geometric means.

Description

This plan computes the geometric mean, defined as

Product(|x[i]|)1/N,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the geometric mean within the sliding window of size w preceding and including x[k]. Here, N is the number 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}

Sliding Harmonic Mean in Array

Plan to compute harmonic means.

Description

This plan computes the harmonic mean, defined as

N / Sum(1/x[i]),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the harmonic mean within the sliding window of size w preceding and including x[k]. Here, N is the number 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}

Sliding Weighted Mean in Array

Plan to compute weighted means.

Description

This plan computes the weighted mean, defined as

(x[0]+2×x[1]+...+N×x[N-1]) / (½N(N+1)),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the weighted mean within the sliding window of size w preceding and including x[k]. Here, N is the number 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}

Sliding Custom Weighted Mean in Array

Plan to compute custom weighted means.

Description

This plan computes the custom weighted mean, defined as

(a[0]×x[k]+a[1]×x[k-1]+...) / (a[0]+a[1]+...),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the custom weighted mean within the sliding window of size w preceding and including x[k]. The custom weights are given in the array a.

Example

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

Sliding Exponentially Weighted Mean in Array

Plan to compute exponentially weighted means.

Description

This plan computes the sliding exponentially weighted mean, or exponential moving average (EMA), defined as

EMA[k] = αx[k] + (1-α)EMA[k-1],

for each index k, to produce the output array. Here, α 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}

Sliding Median in Array

Plan to find medians.

Description

This plan finds the median, defined as the smallest value at or below which half of the values fall, among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the median within the sliding window of size w preceding and including x[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}
x = {1,0,0,1,2,2,2,2};w = {3}{1,0,0,0,1,2,2,2}

Index of Sliding Median in Array

Plan to find the indices of medians.

Description

This plan finds the index of the first occurrence of the median among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the median within the sliding window of size w preceding and including x[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}
x = {1,0,0,1,2,2,2,2};w = {3}{0,1,1,1,3,4,4,5}

Sliding Mode in Array

Plan to find modes.

Description

This plan finds the mode, defined as the most frequent value, among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the mode within the sliding window of size w preceding and including x[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}
x = {1,0,0,1,2,2,2,2};w = {3}{1,1,0,0,0,2,2,2}

Index of Sliding Mode in Array

Plan to find the indices of modes.

Description

This plan finds the index of the first occurrence of the mode among the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the mode within the sliding window of size w preceding and including x[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}
x = {1,0,0,1,2,2,2,2};w = {3}{0,0,1,1,2,4,4,5}

Sliding Range in Array

Plan to compute ranges.

Description

This plan computes the range, defined as the difference between the minimum and maximum values, over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the range within the sliding window of size w preceding and including x[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}

Sliding Root Mean Square in Array

Plan to compute root mean squares.

Description

This plan computes the root mean square, defined as

√{Sum(x[i]2) / N},

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the root mean square within the sliding window of size w preceding and including x[k]. Here, N is the number 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}

Sliding Moment in Array

Plan to compute moments.

Description

This plan computes the moment, defined as

Sum(x[i]p) / N,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the moment within the sliding window of size w preceding and including x[k]. Here, N is the number 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}

Sliding Central Moment in Array

Plan to compute central moments.

Description

This plan computes the central moment, defined as

Sum((x[i]-μ)p) / N,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the central moment within the sliding window of size w preceding and including x[k]. Here, μ is the arithmetic mean and N is the number 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}

Sliding Standardized Moment in Array

Plan to compute standardized moments.

Description

This plan computes the standardized moment, defined as

Sum((x[i]-μ)p) / (σpN),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the standardized moment within the sliding window of size w preceding and including x[k]. Here, μ is the arithmetic mean, σ is the population standard deviation, and N is the number 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}

Sliding Standard Deviation in Array - Sample

Plan to compute sample standard deviations.

Description

This plan computes the sample standard deviation, defined as

√{Sum((x[i]-μ)2) / (N-1)},

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the sample standard deviation within the sliding window of size w preceding and including x[k]. Here, μ is the arithmetic mean and N is the number 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}

Sliding Standard Deviation in Array - Population

Plan to compute population standard deviations.

Description

This plan computes the population standard deviation, defined as

√{Sum((x[i]-μ)2) / N},

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the population standard deviation within the sliding window of size w preceding and including x[k]. Here, μ is the arithmetic mean and N is the number 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}

Sliding Variance in Array - Sample

Plan to compute sample variances.

Description

This plan computes the sample (unbiased) variance, defined as

Sum((x[i]-μ)2) / (N-1),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the sample variance within the sliding window of size w preceding and including x[k]. Here, μ is the arithmetic mean and N is the number 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}

Sliding Variance in Array - Population

Plan to compute population variances.

Description

This plan computes the population (biased) variance, defined as

Sum((x[i]-μ)2) / N,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the population variance within the sliding window of size w preceding and including x[k]. Here, μ is the arithmetic mean and N is the number 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}

Sliding Skewness in Array - Sample

Plan to compute sample skewness measures.

Description

This plan computes the sample skewness measure (the adjusted Fisher–Pearson standardized moment coefficient), defined as

G1[k] = m3/m21.5×{√[N(N-1)]} / (N-2),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the sample skewness measure within the sliding window of size w preceding and including x[k]. Here, mp is the p-th central moment and N is the number 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}

Sliding Skewness in Array - Population

Plan to compute population skewness measures.

Description

This plan computes the population skewness measure, defined as

g1[k] = m3/m21.5,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the population skewness measure within the sliding window of size w preceding and including x[k]. Here, 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}

Sliding Kurtosis in Array - Sample

Plan to compute sample excess kurtosis measures.

Description

This plan computes the sample excess kurtosis measure, defined as

G2[k] = {(N-1) / [(N-2)(N-3)]} {(N+1)m4/m22-3N+3},

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the sample excess kurtosis measure within the sliding window of size w preceding and including x[k]. Here, mp is the p-th central moment and N is the number 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}

Sliding Kurtosis in Array - Population

Plan to compute population excess kurtosis measures.

Description

This plan computes the population excess kurtosis measure, defined as

g2[k] = m4/m22-3,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the population excess kurtosis measure within the sliding window of size w preceding and including x[k]. Here, 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}

Sliding Crest Factor in Array

Plan to compute crest factors.

Description

This plan computes the crest factor, defined as the maximum magnitude divided by the root mean square of the values, over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the crest factor within the sliding window of size w preceding and including x[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}

Sliding Percentile in Array

Plan to find percentiles.

Description

This plan finds the k-th percentile, defined as the smallest value at or below which k percent (k=1.0 for 100%) of the values fall, among the values from the beginning of the array x up to and including x[i] for each index i, to produce the output array. Alternatively, when the parameter w is specified, it finds the k-th percentile within the sliding window of size w preceding and including x[i].

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}
x = {1,0,0,1,2,2,2,2};k = {0.7};w = {3}{1,1,1,1,2,2,2,2}

Index of Sliding Percentile in Array

Plan to find the indices of percentiles.

Description

This plan finds the index of the first occurrence of the k-th percentile among the values from the beginning of the array x up to and including x[i] for each index i, to produce the output array. Alternatively, when the parameter w is specified, it finds the index of the first occurrence of the k-th percentile within the sliding window of size w preceding and including x[i].

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}
x = {1,0,0,1,2,2,2,2};k = {0.7};w = {3}{0,0,0,3,4,4,4,5}

Sliding Sum in Array

Plan to compute sums.

Description

This plan computes the sum of values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the sum within the sliding window of size w preceding and including x[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}

Sliding Product in Array

Plan to compute products.

Description

This plan computes the product of values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the product within the sliding window of size w preceding and including x[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}

Sliding Integral in Array

Plan to compute integrals.

Description

This plan computes the integral of values using the trapezoidal rule, defined as

{Sum(x[i]) - 0.5x[first] - 0.5x[last]}×Δx,

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the integral within the sliding window of size w preceding and including x[k].

Example

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

Sliding Sum of Powers in Array

Plan to compute the sums of powers.

Description

This plan computes the sum of the powers of values, defined as

Sum(x[i]p),

over the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the sum of powers within the sliding window of size w preceding and including x[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}

Sliding Norm in Array

Plan to compute p-norms.

Description

This plan computes the p-norm of the values from the beginning of the array x up to and including x[k] for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the p-norm within the sliding window of size w preceding and including x[k]. The norm parameter p can be any real number ≥1 or inf.

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 = {inf};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}

Flatten Based on Value

Plan to flatten spikes based on their value.

Description

This plan flattens, in a copy of array x, any peaks (values greater than their neighboring values) or valleys (values less than their neighboring values) whose deviation from both 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}

Flatten Based on Ratio

Plan to flatten spikes based on their ratio.

Description

This plan flattens, in a copy of array x, any peaks (values greater than their neighboring values) or valleys (values less than their neighboring values) whose deviation from both neighboring values is greater than a times their own 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}

Flatten Based on Residual

Plan to flatten values based on their residual.

Description

This plan flattens, in a copy of array x, any values whose deviation from the 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}

Flatten Based on Residual Ratio

Plan to flatten values based on their residual ratio.

Description

This plan flattens, in a copy of array x, any values whose deviation from the 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}

Flatten Based on Z-Score

Plan to flatten values based on their standard score.

Description

This plan flattens, in a copy of array x, any values whose deviation from the 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,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

Plan to apply a low-pass Butterworth filter.

Description

This plan applies a digital second-order low-pass Butterworth filter n times, with a timestep T and a cutoff frequency fc, to the array x to produce the output array. Every other application of the filter is performed in reverse. Filter warping is implemented according to SAE J211. Setting n=2 generates a 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

Plan to apply a high-pass Butterworth filter.

Description

This plan applies a digital second-order high-pass Butterworth filter n times, with a timestep T and a cutoff frequency fc, to the array x to produce the output array. Every other application of the filter is performed in reverse. Filter warping is implemented according to 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

Plan to apply a digital first-order filter.

Description

This plan applies a digital first-order filter, defined as

H(s) = (b₀s+b₁) / (a₀s+a₁),

to the array x a total of n times to produce the output array. T is the step size and f₀ is the warping frequency at which the digital and analog filters agree. Every other application of the filter is performed in reverse.

Example

x = {1,1,1,0,0,0};T = {1};f₀ = {0.1};a₀ = {1};a₁ = {1};b₀ = {0};b₁ = {1};n = {1}{1,1,1,0.659141,0.209793,0.0667734}
x = {1,1,1,0,0,0};T = {1};f₀ = {0.1};a₀ = {1};a₁ = {1};b₀ = {0};b₁ = {1};n = {2}{0.966722,0.895446,0.671506,0.332953,0.115523,0.0667734}

Second-Order Filter

Plan to apply a digital second-order filter.

Description

This plan applies a digital second-order filter, defined as

H(s) = (b₀s2+b₁s+b₂) / (a₀s2+a₁s+a₂),

to the array x a total of n times to produce the output array. T is the step size and f₀ is the warping frequency at which the digital and analog filters agree. Every other application of the filter is performed in reverse.

Example

x = {1,1,1,0,0,0};T = {1};f₀ = {0.1};a₀ = {1};a₁ = {sqrt(2)};a₂ = {1};b₀ = {0};b₁ = {0};b₂ = {1};n = {1}{1,1,1,0.866207,0.500544,0.13459}
x = {1,1,1,0,0,0};T = {1};f₀ = {0.1};a₀ = {1};a₁ = {sqrt(2)};a₂ = {1};b₀ = {0};b₁ = {0};b₂ = {1};n = {2}{1.01777,0.896842,0.651823,0.366291,0.183552,0.13459}

Check Values - Equality

Plan to check the equality of values.

Description

This plan sets the output array at index k to the pass flag p[k] if all values up to and including the k-th value in the array x are equal to one another; otherwise, it sets the output array at index k to the fail flag f[k]. The last values in p and f are used when k is out of bounds. When p or f is not specified, the flagged values are removed instead.

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 Values - Ascending Order

Plan to check the ascending order of values.

Description

This plan sets the output array at index k to the pass flag p[k] if all values up to and including the k-th value in the array x are in ascending order; otherwise, it sets the output array at index k to the fail flag f[k]. The last values in p and f are used when k is out of bounds. When p or f is not specified, the flagged values are removed instead.

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 Values - Descending Order

Plan to check the descending order of values.

Description

This plan sets the output array at index k to the pass flag p[k] if all values up to and including the k-th value in the array x are in descending order; otherwise, it sets the output array at index k to the fail flag f[k]. The last values in p and f are used when k is out of bounds. When p or f is not specified, the flagged values are removed instead.

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

Plan to optimize with Simulated Annealing (SA) algorithm.

Description

This plan minimizes x[0] using the Simulated Annealing algorithm with an exponential cooling schedule. Like other optimizer plans, it repeatedly reads from and updates its output array. The optimization input has a length of n. For each iteration, this input array can be extracted using the Array Plans/Rearrange an Array/Optimizer - Iteration Input plan.

This plan is configured with several parameters: maxIters specifies the maximum number of allowed iterations; initT is the Initial temperature; initMoves is the number of initial iterations without changing the temperature; moveCtrlSweep is the number of sweeps per feedback move control; tol is the tolerance for considering the system frozen; maxTolSweep is the maximum number of sweeps below the tolerance before the system is considered 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 rate.

A typical implementation of an optimization cycle is as follows: array 0 (initial input) and array 1 (next iteration input) → conditionally select array 1 → update x with the next iteration input → update the optimizer array → update array 1 (by partitioning the optimizer array). Repeat the last four steps.

Example

x = {1};n = {4}...

CNE Optimizer

Plan to optimize with Conventional Neural Evolution (CNE) algorithm.

Description

This plan minimizes x[0] using the Conventional Neural Evolution algorithm, which creates new generations through mutation and crossover. Like other optimizer plans, it repeatedly reads from and updates its output array. The optimization input has a length of n. For each iteration, this input array can be extracted using the Array Plans/Rearrange an Array/Optimizer - Iteration Input plan.

This plan is configured with several parameters: popSize specifies the number of candidates in the population (≥4); maxGens is the maximum number of allowed generations; mutProb is the probability that a weight will be mutated; mutSize is the upper bound of the added mutation noise; and selPercent is the percentage of candidates selected to become the next generation. tol is the target value of the objective function for termination; if set to a negative value, tolerance is not used.

A typical implementation of an optimization cycle is as follows: array 0 (initial input) and array 1 (next iteration input) → conditionally select array 1 → update x with the next iteration input → update the optimizer array → update array 1 (by partitioning the optimizer array). Repeat the last four steps.

Example

x = {1};n = {4}...

DE Optimizer

Plan to optimize with Differential Evolution (DE) algorithm.

Description

This plan minimizes x[0] using the Differential Evolution algorithm, which creates new generations through mutation and crossover. Like other optimizer plans, it repeatedly reads from and updates its output array. The optimization input has a length of n. For each iteration, this input array can be extracted using the Array Plans/Rearrange an Array/Optimizer - Iteration Input plan.

This plan is configured with several parameters: popSize specifies the number of candidates in the population (≥3); maxGens is the maximum number of allowed generations; crossoverRate is the probability that a candidate will undergo crossover; and diffWeight is the amplification factor for differentiation. tol is the target value of the objective function for termination; if set to a negative value, tolerance is not used.

A typical implementation of an optimization cycle is as follows: array 0 (initial input) and array 1 (next iteration input) → conditionally select array 1 → update x with the next iteration input → update the optimizer array → update array 1 (by partitioning the optimizer array). Repeat the last four steps.

Example

x = {1};n = {4}...

PS Optimizer

Plan to optimize with Particle Swarm (PS) algorithm.

Description

This plan minimizes x[0] using the Particle Swarm algorithm, in which the particles share fitness information to collectively approach the global optimum. Like other optimizer plans, it repeatedly reads from and updates its output array. The optimization input has a length of n. For each iteration, this input array can be extracted using the Array Plans/Rearrange an Array/Optimizer - Iteration Input plan.

This plan is configured with several parameters: numParticles specifies the number of particles in the swarm; lBound is the lower bound of the coordinates for the initial population; uBound is the upper bound of the coordinates for the initial population; maxIters is the maximum number of allowed iterations; and horizonSize is the size of the look-back horizon for computing improvement. tol is the target value of the objective function for termination; if set to a negative value, tolerance is not used. The exploit factor controls the influence of a particle’s personal best, and the explore factor controls the influence of neighboring particles.

A typical implementation of an optimization cycle is as follows: array 0 (initial input) and array 1 (next iteration input) → conditionally select array 1 → update x with the next iteration input → update the optimizer array → update array 1 (by partitioning the optimizer array). Repeat the last four steps.

Example

x = {1};n = {4}...

SPSA Optimizer

Plan to optimize with Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm.

Description

This plan minimizes x[0] using the Simultaneous Perturbation Stochastic Approximation algorithm with gradient approximation. Like other optimizer plans, it repeatedly reads from and updates its output array. The optimization input has a length of n. For each iteration, this input array can be extracted using the Array Plans/Rearrange an Array/Optimizer - Iteration Input plan.

This plan is configured with several parameters: α specifies the scaling exponent for the step size; γ is the scaling exponent for the evaluation step size; stepSize is the scaling parameter for the step size; evalStepSize is the scaling parameter for the evaluation step size; and maxIters is the maximum number of allowed iterations (0 means no limit). tol is the maximum absolute required tolerance to terminate the algorithm.

A typical implementation of an optimization cycle is as follows: array 0 (initial input) and array 1 (next iteration input) → conditionally select array 1 → update x with the next iteration input → update the optimizer array → update array 1 (by partitioning the optimizer array). Repeat the last four steps.

Example

x = {1};n = {4}...


Modify Multiple Arrays

These plans produce an array by modifying multiple arrays.


Conditionally Replace Values

Plan to replace when corresponding values match given values.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value is equal to a[k] with c[k] for each k. The last values in a and c are used when k is out of bounds. If c is not specified, those values are removed instead. The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

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

Conditionally Replace Ranges of Values

Plan to replace when corresponding values fall in given ranges.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value falls within the range [a[k], b[k]) with c[k] for each k. The last values in a, b, and c are used when k is out of bounds. If c is not specified, those values are removed instead. The reference value for source[i] is defined as the value at index i in the specified reference array.

Example

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

Conditionally Replace Large Values

Plan to replace when corresponding values are large.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value is greater than or equal to a, with c. For each index k, the copy of source[k] is replaced with c[k] if its reference value, reference[k], is greater than or equal to a[k]. The last values in a and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Conditionally Replace Small Values

Plan to replace when corresponding values are small.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value is less than or equal to a, with c. For each index k, the copy of source[k] is replaced with c[k] if its reference value, reference[k], is less than or equal to a[k]. The last values in a and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Conditionally Replace Far Values

Plan to replace when corresponding values are far.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value has a distance from o greater than or equal to a, with c. For each index k, the copy of source[k] is replaced with c[k] if the distance between reference[k] and o[k] is greater than or equal to a[k]. The last values in o, a, and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Conditionally Replace Close Values

Plan to replace when corresponding values are close.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value has a distance from o less than or equal to a, with c. For each index k, the copy of source[k] is replaced with c[k] if the distance between reference[k] and o[k] is less than or equal to a[k]. The last values in o, a, and c are used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Conditionally Replace Infinite Values

Plan to replace when corresponding values are equal to ±inf.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value is equal to inf or -inf with c. For each index k, the copy of source[k] is replaced with c[k] if reference[k] is equal to inf or -inf. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

source = {6,5,4,3,2};reference = {1,inf,2,-inf};c = {0}{6,0,4,0,2}
source = {6,5,4,3,2};reference = {1,inf,2,-inf};c = {}{6,4,2}

Conditionally Replace NAN Values

Plan to replace when corresponding values are equal to nan.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value is equal to nan with c. For each index k, the copy of source[k] is replaced with c[k] if reference[k] is equal to nan. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

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

Conditionally Replace Non-Finite Values

Plan to replace when corresponding values are not finite.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value is equal to inf, -inf, or nan with c. For each index k, the copy of source[k] is replaced with c[k] if reference[k] is equal to inf, -inf, or nan. The last value in c is used when k is out of bounds. If c is not specified, those values are removed instead.

Example

source = {6,5,4,3,2};reference = {1,nan,2,-inf};c = {0}{6,0,4,0,2}
source = {6,5,4,3,2};reference = {1,nan,2,-inf};c = {0}{6,4,2}

Conditionally Clean Values

Plan to zero when corresponding values are small.

Description

This plan replaces, in a copy of array source, any values whose corresponding reference value has a magnitude less than or equal to a with 0. For each index k, the copy of source[k] is replaced with 0 if the magnitude of reference[k] is less than or equal to a[k]. The last value in a is used when k is out of bounds.

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 Across Arrays

Plan to compute the linear combinations of values across arrays.

Description

This plan linearly combines values across multiple arrays, defined as

a[0]+a[1]×x0[k]+a[2]×x1[k]+...,

for each index k to produce the output array. The output array is as large as the largest xi array. Out-of-range values in these arrays are replaced with their last available values.

Example

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

Simple Expression Across Arrays

Plan to compute values with an expression of values across arrays.

Description

This plan evaluates the expression f(i,x0,x1,...,x20) for each index i to produce the values of the output array. In this expression, i is the index, starting from 0. x0 is the value of the array x0 at index i, x1 is the value of the array x1 at the same position, and so on. This plan can process up to 21 arrays, using an expression of the values at the same position across the arrays. The output array is as large as the largest xi array. Out-of-range values in these arrays are replaced with their last available values.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and 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}
f = {1+i+x0-2*x1+x2};x0 = {1,-1,1,-1};x1 = {3}x2 = {6}{2,1,4,3}

Expressions Across Arrays

Plan to compute values with expressions of values across arrays.

Description

This plan evaluates the expressions in f = {f[0],f[1],...} to produce the values of the output array. Here, f[i] is a function of i, x, y, z, u, v, w, x0, xp1, xn1, yp1, yn1, and so on. The output array is computed as f[i] for each index i, or as the last available function in f if there is no corresponding f[i]. In these expressions, i is the index, starting from 0. x, y, z, u, v, and w are the values of the arrays x, y, z, u, v, and w, respectively, at the same index across the arrays. Fixed references are represented as x0=x[0], x1=x[1], and so on; relative references are represented as xp1=x[i-1], xn1=x[i+1], and so forth. The output array is as large as the largest xi array. Out-of-range values are replaced with 0.

The expression parser supports the following:

  • Arithmetic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), exponentiation (^), and modulus (%).
  • Basic operations: abs, ceil, floor, trunc, and round.
  • Error and gamma functions: erf, erfc, and gamma.
  • Exponentiation functions: exp, pow, and sqrt.
  • Combinatorial functions: fac, ncr, and npr.
  • Logarithmic functions: exp, ln (natural logarithm), log (base-10 logarithm), and log10.
  • Trigonometric functions: sin, cos, tan, asin, acos, atan, and atan2.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and 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

Plan to compute the cross product of two arrays.

Description

This plan computes the vector cross product of two given arrays, x and y, as follows: {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

Plan to compute the full convolution of two arrays.

Description

This plan computes the full convolution of two given arrays, x and y, defined as

x[k]×y[0]+x[k-1]×y[1]+x[k-2]×y[2]+...,

for 0≤k<Nx+Ny-1. Here, Nx and Ny are the lengths of the arrays x and y, respectively.

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

Plan to compute the central convolution of two arrays.

Description

This plan computes the central part of the convolution of two given arrays, x and y, defined as

x[k]×y[0]+x[k-1]×y[1]+x[k-2]×y[2]+...,

for Ny/2≤k<Nx+Ny/2. Here, Nx and Ny are the lengths of the arrays x and y, respectively.

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

Plan to interpolate to the nearest neighbor.

Description

This plan interpolates the values in the array x to their nearest neighbor in the array x₀ to produce the output array. Each x[k] is mapped to a y₀ value that corresponds to the nearest x₀ value. Out-of-range values are mapped to nan.

Example

x = {1,-1.4,3};x₀ = {1,2,-1,-2};y₀ = {1,2,0,-3}{1,0,nan}

Interpolate Linearly

Plan to interpolate linearly between the nearest neighbors.

Description

This plan interpolates the values in the array x linearly between their nearest neighbors in the array x₀ to produce the output array. Each x[k] is mapped to a line segment between two nearest x₀ values as x-coordinates and their corresponding y₀ values as y-coordinates. Out-of-range values are mapped to nan.

Example

x = {1,-1.4,3};x₀ = {1,2,-1,-2};y₀ = {1,2,0,-3}{1,-1.2,nan}

Count of Values Across Arrays

Plan to count values across arrays.

Description

This plan counts the number of values across multiple arrays. The result at index i is the number of values at index i in the arrays x0, x1, etc.

Example

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

Count of Value Occurrences Across Arrays

Plan to count occurrences of given values across arrays.

Description

This plan counts the number of values across multiple arrays that are equal to any of the values in the array a. The result at index i is the number of values at index i in the arrays x0, x1, etc. that match any value in a.

Example

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

Count of Values Inside Ranges Across Arrays

Plan to count values in given ranges across arrays.

Description

This plan counts the number of values across multiple arrays that fall within any of the ranges [a[k], b[k]). The result at index i is the number of values at index i in the arrays x0, x1, etc. that fall within any of these ranges.

Example

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

Count of Finite Values Across Arrays

Plan to count finite values across arrays.

Description

This plan counts the number of finite values across multiple arrays. The result at index i is the number of finite values at index i in the arrays x0, x1, etc. Non-finite values are inf, -inf, and nan.

Example

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

Sliding Correlation Coefficient

Plan to compute correlation coefficients.

Description

This plan computes the Pearson product-moment correlation coefficient between two given arrays, x and y, defined as

Sum((x[i]-μx)(y[i]-μy)) / √{Sum((x[i]-μx)2)Sum((y[i]-μy)2)},

over the values from the beginning of arrays x and y up to and including their k-th values for each index k, to produce the output array. Alternatively, when the parameter w is specified, it computes the correlation coefficient within sliding windows of size w preceding and including x[k] and y[k]. Here, μx and μy are the averages of these values in arrays x and y, respectively. Out-of-range 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 Arrays

Plan to find minimum values across arrays.

Description

This plan finds the minimum value at each index across multiple arrays to produce the output array.

Example

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

Array Index of Minimum Across Arrays

Plan to find the array indices of minimum values across arrays.

Description

This plan finds the array index of the first occurrence of the minimum value at each index across multiple arrays to produce the output array.

Example

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

Maximum Across Arrays

Plan to find maximum values across arrays.

Description

This plan finds the maximum value at each index across multiple arrays to produce the output array.

Example

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

Array Index of Maximum Across Arrays

Plan to find the array indices of maximum values across arrays.

Description

This plan finds the array index of the first occurrence of the maximum value at each index across multiple arrays to produce the output array.

Example

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

Minimum Magnitude Across Arrays

Plan to find minimum magnitude values across arrays.

Description

This plan finds the minimum magnitude value at each index across multiple arrays to produce the output array.

Example

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

Array Index of Minimum Magnitude Across Arrays

Plan to find the array indices of minimum magnitude values across arrays.

Description

This plan finds the array index of the first occurrence of the minimum magnitude value at each index across multiple arrays to produce the output array.

Example

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

Maximum Magnitude Across Arrays

Plan to find maximum magnitude values across arrays.

Description

This plan finds the maximum magnitude value at each index across multiple arrays to produce the output array.

Example

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

Array Index of Maximum Magnitude Across Arrays

Plan to find the array indices of maximum magnitude values across arrays.

Description

This plan finds the array index of the first occurrence of the maximum magnitude value at each index across multiple arrays to produce the output array.

Example

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

Arithmetic Mean Across Arrays

Plan to compute arithmetic means across arrays.

Description

This plan computes the arithmetic mean across multiple arrays, defined as

Sum(xi[k]) / Nk,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute geometric means across arrays.

Description

This plan computes the geometric mean across multiple arrays, defined as

Product(|xi[k]|)1/Nk,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute harmonic means across arrays.

Description

This plan computes the harmonic mean across multiple arrays, defined as

Nk / Sum(1/xi[k]),

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute weighted means across arrays.

Description

This plan computes the weighted mean across multiple arrays, defined as

(x0[k]+2×x1[k]+...+Nk×xNk-1[k]) / (½Nk(Nk+1)),

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute custom weighted means across arrays.

Description

This plan computes the custom weighted mean across multiple arrays, defined as

(a[0]×xNk-1[k]+a[1]×xNk-2[k]+...) / (a[0]+a[1]+...),

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k. The custom weights are given in the array a.

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}

Exponentially Weighted Mean Across Arrays

Plan to compute exponentially weighted means across arrays.

Description

This plan computes the exponentially weighted mean, or the final value of the exponential moving average, EMA[k,Nk-1], across multiple arrays to produce the output array. The exponential moving average is calculated as

EMA[k,i] = αxi[k] + (1-α)EMA[k,i-1]

over the values at index k in the arrays x0, x1, etc. Here, α is the smoothing factor and Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to find medians across arrays.

Description

This plan finds the median across multiple arrays, defined as the smallest value at or below which half of the available values fall, among the values at the same index in the arrays x0, x1, etc. to produce the output array.

Example

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

Array Index of Median Across Arrays

Plan to find the array indices of medians across arrays.

Description

This plan finds the array index of the first occurrence of the median at each index across multiple arrays to produce the output array.

Example

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

Mode Across Arrays

Plan to find modes across arrays.

Description

This plan finds the mode across multiple arrays, defined as the most frequent value among the values at the same index in the arrays x0, x1, etc. to produce the output array.

Example

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

Array Index of Mode Across Arrays

Plan to find the array indices of modes across arrays.

Description

This plan finds the array index of the first occurrence of the mode at each index across multiple arrays to produce the output array.

Example

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

Range Across Arrays

Plan to compute ranges across arrays.

Description

This plan computes the range across multiple arrays, defined as the difference between the minimum and maximum of the available values at the same index in the arrays x0, x1, etc. to produce the output array.

Example

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

Root Mean Square Across Arrays

Plan to compute root mean squares across arrays.

Description

This plan computes the root mean square across multiple arrays, defined as

√{Sum(xi[k]2) / Nk},

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute moments across arrays.

Description

This plan computes the moment across multiple arrays, defined as

Sum(xi[k]p) / Nk,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute central moments across arrays.

Description

This plan computes the central moment across multiple arrays, defined as

mp = Sum((xi[k]-μk)p) / Nk,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, μk is the arithmetic mean and Nk is the number of available values across the arrays at index k.

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 Arrays

Plan to compute standardized moments across arrays.

Description

This plan computes the standardized moment across multiple arrays, defined as

Sum((xi[k]-μk)p) / (σkpNk),

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, μk is the arithmetic mean, σk is the population standard deviation, and Nk is the number of available values across the arrays at index k.

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 Arrays - Sample

Plan to compute sample standard deviations across arrays.

Description

This plan computes the sample standard deviation across multiple arrays, defined as

√{Sum((xi[k]-μk)2) / (Nk-1)},

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, μk is the arithmetic mean and Nk is the number of available values across the arrays at index k.

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 Arrays - Population

Plan to compute population standard deviations across arrays.

Description

This plan computes the population standard deviation across multiple arrays, defined as

√{Sum((xi[k]-μk)2) / Nk},

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, μk is the arithmetic mean and Nk is the number of available values across the arrays at index k.

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 Arrays - Sample

Plan to compute sample variances across arrays.

Description

This plan computes the sample (unbiased) variance across multiple arrays, defined as

Sum((xi[k]-μk)2) / (Nk-1),

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, μk is the arithmetic mean and Nk is the number of available values across the arrays at index k.

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 Arrays - Population

Plan to compute population variances across arrays.

Description

This plan computes the population (biased) variance across multiple arrays, defined as

Sum((xi[k]-μk)2) / Nk,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, μk is the arithmetic mean and Nk is the number of available values across the arrays at index k.

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 Arrays - Sample

Plan to compute sample skewness measures across arrays.

Description

This plan computes the sample skewness measure (the adjusted Fisher–Pearson standardized moment coefficient) across multiple arrays, defined as

G1,k = m3/m21.5×{√[Nk(Nk-1)]} / (Nk-2),

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, mp is the p-th central moment and Nk is the number of available values across the arrays at index k.

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 Arrays - Population

Plan to compute population skewness measures across arrays.

Description

This plan computes the population skewness measure across multiple arrays, defined as

g1,k = m3/m21.5,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, mp is the p-th central moment of the available values across the arrays at index k.

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 Arrays - Sample

Plan to compute sample excess kurtosis measures across arrays.

Description

This plan computes the sample excess kurtosis measure across multiple arrays, defined as

G2,k = {(Nk-1) / [(Nk-2)(Nk-3)]} {(Nk+1)m4/m22-3(Nk-1)},

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, mp is the p-th central moment and Nk is the number of available values across the arrays at index k.

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 Arrays - Population

Plan to compute population excess kurtosis measures across arrays.

Description

This plan computes the population excess kurtosis measure across multiple arrays, defined as

g2,k = m4/m22-3,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, mp is the p-th central moment of the available values across the arrays at index k.

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 Arrays

Plan to compute crest factors across arrays.

Description

This plan computes the crest factor across multiple arrays, defined as the maximum magnitude divided by the root mean square of the values at index k in the arrays x0, x1, etc. to produce the output array.

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 Arrays

Plan to find percentiles across arrays.

Description

This plan finds the k-th percentile across multiple arrays, defined as the smallest value at or below which k percent (k=1.0 for 100%) of the available values fall, among the values at the same index in the arrays x0, x1, etc. to produce the output array.

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}
k = {0.7};x0 = {1,0,-1};x1 = {0,0,-1,2};x2 = {1,2,0};x3 = {0,2,-1}{1,2,-1,2}

Array Index of Percentile Across Arrays

Plan to find the array indices of percentiles across arrays.

Description

This plan finds the array index of the first occurrence of the k-th percentile at each index across multiple arrays to produce the output array.

Example

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

Sum Across Arrays

Plan to compute sums across arrays.

Description

This plan computes the sum across multiple arrays, defined as the sum of the values at the same index in the arrays x0, x1, etc. to produce the output array.

Example

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

Product Across Arrays

Plan to compute products across arrays.

Description

This plan computes the product across multiple arrays, defined as the product of the values at the same index in the arrays x0, x1, etc. to produce the output array.

Example

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

Integral Across Arrays

Plan to compute integrals across arrays.

Description

This plan computes the integral using the trapezoidal rule across multiple arrays, defined as

{Sum(xi[k]) - 0.5x0[k] - 0.5xNk-1[k]}×Δx,

over the values at index k in the arrays x0, x1, etc. to produce the output array. Here, Nk is the number of available values across the arrays at index k.

Example

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

Sum of Powers Across Arrays

Plan to compute the sums of powers across arrays.

Description

This plan computes the sum of the powers across multiple arrays, defined as

Sum(xi[k]p),

over the values at index k in the arrays x0, x1, etc. to produce the output array.

Example

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

Norm Across Arrays

Plan to compute p-norms across arrays.

Description

This plan computes the p-norm across multiple arrays, defined as the p-norm of the values at the same index in the arrays x0, x1, etc. to produce the output array. The norm parameter p can be any real number ≥1 or inf.

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 Values Across Arrays - Equality

Plan to check the equality of values across arrays.

Description

This plan sets the output array at index k to the pass flag p[k] if all values at index k in the arrays x0, x1, etc. are equal to one another; otherwise, it sets the output array at index k to the fail flag f[k]. The last values in p and f are used when k is out of bounds. When p or f is not specified, the flagged values are removed instead.

Example

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

Check Values Across Arrays - Ascending Order

Plan to check the ascending order of values across arrays.

Description

This plan sets the output array at index k to the pass flag p[k] if all values at index k in the arrays x0, x1, etc. are in ascending order; otherwise, it sets the output array at index k to the fail flag f[k]. The last values in p and f are used when k is out of bounds. When p or f is not specified, the flagged values are removed instead.

Example

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

Check Values Across Arrays - Descending Order

Plan to check the descending order of values across arrays.

Description

This plan sets the output array at index k to the pass flag p[k] if all values at index k in the arrays x0, x1, etc. are in descending order; otherwise, it sets the output array at index k to the fail flag f[k]. The last values in p and f are used when k is out of bounds. When p or f is not specified, the flagged values are removed instead.

Example

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

Zero-Intercept Linear Regression - LBFGS

Plan to compute zero-intercept linear regression coefficients with L-BFGS algorithm.

Description

This plan computes the zero-intercept 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 the limited-memory Broyden–Fletcher–Goldfarb–Shanno (BFGS) optimization algorithm. xk and yk are specified by xy2k and xy2k+1, respectively, for each k.

This plan is configured with several parameters: numBasis is the number of stored memory points; maxIters is the maximum number of iterations, where maxIters=0 indicates no limit; and 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 gradient norm and factr is the minimum relative function value decrease required to continue the optimization. maxLineTrials is the maximum number of trials for the line search. minStep and maxStep limit the 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}

Zero-Intercept Linear Regression - GD

Plan to compute zero-intercept linear regression coefficients with GD algorithm.

Description

This plan computes the zero-intercept 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 the gradient descent optimization algorithm. xk and yk are specified by xy2k and xy2k+1, respectively, for each k.

This plan is configured with several parameters: stepSize is the step size in each iteration; maxIters is the maximum number of iterations, where maxIters=0 indicates no limit; and tol is the maximum objective variation required 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}

Standard Linear Regression - LBFGS

Plan to compute standard linear regression coefficients with L-BFGS algorithm.

Description

This plan computes the standard 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 the limited-memory Broyden–Fletcher–Goldfarb–Shanno (BFGS) optimization algorithm. xk and yk are specified by xy2k and xy2k+1, respectively, for each k.

This plan is configured with several parameters: numBasis is the number of stored memory points; maxIters is the maximum number of iterations, where maxIters=0 indicates no limit; and 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 gradient norm and factr is the minimum relative function value decrease required to continue the optimization. maxLineTrials is the maximum number of trials for the line search. minStep and maxStep limit the 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}

Standard Linear Regression - GD

Plan to compute standard linear regression coefficients with GD algorithm.

Description

This plan computes the standard 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 the gradient descent optimization algorithm. xk and yk are specified by xy2k and xy2k+1, respectively, for each k.

This plan is configured with several parameters: stepSize is the step size in each iteration; maxIters is the maximum number of iterations, where maxIters=0 indicates no limit; and tol is the maximum objective variation required 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}


Highlight an Array

These plans produce an array by extracting information from another array.


Count of Values

Plan to count values.

Description

This plan counts the values in the array x. The result is the number of values in x.

Example

x = {1,0,-1,0,inf,2}{6}

Count of Value Occurrences

Plan to count occurrences of given values.

Description

This plan counts the number of values in the array x that are equal to any of the values in the array a. The result is the number of values in x that match any value in a.

Example

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

Count of Values Inside Ranges

Plan to count values in given ranges.

Description

This plan counts the number of values in the array x that fall within any of the ranges [a[k], b[k]). The result is the number of values in x that fall within any of these ranges.

Example

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

Count of Finite Values

Plan to count finite values.

Description

This plan counts the number of finite values in the array x. The result is the number of finite values in x. Non-finite values are inf, -inf, and nan.

Example

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

Binning by Occurrence - Histogram

Plan to count occurrences of values in histogram bins.

Description

This plan counts the number of values in the array x that belong to the bins defined by the values in the array a. The result at index i is the number of values in x that fall within the range [a[i]-δn[i], a[i]+δp[i]]. The last values in δn and δp are used when i is out of bounds.

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

Plan to count positive level crossings.

Description

This plan counts positive level crossings in the array x at levels given in the array a. The result at index i is the number of indices j where x[j]≤a[i] and x[j+1]>a[i].

Example

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

Binning by Negative Crossing

Plan to count negative level crossings.

Description

This plan counts negative level crossings in the array x at levels given in the array a. The result at index i is the number of indices j where x[j]≥a[i] and x[j+1]<a[i].

Example

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

Minimum

Plan to find the minimum value.

Description

This plan finds the minimum value in the array x.

Example

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

Index of Minimum

Plan to find the index of minimum of value.

Description

This plan finds the index of the first occurrence of the minimum value in the array x.

Example

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

Maximum

Plan to find the maximum value.

Description

This plan finds the maximum value in the array x.

Example

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

Index of Maximum

Plan to find the index of maximum of value.

Description

This plan finds the index of the first occurrence of the maximum value in the array x.

Example

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

Minimum Magnitude

Plan to find the minimum magnitude value.

Description

This plan finds the minimum magnitude value in the array x.

Example

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

Index of Minimum Magnitude

Plan to find the index of minimum magnitude value.

Description

This plan finds the index of the first occurrence of the minimum magnitude value in the array x.

Example

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

Maximum Magnitude

Plan to find the maximum magnitude value.

Description

This plan finds the maximum magnitude value in the array x.

Example

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

Index of Maximum Magnitude

Plan to find the index of maximum magnitude value.

Description

This plan finds the index of the first occurrence of the maximum magnitude value in the array x.

Example

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

Arithmetic Mean

Plan to compute the arithmetic mean.

Description

This plan computes the arithmetic mean, defined as

Sum(x[i]) / N,

for the array x. Here, N is the length of the array.

Example

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

Geometric Mean

Plan to compute the geometric mean.

Description

This plan computes the geometric mean, defined as

Product(|x[i]|)1/N,

for the array x. Here, N is the length of the array.

Example

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

Harmonic Mean

Plan to compute the harmonic mean.

Description

This plan computes the harmonic mean, defined as

N / Sum(1/x[i]),

for the array x. Here, N is the length of the array.

Example

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

Weighted Mean

Plan to compute the weighted mean.

Description

This plan computes the weighted mean, defined as

(x[0]+2×x[1]+...+N×x[N-1]) / (½N(N+1)),

for the array x. Here, N is the length of the array.

Example

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

Custom Weighted Mean

Plan to compute the custom weighted mean.

Description

This plan computes the custom weighted mean, defined as

(a[0]×x[N-1]+a[1]×x[N-2]+...) / (a[0]+a[1]+...),

for the array x. Here, N is the length of the array x, and the custom weights are given in the array a.

Example

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

Exponentially Weighted Mean

Plan to compute the exponentially weighted mean.

Description

This plan computes the exponentially weighted mean, or the final value of the exponential moving average, EMA[N-1], defined as

EMA[k] = αx[k] + (1-α)EMA[k-1],

for the array x. Here, N is the length of the array, and α is the smoothing factor.

Example

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

Median

Plan to find the median.

Description

This plan finds the median, defined as the smallest value at or below which half of the values fall, in the array x.

Example

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

Index of Median

Plan to find the index of median.

Description

This plan finds the index of the first occurrence of the median in the array x.

Example

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

Mode

Plan to find the mode.

Description

This plan finds the mode, defined as the most frequent value, in the array x.

Example

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

Index of Mode

Plan to find the index of mode.

Description

This plan finds the index of the first occurrence of the mode in the array x.

Example

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

Range

Plan to compute the range.

Description

This plan computes the range, defined as the difference between the minimum and maximum values, of the array x.

Example

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

Root Mean Square

Plan to compute the root mean square.

Description

This plan computes the root mean square, defined as

√{Sum(x[i]2) / N},

for the array x. Here, N is the length of the array.

Example

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

Moment

Plan to compute the moment.

Description

This plan computes the moment, defined as

Sum(x[i]p) / N,

for the array x. Here, N is the length 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

Plan to compute the central moment.

Description

This plan computes the central moment, defined as

Sum((x[i]-μ)p) / N,

for the array x. Here, μ is the arithmetic mean and N is the length 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

Plan to compute the standardized moment.

Description

This plan computes the standardized moment, defined as

Sum((x[i]-μ)p) / (σpN),

for the array x. Here, μ is the arithmetic mean, σ is the population standard deviation, and N is the length 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

Plan to compute the sample standard deviation.

Description

This plan computes the sample standard deviation, defined as

√{Sum((x[i]-μ)2) / (N-1)},

for the array x. Here, μ is the arithmetic mean and N is the length of the array.

Example

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

Standard Deviation - Population

Plan to compute the population standard deviation.

Description

This plan computes the population standard deviation, defined as

√{Sum((x[i]-μ)2) / N},

for the array x. Here, μ is the arithmetic mean and N is the length of the array.

Example

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

Variance - Sample

Plan to compute the sample variance.

Description

This plan computes the sample (unbiased) variance, defined as

Sum((x[i]-μ)2) / (N-1),

for the array x. Here, μ is the arithmetic mean and N is the length of the array.

Example

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

Variance - Population

Plan to compute the population variance.

Description

This plan computes the population (biased) variance, defined as

Sum((x[i]-μ)2) / N,

for the array x. Here, μ is the arithmetic mean and N is the length of the array.

Example

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

Skewness - Sample

Plan to compute the sample skewness measure.

Description

This plan computes the sample skewness measure (the adjusted Fisher–Pearson standardized moment coefficient), defined as

G1 = m3/m21.5×{√[N(N-1)]} / (N-2),

for the array x. Here, mp is the p-th central moment and N is the length of the array.

Example

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

Skewness - Population

Plan to compute the population skewness measure.

Description

This plan computes the population skewness measure, defined as

g1 = m3/m21.5,

for the array x. Here, mp is the p-th central moment of the array.

Example

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

Kurtosis - Sample

Plan to compute the sample excess kurtosis measure.

Description

This plan computes the sample excess kurtosis measure, defined as

G2 = {(N-1) / [(N-2)(N-3)]} {(N+1)m4/m22-3N+3},

for the array x. Here, mp is the p-th central moment and N is the length of the array.

Example

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

Kurtosis - Population

Plan to compute the population excess kurtosis measure.

Description

This plan computes the population excess kurtosis measure, defined as

g2 = m4/m22-3,

for the array x. Here, mp is the p-th central moment of the array.

Example

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

Crest Factor

Plan to compute the crest factor.

Description

This plan computes the crest factor, defined as the maximum magnitude divided by the root mean square of the values, for the array x.

Example

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

Percentile

Plan to find the percentile.

Description

This plan finds the k-th percentile, defined as the smallest value at or below which k percent (k=1.0 for 100%) of the values fall, in the array x.

Example

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

Index of Percentile

Plan to find the index of percentile.

Description

This plan finds the index of the first occurrence of the k-th percentile in the array x.

Example

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

Sum

Plan to compute the sum.

Description

This plan computes the sum of the values in the array x.

Example

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

Product

Plan to compute the product.

Description

This plan computes the product of the values in the array x.

Example

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

Integral

Plan to compute the integral.

Description

This plan computes the integral of the values using the trapezoidal rule, defined as

{Sum(x[i]) - 0.5x[0] - 0.5x[N-1]}×Δx,

for the array x. Here, N is the length of the array.

Example

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

Sum of Powers

Plan to compute the sum of powers.

Description

This plan computes the sum of the powers of the values, defined as

Sum(x[i]p),

for the array x.

Example

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

Norm

Plan to compute the p-norm.

Description

This plan computes the p-norm of the values in the array x. The norm parameter p can be any real number ≥1 or inf.

Example

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

Distance to Hyperplane

Plan to compute the distance to a hyperplane as point.

Description

This plan computes the distance between the point specified by the array x and the hyperplane in N-dimensional space defined by the equation a[0]x[0]+a[1]x[1]+...+a[N-1]x[N-1] = a[N]. The plane coefficients are given in the array a. The right-hand side of the plane equation is set to 0 if a[N] is out of range.

Example

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

Distance to Line

Plan to compute the distance to a line as point.

Description

This plan computes the distance between the point specified by the array x and the line defined by the 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}


Highlight Multiple Arrays

These plans produce an array by extracting information from multiple arrays.


Count of Arrays with Any Occurrences

Plan to count arrays containing any of the given values.

Description

This plan counts the number of arrays xk that contain at least one value present in the array a. The result is the count of arrays among x0, x1, etc. that have at least one value matching a value in a.

Example

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

Count of Arrays with All Occurrences

Plan to count arrays containing only the given values.

Description

This plan counts the number of arrays xk that contain only values present in the array a. The result is the count of arrays among x0, x1, etc. that have only values found in a.

Example

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

Count of Arrays with Any Values in Ranges

Plan to count arrays containing any value within given ranges.

Description

This plan counts the number of arrays xk that contain at least one value within any of the ranges [a[i], b[i]). The result is the count of arrays among x0, x1, etc. that have at least one value within these ranges.

Example

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

Count of Arrays with All Values in Ranges

Plan to count arrays containing only values within given ranges.

Description

This plan counts the number of arrays xk that contain only values within the ranges [a[i], b[i]). The result is the count of arrays among x0, x1, etc. that have only values within these ranges.

Example

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

Count of Arrays with Any Finite Values

Plan to count arrays containing a finite value.

Description

This plan counts the number of arrays xk that contain at least one finite value. The result is the count of arrays among x0, x1, etc. that have at least one finite value. Non-finite values are inf, -inf, and nan.

Example

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

Count of Arrays with All Finite Values

Plan to count arrays containing only finite values.

Description

This plan counts the number of arrays xk that contain only finite values. The result is the count of arrays among x0, x1, etc. that have only finite values. Non-finite values are inf, -inf, and nan.

Example

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

Total Binning by Value - Histogram

Plan to count occurrences of values in histogram bins in multiple arrays.

Description

This plan counts the number of values in the arrays xk that belong to the bins defined by the values in the array a. The result at index i is the number of values in xk, for any k, that fall within the range [a[i]-δn[i], a[i]+δp[i]]. The last values in δn and δp are used when i is out of bounds.

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

Plan to count positive level crossings in multiple arrays.

Description

This plan counts positive level crossings in the arrays xk at levels given in the array a. The result at index i is the number of indices j where xk[j]≤a[i] and xk[j+1]>a[i] for any k.

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

Plan to count negative level crossings in multiple arrays.

Description

This plan counts negative level crossings in the arrays xk at levels given in the array a. The result at index i is the number of indices j where xk[j]≥a[i] and xk[j+1]<a[i] for any k.

Example

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

Total Minimum

Plan to find the minimum value in multiple arrays.

Description

This plan finds the minimum value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Minimum

Plan to find the array index of minimum value in multiple arrays.

Description

This plan finds the array index of the first occurrence of the minimum value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Maximum

Plan to find the maximum value in multiple arrays.

Description

This plan finds the maximum value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Maximum

Plan to find the array index of maximum value in multiple arrays.

Description

This plan finds the array index of the first occurrence of the maximum value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Minimum Magnitude

Plan to find the minimum magnitude value in multiple arrays.

Description

This plan finds the minimum magnitude value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Minimum Magnitude

Plan to find the array index of minimum magnitude value in multiple arrays.

Description

This plan finds the array index of the first occurrence of the minimum magnitude value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Maximum Magnitude

Plan to find the maximum magnitude value in multiple arrays.

Description

This plan finds the maximum magnitude value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Maximum Magnitude

Plan to find the array index of maximum magnitude value in multiple arrays.

Description

This plan finds the array index of the first occurrence of the maximum magnitude value in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Arithmetic Mean

Plan to compute the arithmetic mean in multiple arrays.

Description

This plan computes the arithmetic mean of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Geometric Mean

Plan to compute the geometric mean in multiple arrays.

Description

This plan computes the geometric mean of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Harmonic Mean

Plan to compute the harmonic mean in multiple arrays.

Description

This plan computes the harmonic mean of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Weighted Mean

Plan to compute the weighted mean in multiple arrays.

Description

This plan computes the weighted mean of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Custom Weighted Mean

Plan to compute the custom weighted mean in multiple arrays.

Description

This plan computes the custom weighted mean of the values in the flattened array formed by concatenating the arrays x0, x1, and so on. The custom weights are given in the array 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 Exponentially Weighted Mean

Plan to compute the exponentially weighted mean in multiple arrays.

Description

This plan computes the exponentially weighted mean, or the final value of the exponential moving average, of the values in the flattened array formed by concatenating the arrays x0, x1, and so on. Here, α specifies 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

Plan to find the median in multiple arrays.

Description

This plan finds the median of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Median

Plan to find the array index of median in multiple arrays.

Description

This plan finds the array index of the first occurrence of the median of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Mode

Plan to find the mode in multiple arrays.

Description

This plan finds the mode of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Mode

Plan to find the array index of mode in multiple arrays.

Description

This plan finds the array index of the first occurrence of the mode of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Range

Plan to compute the range in multiple arrays.

Description

This plan computes the range of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Root Mean Square

Plan to compute the root mean square in multiple arrays.

Description

This plan computes the root mean square of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Moment

Plan to compute the moment in multiple arrays.

Description

This plan computes the moment of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

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

Plan to compute the central moment in multiple arrays.

Description

This plan computes the central moment of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

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

Plan to compute the standardized moment in multiple arrays.

Description

This plan computes the standardized moment of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

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

Plan to compute the sample standard deviation in multiple arrays.

Description

This plan computes the sample standard deviation of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Standard Deviation - Population

Plan to compute the population standard deviation in multiple arrays.

Description

This plan computes the population standard deviation of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Variance - Sample

Plan to compute the sample variance in multiple arrays.

Description

This plan computes the sample (unbiased) variance of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Variance - Population

Plan to compute the population variance in multiple arrays.

Description

This plan computes the population (biased) variance of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Skewness - Sample

Plan to compute the sample skewness measure in multiple arrays.

Description

This plan computes the sample skewness measure of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{-0.551618}

Total Skewness - Population

Plan to compute the population skewness measure in multiple arrays.

Description

This plan computes the population skewness measure of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{-0.370037}

Total Kurtosis - Sample

Plan to compute the sample excess kurtosis measure in multiple arrays.

Description

This plan computes the sample excess kurtosis measure of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{0.867769}

Total Kurtosis - Population

Plan to compute the population excess kurtosis measure in multiple arrays.

Description

This plan computes the population excess kurtosis measure of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

x0 = {1,3};x1 = {3};x2 = {4,5}{-0.783058}

Total Crest Factor

Plan to compute the crest factor in multiple arrays.

Description

This plan computes the crest factor of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Percentile

Plan to find the percentile in multiple arrays.

Description

This plan finds the k-th percentile of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Array Index of Total Percentile

Plan to find the array index of percentile in multiple arrays.

Description

This plan finds the array index of the first occurrence of the k-th percentile of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Sum

Plan to compute the sum in multiple arrays.

Description

This plan computes the sum of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Product

Plan to compute the product in multiple arrays.

Description

This plan computes the product of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

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

Total Integral

Plan to compute the integral in multiple arrays.

Description

This plan computes the integral, using the trapezoidal rule, of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

Δx = {4};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{-14}

Total Sum of Powers

Plan to compute the sum of powers in multiple arrays.

Description

This plan computes the sum of the powers of the values in the flattened array formed by concatenating the arrays x0, x1, and so on.

Example

p = {2};x0 = {1,0.5};x1 = {-1};x2 = {-2,-3}{15.25}

Total Norm

Plan to compute the p-norm in multiple arrays.

Description

This plan computes the p-norm of the values in the flattened array formed by concatenating the arrays x0, x1, and so on. The norm parameter p can be any real number ≥1 or inf.

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

Plan to compute the dot product of multiple arrays.

Description

This plan computes the scalar (dot) product, which is the sum of the products of the values at the same index in the arrays x0, x1, etc.

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

Plan to compute the normalized dot product of two arrays.

Description

This plan computes the dot product of two Euclidean-normalized arrays, x/|x| and y/|y|. The arrays x and y must have the same length.

Example

x = {3,4,5};y = {-1,0,1}{0.2}

Execute Script in Text

Plan to execute a JavaScript function of arrays in text.

Description

This plan executes a JavaScript function with the specified function name, as described in the given script text, to produce the output array. The input arrays x0, x1, etc. are passed to this function 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}

Execute Script in File

Plan to execute a JavaScript function of arrays in file.

Description

This plan executes a JavaScript function with the specified function name, as described in the file with the given file name, to produce the output array. The input arrays x0, x1, etc. are passed to this function 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}


Post Arrays

These plans output arrays without producing any new data.


Export to Text File Along Rows

Plan to export arrays to a text file row by row.

Description

This plan exports the arrays x0, x1, etc. to a text file with the given file name, writing each array in a separate row. The exported values are separated by the specified delimiter, which may include escape sequences. If the append parameter is not empty, the arrays are appended to the end of the file. When specified, the format of the floating-point numbers is controlled by the 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

Plan to export arrays to a text file column by column.

Description

This plan exports the arrays x0, x1, etc. to a text file with the given file name, writing each array in a separate column. The exported values are separated by the specified delimiter, which may include escape sequences. If the append parameter is not empty, the arrays are appended to the end of the file. To ensure that the exported arrays are similar in length, zeros may be added at the end. When specified, the format of the floating-point numbers is controlled by the 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

Plan to export an array to a binary file.

Description

This plan exports the array x to a binary file with the given file name. If the append parameter is not empty, the array is appended to the end of the file.

Example

x = {1,2,3,pi};file name = {tests\arrays.bin};append = {}

Export to Script in Text

Plan to pass arrays to a JavaScript function in text.

Description

This plan asynchronously executes a JavaScript function with the specified function name, as described in the given script text. The input arrays x0, x1, etc. are passed to this function 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}

Export to Script in File

Plan to pass arrays to a JavaScript function in file.

Description

This plan asynchronously executes a JavaScript function with the specified function name, as described in the file with the given file name. The input arrays x0, x1, etc. are passed to this function 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}