IMsChowTestSettings.GroupSeparator

Fore Syntax

GroupSeparator: Array;

Fore.NET Syntax

GroupSeparator: System.Array;

Description

The GroupSeparator property divides observations of explained series into groups.

Comments

GroupSeparator is the array, that contains only zero and one. To each array element the observation corresponds, which is contained in the sample period of explained series. if the value of array element is zero, the observation is included into the first group, or to the second group if the element value is one.

Fore Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier that contains a linear regression model (OLS estimation) with the MODEL identifier. The model contains more than one factor.

Add links to the Metabase, Ms, Stat system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ContModelDescr: IMetabaseObjectDescriptor;
    ModelObj: IMetabaseObject;
    pModel: IMsModel;
    pTransform: IMsFormulaTransform;
    pFormula: IMsFormula;
    pRegress: IMsLinearRegressionTransform;
    pTestList: IMsDiagnosticTestList;
    Test: IMsDiagnosticTest;
    TestSettings: IMsChowTestSettings;
    VarTrans: IMsFormulaTransformVariable;
    Calc: IMsMethodCalculation;
    Coord: IMsFormulaTransformCoord;
    Res: IMsDiagnosticTestResults;
    Stat: IChowTestLinRegress;
    Coef: ICoefficients;
    i: Integer;
    arr: Array Of Integer;
Begin
    mb := MetabaseClass.Active;
    ContModelDescr := mb.ItemById("CONT_MODEL");
    ModelObj := mb.ItemByIdNamespace("MODEL", ContModelDescr.Key).Edit;
    pModel := ModelObj As IMsModel;
    pTransform := pModel.Transform;
    pFormula := pTransform.FormulaItem(0);
    pRegress := pFormula.Method As IMsLinearRegressionTransform;
// get diagnostic tests set
    pTestList := pRegress.DiagnosticTests;
// search tests Chou
    Test := pTestList.FindByType(MsDiagnosticTestType.Chow);
    TestSettings := Test.Settings As IMsChowTestSettings;
// assign type of test
    TestSettings.TestType := ChowTestType.Forecast;
// assign division to groups  
    Arr := New Integer[19];
    Arr[0] := 1; Arr[1] := 1; Arr[2] := 1; Arr[3] := 1; Arr[4] := 0;
    Arr[5] := 0; Arr[6] := 0; Arr[7] := 0; Arr[8] := 0; Arr[9] := 0;
    Arr[10] := 0; Arr[11] := 0; Arr[12] := 0; Arr[13] := 0; Arr[14] := 0;
    Arr[15] := 0; Arr[16] := 0; Arr[17] := 0; Arr[18] := 0;
    TestSettings.GroupSeparator := Arr;
// set testing parameters
    VarTrans := pTransform.Outputs.Item(0);
    Coord := pTransform.CreateCoord(VarTrans);
    Calc := pModel.CreateCalculation As IMsMethodCalculation;
    Calc.Period.IdentificationStartDate := DateTime.ComposeDay(19900101);
    Calc.Period.IdentificationEndDate := DateTime.ComposeDay(20071231);
    Calc.Period.ForecastStartDate := DateTime.ComposeDay(20080101);
    Calc.Period.ForecastEndDate := DateTime.ComposeDay(20101231);
// execute testing   
    Res := Test.Execute(Calc As IMsMethodCalculation, Coord);
// display results
    If Res.FTestResult Then
        Debug.WriteLine("selections are uniform, hypothesis from absence of structure changes accepted");
    Else
        Debug.WriteLine("Selections are not uniform, hypothesis from absence of structure changes is not accepted");
    End If;
    Stat := Res.LR0;
    Coef := Stat.ModelCoefficients.Coefficients;
    Debug.WriteLine("-- Coefficients of first group --");
    For i := 0 To Coef.Estimate.Length - 1 Do
        Debug.WriteLine("   Coefficient " + i.ToString);
        Debug.Write("     Value: ");
        Debug.WriteLine(Coef.Estimate[i]);
        Debug.Write("     Probability: ");
        Debug.WriteLine(Coef.Probability[i]);
    End For;
    Stat := Res.LR1;
    Coef := Stat.ModelCoefficients.Coefficients;
    Debug.WriteLine("-- Coefficients of second group --");
    For i := 0 To Coef.Estimate.Length - 1 Do
        Debug.WriteLine("   Coefficient " + i.ToString);
        Debug.Write("     Value: ");
        Debug.WriteLine(Coef.Estimate[i]);
        Debug.Write("     Probability: ");
        Debug.WriteLine(Coef.Probability[i]);
    End For;
End Sub UserProc;

The parameters adjustment of Chou diagnostic test is shown in the example:

After the testing the results are displayed in the console window.

See also:

IMsChowTestSettings