MLESettings: IMLESettings;
MLESettings: Prognoz.Platform.Interop.Stat.IMLESettings;
The MLESettings property determines parameters of the maximum likelihood method.
The maximum likelihood method is used to estimate unknown parameters.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
distr: ISmGeneralizedParetoDistribution;
i: Integer;
Values: Array Of Double;
cnt: Integer = 10;
Begin
distr := New SmGeneralizedParetoDistribution.Create;
// set distribution parameters:
distr.Location := 0.1;
distr.Scale := 0.1;
distr.Shape := 0.1;
// generating random series:
Values := distr.RandomVector(cnt);
// set maximum number of iterations:
distr.MLESettings.MaxIterations := 10;
// set accuracy of solution:
distr.MLESettings.Tolerance := 0.000000001;
// displaying error messages
Debug.WriteLine(distr.Errors);
// displaying parameters of shift, scale, form:
Debug.WriteLine(distr.Name + "(" + distr.Location.ToString + "," + distr.Scale.ToString + "," + distr.Shape.ToString + ")");
Debug.WriteLine("Generated series:");
Debug.Indent;
For i := 0 To Cnt - 1 Do
Debug.Write(i.ToString + " ");
Debug.WriteLine(Values[i].ToString);
End For;
Debug.Unindent;
End Sub UserProc;
Executing the example generates the sample of pseudo-random values, that have the GPD distribution (0,1; 0,1; 0,1).
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
distr: ISmGeneralizedParetoDistribution;
i: integer;
Values: System.Array;
cnt: Integer = 10;
Begin
distr := New SmGeneralizedParetoDistribution.Create();
// set distribution parameters:
distr.Location := 0.1;
distr.Scale := 0.1;
distr.Shape := 0.1;
// generating random series:
Values := distr.RandomVector(cnt);
// set maximum number of iterations:
distr.MLESettings.MaxIterations := 10;
// set accuracy of solution:
distr.MLESettings.Tolerance := 0.000000001;
// displaying error messages
System.Diagnostics.Debug.WriteLine(distr.Errors);
// displaying parameters of shift, scale, form:
System.Diagnostics.Debug.WriteLine(distr.Name + "(" + distr.Location.ToString() + "," + distr.Scale.ToString() + "," + distr.Shape.ToString() + ")");
System.Diagnostics.Debug.WriteLine("Generated series:");
System.Diagnostics.Debug.Indent();
For i := 0 To Cnt - 1 Do
System.Diagnostics.Debug.Write(i.ToString() + " ");
System.Diagnostics.Debug.WriteLine(Values[i].ToString());
End For;
System.Diagnostics.Debug.Unindent();
End Sub;
See also:
ISmGeneralizedParetoDistribution | Estimation by the method of maximum likelihood