K: Integer;
K: integer;
The K property determines parameter of calculation by the k-sigma method.
The property is taken into account if ITsInversionInfo.Inversion = TsInversion.OA.
The parameter can take only positive values. The default value is 3.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. The container must include a model of linear regression with the MODEL identifier containing several factors. 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;
// Set initial transformation to modelling variable
InvInfo := Method.InversionInfo;
InvInfo.Inversion := TsInversion.SA;
InvInfo.Seasonality := SeasonalityType.Additive;
// Set initial transformation of 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 the example the initial transformation of the modeling variable and the first factor for the model is changed.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. The container must include a model of linear regression with the MODEL identifier containing several factors.
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;
// Set initial transformation to modelling variable
InvInfo := Method.InversionInfo;
InvInfo.Inversion := TsInversion.tsiSA;
InvInfo.Seasonality := SeasonalityType.sstAdditive;
// Set initial transformation of 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 the example the initial transformation of the modeling variable and the first factor for the model is changed.
See also: