IMsLinearRegressionTransform.PDLStatCoefficients

Syntax

PDLStatCoefficients(Coord: IMsFormulaTransformCoord; Index: Integer): IMsPDLCoefficients;

Parameters

Coord. Output variable slice, for which calculation is executed.

Index. Lag variable index.

Description

The PDLStatCoefficients property returns lag variable coefficients.

Comments

Before getting the coefficients, they must be identified. Use IMsStochasticMethod.Identify for it.

Example

Executing the example requires a modeling container with the CONT_MODEL identifier. The container includes a linear regression model (OLS estimation) with the MODEL identifier that contains several factors. 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;
    Term: IMsCompositeFormulaTerm;
    pPDLTerm: IMsPDLTermOptions;
    pVar: IMsFormulaTransformVariable;
    pCalc: IMsMethodCalculation;
    pCoord: IMsFormulaTransformCoord;
    PDLCoeff: IMsPDLCoefficients;
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;
    Term := pRegress.Explanatories.Item(0);
    pPDLTerm := Term.CustomOptions As IMsPDLTermOptions;
    pPDLTerm.IsPDLTerm := True;
    pPDLTerm.LagLengthK := 3;
    pPDLTerm.PolinomialDegreeP := 1;
    pPDLTerm.PDLConstraint := PDLConstraintType.Both;
    ModelObj.Save;
    pCalc := pTransform.CreateCalculation;
    pCalc.Period.IdentificationStartDate := DateTime.ComposeDay(200011);
    pCalc.Period.IdentificationEndDate := DateTime.ComposeDay(20101231);
    pCalc.Period.ForecastStartDate := DateTime.ComposeDay(201111);
    pCalc.Period.ForecastEndDate := DateTime.ComposeDay(20151231);
    pVar := pTransform.Outputs.Item(0);
    pCoord := pTransform.CreateCoord(pVar);
    pRegress.Identify(pCalc, pCoord);
    PDLCoeff := pRegress.PDLStatCoefficients(pCoord, 0);
    Debug.WriteLine("Coefficients sum: " + PDLCoeff.EstimatesSum.ToString);
    Debug.WriteLine("Standard errors sum: " + PDLCoeff.StdErrSum.ToString);
Debug.WriteLine("t-statistics sum:"+PDLCoeff.TStatSum.ToString); End Sub UserProc;

After executing the example the first regressor of the model is transformed to the lag variable. Lag, polynomial degree and constraint type are set for the variable. The model is saved, its coefficients are identified, coefficients of the created lag variable are displayed in the console window.

See also:

IMsLinearRegressionTransform