linearCombination MethodStatic

Compute the linear combination s of the numbers and scales.

linearCombination(data: number[], scales: number[]): number

Parameter Type Description
data number[] array of numbers d_i.
scales number[] array of scales s_i. For best results, scales should have the same length as data.

Returns - number

s = sum(d_i * s_i), where i ranges from 0 to min(data.length, scales.length).

Defined in

Last Updated: 30 November, 2023