regression
Calculates the linear or exponential regression for a set of points along a given timeline and outputs them as set reflecting a linear or exponential curve.
Indirect parameter passing is disabled
1-2
No. | Type | Description |
---|---|---|
1 input |
set | input values Set of numerals (blank strings are allowed and recognized as zero) to be used to calculate the CAGR |
Opt. 2 input |
string | Regression calculation method Accepts following three values: |
Type | Description |
---|---|
set | Regression curve Contains as many elements as provided in the 1st function parameter and describes the linear or exponential regression curve. |
echo( regression( {1, 1.5, 2.5, 4, 6.5 } ) ); // returns { 0.4, 1.75, 3.1, 4.45, 5.8 }
echo( regression( {1, 1.5, 2.5, 4, 6.5 }, exponential) ); // returns an exponential pattern
{0.4,1.75,3.1,4.45,5.8}
{0.9714978281,1.5581934649,2.4991994875,4.0084868914,6.4292455398}