4.1 Computing Surrogates Using Weight Functions

The Need for Weight Functions

Surrogates have become more complex in recent years. The EPA maintains a record of recent surrogate creation efforts at www.epa.gov/ttn/chief/emch/spatial/newsurrogate.html. A quick survey of those surrogates reveals the high level of complexity involved in their generation. A good example of computing a surrogate based on a function is the surrogate for industrial space, which uses the sum of the IND1+IND2+IND3+IND4+IND5+IND6 attributes from each census tract. When all of the attribute values used in the computation of the surrogate weight have the same units and reside in a single shapefile, such as in the industrial space example just listed, the corresponding surrogates can be computed using the new weight function feature described here. In other cases, when the attributes to be used for the surrogate weight are in different shapefiles, or when they have different units (e.g., the weighted roadway miles and population surrogate 0.75*length+0.25*pop), the weight function feature cannot be used and the the Java based SurrogateTool should be used instead. Note that more information on creating surrogates without weight functions is given in the Generating Surrogates from Weight Shapefiles section.

To create a surrogate using a weight function, start with the weighted_surrogate script and customize it to meet your needs. For example, be sure that WEIGHT_FILE_NAME, OUTPUT_FILE_NAME, and SURROGATE_ID are set appropriately for the new output surrogate. The variables in the weighted_surrogate script that are different from those in the generate_surrogates script (which generates surrogates without weight functions) are the following:

As discussed in Section 4, the WEIGHT_ATTR_LIST variable is usually set to the attribute name in the weighted polygon shapefile used to create the surrogate. When you wish to use a weight function, you must instead specify the value USE_FUNCTION and the additional variable WEIGHT_FUNCTION that specifies the actual function to apply.

2. Weight Function Syntax

The weight function can be any arithmetic equation containing the operators +, -, *, /, (, ), numeric constants, and names of attributes that exist in the weight shapefile. Exponential notation and power functions are not currently supported, nor are unary negative numbers used as constants (e.g., X1 + -5 should be X1 - 5). Examples of acceptable weight functions are:


WEIGHT_FUNCTION=(IND1+IND2+IND3+IND4+IND5) 



WEIGHT_FUNCTION=0.75*urban+0.25*rural

Parentheses can be used to change the order of operation. Nested or spurious parentheses used for readability will pose no problems. Each left parenthesis must have a matching right parenthesis or an error will be generated and the program will exit. It is the responsibility of the user to enter the correct attribute names for the shapefile being used. The attributes used in the weight function must be numeric (i.e., floating point or integer) data types. The use of string attributes such as county name or road type is not allowed. No limit to the length of the WEIGHT_FUNCTION is imposed by the program.


To Section 4.2: More About Generating Surrogates Using Srgcreate