The SEVERITY Procedure

OUTSCORELIB Statement

(Experimental)

OUTSCORELIB <OUTLIB=> fcmp-library-name options ;

The OUTSCORELIB statement specifies the library to write scoring functions to. Scoring functions enable you to easily execute a distribution function on the fitted parameters of the distribution without going through a potentially complex process of extracting the fitted parameter estimates from other output such as the OUTEST= data set that is created by PROC SEVERITY.

You must specify the following option as the first option in the statement:

OUTLIB=fcmp-library-name

names the FCMP library to contain the scoring functions. PROC SEVERITY writes the scoring functions to the FCMP library named fcmp-library-name. If a library or data set named fcmp-library-name already exists, PROC SEVERITY deletes it before proceeding.

This option is similar to the OUTLIB= option that you would specify in a PROC FCMP statement, except that fcmp-library-name must be a two-level name whereas the OUTLIB= option in the PROC FCMP statement requires a three-level name. The third level of a three-level name specifies the package to which the functions belong. You do not need to specify the package name in the fcmp-library-name, because PROC SEVERITY automatically creates the package for you. By default, a separate package is created for each distribution that has not failed to converge. Each package is named for a distribution.

For example, if you define and fit a distribution named mydist, and if mydist does not fail to converge, then PROC SEVERITY creates a package named mydist in the OUTLIB= library that you specify. Further, let the definition of the mydist distribution contain three distribution functions, mydist_PDF(x,Parm1,Parm2), mydist_LOGCDF(x,Parm1,Parm2), and mydist_XYZ(x,Parm1,Parm2). If you specify the OUTSCORELIB statement

outscorelib outlib=sasuser.scorefunc;

then the Sasuser.Scorefunc library contains the following three functions in a package named mydist: SEV_PDF(x), SEV_LOGCDF(x), and SEV_XYZ(x).

The key feature of scoring functions is that they do not require the parameter arguments (Parm1 and Parm2 in this example). The fitted parameter estimates are encoded inside the scoring function so that you can compute or score the value of each function for a given value of the loss variable without having to know or extract the parameter estimates through some other means.

For convenience, you can omit the OUTLIB= portion of the specification and just specify the name, as in the following example:

outscorelib sasuser.scorefunc;

When the SEVERITY procedure executes successfully, the fcmp-library-name is appended to the CMPLIB system option, so you can immediately start using the scoring functions in a DATA step or PROC FCMP step.

You can specify the following options in the OUTSCORELIB statement:

COMMONPACKAGE
ONEPACKAGE

requests that only one common package be created to contain all the scoring functions.

If you specify this option, then all the scoring functions are created in a package called sevfit. For each distribution function that has the name distribution_suffix, the name of the corresponding scoring function is formed as SEV_suffix_distribution. For example, the scoring function of the distribution function 'MYDIST_BAR' is named 'SEV_BAR_MYDIST'.

If you do not specify this option, then all scoring functions for a distribution are created in a package that has the same name as the distribution, and for each distribution function that has the name distribution_suffix, the name of the corresponding scoring function is formed as SEV_suffix. For example, the scoring function of the distribution function 'MYDIST_BAR' is named 'SEV_BAR'.

OUTBYID=SAS-data-set

names the output data set to contain the unique identifier for each BY group. This unique identifier is used as part of the name of the package or scoring function for each distribution. This is a required option when you specify a BY statement in PROC SEVERITY.

The OUTBYID= data set contains one observation per BY group and a variable named _ID_ in addition to the BY variables that you specify in the BY statement. The _ID_ variable contains the unique identifier for each BY group. The identifier of the BY group is the decimal representation of the sequence number of the BY group. The first BY group has an identifier of 1, the second BY group has an identifier of 2, the tenth BY group has an identifier of 10, and so on.

If you do not specify the COMMONPACKAGE option in the OUTSCORELIB statement, then for each distribution, PROC SEVERITY creates as many packages as the number of BY groups. The unique BY-group identifier is used as a suffix for the package name. For example, if your DATA= data set has three BY groups and if you specify the OUTSCORELIB statement

outscorelib outlib=sasuser.byscorefunc outbyid=sasuser.byid;

then for the distribution 'MYDIST', the Sasuser.Byscorefunc library contains the three packages 'MYDIST1', 'MYDIST2', and 'MYDIST3', and each package contains one scoring function named 'SEV_BAR' for each distribution function named 'MYDIST_BAR'.

If you specify the COMMONPACKAGE option in the OUTSCORELIB statement, PROC SEVERITY creates as many versions of the distribution function as the number of BY groups. The unique BY-group identifier is used as a suffix for the function name. Extending the previous example, if you specify the OUTSCORELIB statement with the COMMONPACKAGE option,

outscorelib outlib=sasuser.byscorefunc outbyid=sasuser.byid commonpackage;

then for the distribution function 'MYDIST_BAR' of the distribution 'MYDIST', the Sasuser.Byscorefunc library contains the following three scoring functions: 'SEV_BAR_MYDIST1', 'SEV_BAR_MYDIST2', and 'SEV_BAR_MYDIST3'. All the scoring functions are created in one common package named sevfit.

For both the preceding examples, the Sasuser.Byid data set contains three observations, one for each BY group. The value of the _ID_ variable is 1 for the first BY group, 2 for the second BY group, and 3 for the third BY group.

For more information about scoring functions, see the section Scoring Functions.