IIntercept.Mode

Fore Syntax

Mode: InterceptMode;

Fore.NET Syntax

Mode: Prognoz.Platform.Interop.Stat.InterceptMode;

Description

The Mode property determines mode of constant assignment.

Comments

If:

Fore Example

To execute the example, add links to the system assemblies Stat and MathFin.

Sub UserIntercept;
Var
    lr: ISmLinearRegress;
    Fact: Array[
40Of Double;
    Intercept: IIntercept;
    i: Integer;
    res: Integer;
Begin
    lr := 
New SmLinearRegress.Create;
    
// Set values of the explained series
    For i := 0 To 39 Do
        Fact[i] := Math.RandBetween(-
4040);
    
End For;
    
// Set explained series
    lr.Explained.Value := Fact;
    
// Get parameters of constant in the model
    Intercept := lr.ModelCoefficients.Intercept;
    
// Specify that the constant value is estimated automatically
    Intercept.Mode := InterceptMode.AutoEstimate;
    
// Calculate the model 
    res := lr.Execute;
    Debug.WriteLine(lr.Errors);
    
If (res = 0Then
        
// Output value and coefficients of the constant
        Debug.WriteLine("Value: " + Intercept.Estimate.ToString);
        Debug.WriteLine(
"Probability: " + Intercept.Probability.ToString);
        Debug.WriteLine(
"Standard error: " + Intercept.StandardError.ToString);
        Debug.WriteLine(
" t-statistic: " + Intercept.TStatistic.ToString);
    
End If;
End Sub UserIntercept;

Example execution result: the console window displays value and coefficients of the constant.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Stat;
Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub UserIntercept();
Var
    lr: ISmLinearRegress;
    Fact: Array[40Of Double;
    Math: MathClass;
    Intercept: IIntercept;
    i: Integer;
    res: Integer;
Begin
    lr := New SmLinearRegress.Create();
    // Set explained series values
    Math := New MathClass.Create();
    For i := 0 To 39 Do
        Fact[i] := Math.RandBetween(-4040);
    End For;
    // Set explained series
    lr.Explained.Value := Fact;
    // Get parameters of constant in the model
    Intercept := lr.ModelCoefficients.Intercept;
    // Specify that the constant value is estimated automatically
    Intercept.Mode := InterceptMode.imAutoEstimate;
    // Calculates model  
    res := lr.Execute();
    System.Diagnostics.Debug.WriteLine(lr.Errors);
    If (res = 0Then
        // Output value and coefficients of the constant
        System.Diagnostics.Debug.WriteLine("Value: " + Intercept.Estimate.ToString());
        System.Diagnostics.Debug.WriteLine("Probability: " + Intercept.Probability.ToString());
        System.Diagnostics.Debug.WriteLine("Standard error: " + Intercept.StandardError.ToString());
        System.Diagnostics.Debug.WriteLine(" t-statistic: " + Intercept.TStatistic.ToString());
    End If;
End Sub UserIntercept;

See also:

IIntercept