IIntercept.Mode

Syntax

Mode: InterceptMode;

Description

The Mode property determines mode of constant assignment.

Comments

If:

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.

See also:

IIntercept