IMsRamseyRessetTestSettings.Power

Fore Syntax

Power: Integer;

Fore.NET Syntax

Power: System.Int32;

Description

The Power property determines the number of additional regressors included in a test regression.

Comments

The default value is two regressors.

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;
    RamseyResset: IMsRamseyRessetTestSettings;
    VarTrans: IMsFormulaTransformVariable;
    Calc: IMsMethodCalculation;
    Coord: IMsFormulaTransformCoord;
    Res: IMsDiagnosticTestResults;
    Stat: ISpecificationTestStatistic;
    i: 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;
// find functional form criterion
    For i := 0 To pTestList.Count - 1 Do
        Test := pTestList.Item(i);
        If Test.Type = MsDiagnosticTestType.RamseyResset Then
            RamseyResset := Test.Settings As IMsRamseyRessetTestSettings;
            Break;
        End If;
    End For;
// set number of additional regressors
    RamseyResset.Power := 3;
// 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
    Stat := Res.ChiTest;
Debug.WriteLine("--Chi-square statistic--");     Debug.Write("     Value: ");
    Debug.WriteLine(Stat.Statistic);
    Debug.Write("     Probability: ");
    Debug.WriteLine(Stat.Probability);
    Stat := Res.FTest;
Debug.WriteLine("--Fisher statistic--");     Debug.Write("     Value: ");
    Debug.WriteLine(Stat.Statistic);
    Debug.Write("     Probability: ");
    Debug.WriteLine(Stat.Probability);
End Sub UserProc;

The example describes setting up of diagnostic test parameters (functional form criterion). The model with three additional regressors is tested. After the testing the results are displayed in the console window.

See also:

IMsRamseyRessetTestSettings