Series: IEmSeriesList;
Series: Prognoz.Platform.Interop.Modeller.IEmSeriesList;
The Series property returns the source series set.
At least two source series must be set for the correct calculation of the partial correlation coefficients.
To execute the example, add a link to the Modeller system assembly.
Sub PartialCorrelation;
Var
ExprMod: IExpressModeller;
Ar: Array[14] Of Double;
Serie: IEmSerie;
Sett: IEmPartialCorrelationSettings;
SList: IEmSeriesList;
Begin
ExprMod := New ExpressModeller.Create;
Sett := ExprMod.CreatePartialCorrelationSettings;
// Setting initial series set
Ar[0] := 56; Ar[1] := 45; Ar[2] := 23; Ar[3] := 45;
Ar[4] := 65; Ar[5] := 23; Ar[6] := 54; Ar[7] := 87;
Ar[8] := 67; Ar[9] := 98; Ar[10] := 89; Ar[13] := 79;
Ar[11] := Double.Nan; Ar[12] := Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X1", "Data series 1");
SList := Sett.Series;
SList.Add(Serie);
Ar[0] := 4; Ar[1] := 5; Ar[2] := 2; Ar[4] := 7;
Ar[5] := 2; Ar[6] := 6; Ar[7] := 15; Ar[8] := 14;
Ar[10] := 24; Ar[11] := 10; Ar[12] := 24; Ar[13] := 31;
Ar[3] := Double.Nan; Ar[9] := Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X2", "Data series 2");
SList.Add(Serie);
// Setting outer series
Ar[0] := 2.7; Ar[1] := 6.1; Ar[2] := 9.6; Ar[3] := 9.5;
Ar[4] := 7.7; Ar[5] := 5.9; Ar[6] := 5.1; Ar[7] := 2.5;
Ar[8] := 7.1; Ar[9] := 9.9; Ar[12] := 8.2; Ar[13] := 5.1;
Ar[10] := Double.Nan; Ar[11] := Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X3", "Data series 3");
SList := Sett.OuterSeries;
SList.Add(Serie);
// Setting weights series
Ar[0] := 13; Ar[1] := 27; Ar[2] := 45; Ar[3] := 13;
Ar[4] := 67; Ar[5] := 85; Ar[6] := 33; Ar[7] := 57;
Ar[8] := 15; Ar[9] := 83; Ar[10] := 37; Ar[11] := 45;
Ar[12] := 53; Ar[13] := 07;
Serie := ExprMod.Series.Add(Ar, "X4", "Weights series");
Sett.Weights := Serie;
// Performing calculation
ExprMod.EvaluateMethod("C:\PartialCorrelation.html", Sett, True);
End Sub PartialCorrelation;
Example execution result: partial correlation coefficients calculation are to be calculated with set parameters, calculation report is to be saved to the file C:\PartialCorrelation.html.
Imports Prognoz.Platform.Interop.Modeller;
…
Public Shared Sub PartialCorrelation();
Var
ExprMod: IExpressModeller;
Ar: Array[14] Of Double;
Serie: IEmSerie;
Sett: IEmPartialCorrelationSettings;
SList: IEmSeriesList;
Begin
ExprMod := New ExpressModeller.Create();
Sett := ExprMod.CreatePartialCorrelationSettings();
// Setting initial series set
Ar[0] := 56; Ar[1] := 45; Ar[2] := 23; Ar[3] := 45;
Ar[4] := 65; Ar[5] := 23; Ar[6] := 54; Ar[7] := 87;
Ar[8] := 67; Ar[9] := 98; Ar[10] := 89; Ar[13] := 79;
Ar[11] := Double.Nan; Ar[12] := Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X1", "Data series 1");
SList := Sett.Series;
SList.Add(Serie);
Ar[0] := 4; Ar[1] := 5; Ar[2] := 2; Ar[4] := 7;
Ar[5] := 2; Ar[6] := 6; Ar[7] := 15; Ar[8] := 14;
Ar[10] := 24; Ar[11] := 10; Ar[12] := 24; Ar[13] := 31;
Ar[3] := Double.Nan; Ar[9] := Double.Nan;
SList.Add(Serie);
// Setting outer series
Serie := ExprMod.Series.Add(Ar, "X2", "Data series 2");
Ar[0] := 2.7; Ar[1] := 6.1; Ar[2] := 9.6; Ar[3] := 9.5;
Ar[4] := 7.7; Ar[5] := 5.9; Ar[6] := 5.1; Ar[7] := 2.5;
Ar[8] := 7.1; Ar[9] := 9.9; Ar[12] := 8.2; Ar[13] := 5.1;
Ar[10] := Double.Nan; Ar[11] := Double.Nan;
Serie := ExprMod.Series.Add(Ar, "X3", "Data series 3");
SList := Sett.OuterSeries;
SList.Add(Serie);
// Setting weights series
Ar[0] := 13; Ar[1] := 27; Ar[2] := 45; Ar[3] := 13;
Ar[4] := 67; Ar[5] := 85; Ar[6] := 33; Ar[7] := 57;
Ar[8] := 15; Ar[9] := 83; Ar[10] := 37; Ar[11] := 45;
Ar[12] := 53; Ar[13] := 07;
Serie := ExprMod.Series.Add(Ar, "X4", "Weights series");
Sett.Weights := Serie;
// Performing calculation
ExprMod.EvaluateMethod("C:\PartialCorrelation.html", Sett, True);
End Sub PartialCorrelation;
Example execution result: partial correlation coefficients calculation are to be calculated with set parameters, calculation report is to be saved to the file C:\PartialCorrelation.html.
See also: