MLESettings: 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 links to the Stat system assembly.
Sub UserProc;
Var
distr: ISmGeneralizedExtremeValueDistribution;
i: Integer;
Values: Array Of Double;
cnt: Integer = 10;
Begin
distr := New SmGeneralizedExtremeValueDistribution.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;
// autoselection of parameters of distribution using the LRS method (Linear Ratio of Spacings):
distr.LRSFitting(Values);
// estimation of parameters using method of maximum likelihood:
distr.MaximumLikelihoodFitting(Values);
// 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;
After executing the example the sample of pseudo-random values is generated, that have the GEV distribution (0,1; 0,1; 0,1).
See also:
ISmGeneralizedExtremeValueDistribution | Estimation by the method of maximum likelihood