Growth(
KnownYs: Array;
KnownXs: Array;
NewXs: Array;
HasConstant: Boolean): Array;
KnownYs. Set of known y-values. The values must be positive;
KnownXs. Set of known x-values.
NewXs. New X values for which Growth returns corresponding Y values;
HasConstant. Determines if the constant b equals to one. Available values:
True. The constant is calculated.
False. b is assumed to be equal to one.
The Growth method calculates predictable exponential growth based on existing data.
The following ratio is considered: y = b * mx.
The method returns y-values calculated based on known values KnownYs and KnownXs, for a sequence of set NewXs values. Use the IStatistics.Logest property to get estimated coefficients of the ratio.
Working with parameters:
If there is only one column in the KnownYs array, each column of the KnownXs array is regarded as a separate variable.
If there is only one row in the KnownYs array, each row of the KnownXs array is regarded as a separate variable.
The KnownXs array can contain one or more variable sets. If only one variable is used, KnownYs and KnownXs can have any form, provided that they have the same dimension. If several variables are used, KnownYs must be a vector (i.e. an interval with a row height or a column width).
If only one variable is used, the NewXs array may take any form. If more than one variable is used, the NewXs array must contain a column or a row for each independent variable, like KnownXs. Thus, ifKnownYs is represented by one column, KnownXs and NewXs must have the same number of columns. If KnownYs is represented by one row, KnownXs and NewXs must have the same number of rows.
To execute the example, add a link to the Stat system assembly.
Sub UsesProcGrowth;
Var
st: Statistics;
i: Integer;
y, x, res: Array Of Double;
nx: Array Of Double;
Begin
// Define the range of y values
y := New Double[4];
y[0] := 0.2; y[2] := 5;
y[1] := 9; y[3] := 7;
// Define the range of x values
x := New Double[4];
x[0] := 1; x[2] := 3;
x[1] := 2; x[3] := 4;
// Define new x values
nx := New Double[2];
nx[0] := 5; nx[1] := 6;
// Call the method
st := New Statistics.Create;
res := St.Growth(y, x, nx, True);
// Show results in console window
Debug.WriteLine(st.Errors);
If st.Status = 0 Then
For i := 0 To 1 Do
Debug.WriteLine(i.ToString + ":" + res[i].ToString);
End For;
End If;
End Sub UsesProcGrowth;
After executing the example the console window displays values of exponential growth predicted for the array nx.
See also: