SEVSELECT Procedure
Example 26.8 Estimating Parameters Using the Cramér–von Mises Estimator
The SEVSELECT procedure enables you to estimate model parameters by minimizing your own objective function. This example illustrates how you can use PROC SEVSELECT to implement the Cramér–von Mises estimator. Let denote the estimate of CDF at
for a distribution with parameters
, and let
denote the empirical estimate of CDF (EDF) at
that is computed from a sample
,
. Then, the Cramér–von Mises estimator of the parameters is defined as
This estimator belongs to the class of minimum distance estimators. It attempts to estimate the parameters such that the squared distance between the CDF and EDF estimates is minimized.
The following PROC SEVSELECT step uses the Cramér–von Mises estimator to fit four candidate distribution models, including the LOGNGPD mixed-tail distribution model that is defined in Defining a Model for Mixed-Tail Distributions. The input sample is the same one that is used in that example.
/*--- Set the search path for functions defined with PROC FCMP ---*/
options cmplib=(work.sevexmpl);
/*-------- Fit LOGNGPD model with PROC SEVSELECT by using -------
-------- the Cramer-von Mises minimum distance estimator -------*/
proc sevselect data=mylib.testmixdist objective=cvmobj print=all;
loss y;
dist logngpd burr logn gpd;
* Cramer-von Mises estimator (minimizes the distance *
* between parametric and nonparametric estimates) *;
cvmobj = (_cdf_(y) -_edf_(y))**2;
run;
The OBJECTIVE= option in the PROC SEVSELECT statement specifies that the objective function cvmobj should be minimized. The programming statements compute the contribution of each observation in the input data table to the objective function cvmobj. The use of the keyword functions _CDF_ and _EDF_ makes the program applicable to all the distributions. When PROC SEVSELECT runs on a CAS server that has more than one worker node, each worker node evaluates the _EDF_ function by using a local sample of the input data.
Some of the key results that PROC SEVSELECT produces are shown in Output 26.8.1. The "Model Selection" table indicates that all models converged. When you specify a custom objective function, the default selection criterion is the value of the custom objective function. The "All Fit Statistics" table indicates that LOGNGPD is the best distribution according to all the statistics of fit. Comparing the fit statistics of Output 26.8.1 with those of Output 26.2.1 indicates that the use of the Cramér–von Mises estimator has resulted in smaller values for all the EDF-based statistics of fit for all the models, which is expected from a minimum distance estimator.
Output 26.8.1: Summary of Cramér–von Mises Estimation
| Model Selection | |||
|---|---|---|---|
| Distribution | Converged | cvmobj | Selected |
| Logngpd | Yes | 0.12846 | Yes |
| Burr | Yes | 0.22681 | No |
| Logn | Yes | 0.16928 | No |
| Gpd | Yes | 35.98574 | No |
| All Fit Statistics | ||||||||
|---|---|---|---|---|---|---|---|---|
| Distribution | cvmobj | -2 Log Likelihood | AIC | AICC | SBC | KS | AD | CvM |
| Logngpd | 0.12846* | 3657* | 3667* | 3667* | 3691* | 0.86572* | 1.04025* | 0.12957* |
| Burr | 0.22681 | 3724 | 3730 | 3730 | 3744 | 1.01660 | 2.27060 | 0.22826 |
| Logn | 0.16928 | 3908 | 3912 | 3912 | 3922 | 0.92926 | 2.01192 | 0.16956 |
| Gpd | 35.98574 | 5401 | 5405 | 5405 | 5415 | 9.85292 | 188.93299 | 35.99968 |
| Asterisk (*) denotes the best model in the column. | ||||||||