IStatistics.Growth

Fore Syntax

Growth(
   KnownYs: Array;
   KnownXs: Array;
   NewXs: Array;
   HasConstant: Boolean): Array;

Fore.NET Syntax

Growth(
   KnownYs: System.Array;
   KnownXs: System.Array;
   NewXs: System.Array;
   HasConstant: boolean): System.Array;

Parameters

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:

Description

The Growth method calculates predictable exponential growth based on existing data.

Comments

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:

Fore Example

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.

Fore.NET Example

Imports Prognoz.Platform.Interop.Stat;

Public Shared Sub UsesProcGrowth();
Var
    st: Statistics;
    i: integer;
    y, x, res: System.Array;
    nx: System.Array;
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
    System.Diagnostics.Debug.WriteLine(st.Errors);
    If st.Status = 0 Then
        For i := 0 To 1 Do
            System.Diagnostics.Debug.WriteLine(i.ToString() + ":" + res[i].ToString());
        End For;
    End If;
End Sub;

After executing the example the console window displays values of exponential growth predicted for the array nx.

See also:

IStatistics