IMsWhiteHeteroskedasticityTestSettings.CrossProduct

Fore Syntax

CrossProduct: Boolean;

Fore.NET Syntax

CrossProduct: System.Boolean;

Description

The CrossProduct property determines whether cross products should be included.

Comments

CrossProduct enables the use of not only the present explanatory series but its cross products. If two series are examined, the regressors S1*S2, S2*S3, S1*S3 are also examined if cross products are used. It is not recommended to enable cross products, if user have a large number of explanatory series (regressors).

Possible values of CrossProduct:

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: IMsWhiteHeteroskedasticityTestSettings;
    VarTrans: IMsFormulaTransformVariable;
    Calc: IMsMethodCalculation;
    Coord: IMsFormulaTransformCoord;
    Res: IMsDiagnosticTestResults;
    Stat: ISpecificationTestStatistic;
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;
// receive the set of diagnostic tests 
    pTestList := pRegress.DiagnosticTests;
// search the test of White to heteroscedasticity
    Test := pTestList.FindByType(MsDiagnosticTestType.WhiteHeteroskedasticity);
    TestSettings := Test.Settings As IMsWhiteHeteroskedasticityTestSettings;
// set autoregression order 
    TestSettings.CrossProduct := False;
// 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);
// perform testing
    Res := Test.Execute(Calc As IMsMethodCalculation, Coord);
// display results
    Stat := Res.ChiTest;
    Debug.WriteLine("-- Chi-square statistics --");
    Debug.Write("     Value: ");
    Debug.WriteLine(Stat.Statistic);
    Debug.Write("     Probability: ");
    Debug.WriteLine(Stat.Probability);
End Sub UserProc;

The example describes adjustment of parameters of the White diagnostic test for heteroscedasticity. The model without use of cross product of regressors is tested. After the testing the results are displayed in the console window.

See also:

IMsWhiteHeteroskedasticityTestSettings