ITsInversionInfo.K

Fore syntax

K: Integer;

Fore.NET syntax

K: integer;

Description

The K property determines parameter of calculation by the k-sigma method.

Comments

This property is taken into account if ITsInversionInfo.Inversion = TsInversion.OA.

The parameter can take only positive values. Default value is 3.

Fore example

Executing the example requires a modeling container with the CONT_MODEL identifier in the repository. The container must include a model of linear regression listing several factors and identified as MODEL. Add links to the Metabase, Ms, Transform, Stat system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    MsDescr: IMetabaseObjectDescriptor;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Method: IMsMethod;
    InvInfo: ITsInversionInfo;
    Linear: IMsLinearRegressionTransform;
    Explanatories: IMsCompositeFormulaTermList;
    Term: IMsCompositeFormulaTerm;
Begin
    mb := MetabaseClass.Active;
    MsDescr := mb.ItemById("CONT_MODEL");
    Model := mb.ItemByIdNamespace("MODEL", MsDescr.Key).Edit As IMsModel;
    Transform := Model.Transform;
    Method := Transform.FormulaItem(0).Method;
// Assigning initial transformation to the modelling variable
    InvInfo := Method.InversionInfo;
    InvInfo.Inversion := TsInversion.SA;
    InvInfo.Seasonality := SeasonalityType.Additive;
//  Assigning initial transformation of the factor
    Linear := Method As IMsLinearRegressionTransform;
    Explanatories := Linear.Explanatories;
    If Explanatories.Count > 0 Then
        Term := Explanatories.Item(0);
        InvInfo := Term.InversionInfo;
        InvInfo.Inversion := TsInversion.OA;
        InvInfo.K := 2;
    End If;
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing this example the initial transformation of the modeling variable and the first factor for the model is changed.

Fore.NET example

Executing the example requires a modeling container with the CONT_MODEL identifier in repository. The container must include a model of linear regression listing several factors and identified as MODEL.

Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Stat;
Imports Prognoz.Platform.Interop.Transform;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    MsDescr: IMetabaseObjectDescriptor;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Method: IMsMethod;
    InvInfo: ITsInversionInfo;
    Linear: IMsLinearRegressionTransform;
    Explanatories: IMsCompositeFormulaTermList;
    Term: IMsCompositeFormulaTerm;
Begin
    mb := Params.Metabase;
MsDescr := mb.ItemById["CONT_MODEL"];
    Model := mb.ItemByIdNamespace["MODEL", MsDescr.Key].Edit() As IMsModel;
    Transform := Model.Transform;
    Method := Transform.FormulaItem[0].Method;
// Assigning initial transformation to the modelling variable  
    InvInfo := Method.InversionInfo;
    InvInfo.Inversion := TsInversion.tsiSA;
    InvInfo.Seasonality := SeasonalityType.sstAdditive;
//  Assigning initial transformation of the factor
    Linear := Method As IMsLinearRegressionTransform;
    Explanatories := Linear.Explanatories;
    If Explanatories.Count > 0 Then
        Term := Explanatories.Item[0];
        InvInfo := Term.InversionInfo;
        InvInfo.Inversion := TsInversion.tsiOA;
        InvInfo.K := 2;
    End If;
    (Model As IMetabaseObject).Save();
End Sub;

After executing this example the initial transformation of the modeling variable and the first factor for the model is changed.

See also:

ITsInversionInfo