InputFactorTerm: IMsFormulaTermInfo;
The InputFactorTerm property determines input term parameters.
The property is outdated, use IMsMethodSeries.Input.
Executing the example requires a form, a button with the Button1 identifier on the form, the TabSheetBox component and the UiErAnalyzer component named UiErAnalyzer1 that is used as a data source for TabSheetBox. A working area of the time series database must be loaded to UiErAnalyzer1. This time series database must include a time series with the 98280 key that contains annual data.
Click the button to start executing the example.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Laner: ILaner;
Series: ILanerSeries;
RubrIn: IRubricatorInstance;
Factor: IRubricatorFactor;
Serie: ILanerSourceSerie;
VarStub: IVariableStub;
CalcSerie: ILanerCalculateSerie;
TransformModel: IFormulaTransformModel;
FormulaTransform: IMsFormulaTransform;
Slice: IMsFormulaTransformSlice;
Selector: IMsFormulaTransformSelector;
Formula: IMsFormula;
CurveEstimation: IMsCurveEstimationTransform;
TermInfo: IMsFormulaTermInfo;
Begin
Laner := UiErAnalyzer1.ErAnalyzer.Laner;
RubrIn := Laner.RubricatorInstance;
Factor := RubrIn.GetFactData(98280).Factor;
Laner.BeginUpdate;
Series := Laner.Series;
Serie := Series.AddSourceSerie(Factor);
VarStub := Serie.Stub;
CalcSerie := Series.AddCalculateSerie("CurveEstimation");
TransformModel := CalcSerie.Transform;
TransformModel.AddInputVariable(VarStub);
FormulaTransform := TransformModel.Transform As IMsFormulaTransform;
FormulaTransform.Inputs.Add(VarStub);
Slice := FormulaTransform.Outputs.Item(0).Slices.Add(Null);
Selector := FormulaTransform.CreateSelector;
Selector.Slice := Slice;
Formula := FormulaTransform.Transform(Selector);
Formula.Kind := MsFormulaKind.CurveEstimation;
Formula.Level := DimCalendarLevel.Year;
CurveEstimation := Formula.Method As IMsCurveEstimationTransform;
Slice := FormulaTransform.Inputs.Item(0).Slices.Add(Null);
TermInfo := FormulaTransform.CreateTermInfo;
TermInfo.Slice := Slice;
CurveEstimation.InputFactorTerm := TermInfo;
CurveEstimation.DependenceFormIncluded(DependenceType.Linear) := True;
Laner.EndUpdate;
WinApplication.InformationBox(CalcSerie.SaveModel.Name);
End Sub Button1OnClick;
After executing the example a new series based on the factor with the 98280 key is added. The calculated series, calculated by the universal trend method (linear dependence) based on it is created. The calculated series is saved as a model, which name is displayed in the information message.
See also: