InitValues: Array;
The InitValues property determines initial approximations of model coefficients.
If no vector is specified, 1 is selected as initial approximations.
Vector length for ARMA-coefficients equals to (1+p+q), where:
p - autoregression order (ISmGARCH.AutoRegressionOrder).
q - moving average order (ISmGARCH.MovingAverageOrder).
Vector length for regression coefficient equals to:
k, if a model with a constant is analyzed;
(k+1), if a model without a constant is analyzed.
Where k- the number of regressors (ISmGARCH.Explanatories).
Sub Main;
Var
GARCH: ISmGARCH;
x,y1,y2,Init: Array Of Double;
Res,i: Integer;
d: Double;
ARMAC,RegC: IGARCHCoefficients;
Begin
x := New Double[11];
y1 := New Double[16];
y2 := New Double[16];
//values x, y1, y2
x[0] := 100; y1[0] := 120; y2[0] := 122;
x[1] := 111; y1[1] := 125; y2[1] := 127;
x[2] := 123; y1[2] := 124; y2[2] := 130;
x[3] := 113; y1[3] := 130; y2[3] := 135;
x[4] := 119; y1[4] := 133; y2[4] := 140;
x[5] := 121; y1[5] := 129; y2[5] := 149;
x[6] := 125; y1[6] := 139; y2[6] := 150;
x[7] := 131; y1[7] := 140; y2[7] := 155;
x[8] := 131; y1[8] := 140; y2[8] := 155;
x[9] := 131; y1[9] := 140; y2[9] := 155;
x[10] := 142; y1[10] := 129; y2[10] := 149;
y1[11] := 139; y2[11] := 150;
y1[12] := 140; y2[12] := 155;
y1[13] := 134; y2[13] := 145;
y1[14] := 140; y2[14] := 165;
y1[15] := 129; y2[15] := 149;
GARCH := New SmGARCH.Create;
GARCH.Explained.Value := x;
GARCH.Explanatories.Add.Value := y1;
GARCH.Explanatories.Add.Value := y2;
GARCH.ModelPeriod.FirstPoint := 1;
GARCH.ModelPeriod.LastPoint := 11;
GARCH.Forecast.LastPoint := 15;
GARCH.Intercept.Mode := InterceptMode.AutoEstimate;
GARCH.ModelType := GARCHModelType.TypeI;
GARCH.AutoRegressionOrder := 3;
GARCH.MovingAverageOrder := 2;
GARCH.StationarityCondition := False;
GARCH.MaxIteration := 150;
Init := New Double[6];
Init[0] := 0.2;
Init[1] := 1;
Init[2] := 0.5;
Init[3] := 0.8;
Init[4] := 1.3;
Init[5] := 1.6;
ARMAC := GARCH.ARMACoefficients;
ARMAC.InitValues := Init;
res := GARCH.Execute;
If res <> 0 Then
Debug.WriteLine(GARCH.Errors);
Else
Debug.WriteLine("== ARMA coefficients estimation ==");
For i := 0 To ARMAC.InitValues.Length - 1 Do
d := ARMAC.Coefficients.Estimate[i];
Debug.WriteLine(i.ToString + ", " + d.ToString);
End For;
Debug.WriteLine("== Regression coefficients estimation ==");
RegC := GARCH.RegressionCoefficients;
For i := 0 To RegC.InitValues.Length - 1 Do
d := RegC.Coefficients.Estimate[i];
Debug.WriteLine(i.ToString + ", " + d.ToString);
End For;
End If;
End Sub Main;
After executing the example the console window displays coefficient estimations:
Module execution started
== ARMA coefficients estimation ==
0, 0.21271123327342933
1, 9.9999994396249292E-011
2, 1.000000013351432E-010
3, 0.19893715189063599
4, 0.52530538384700975
5, 0.32578877310458132
== Regression coefficients estimation ==
0, -0.73080077102652963
1, 1.1615116261713092
Module execution finished
See also: