How do you know how much to scale?

Top  Previous  Next

In scaling the goal should be to reduce the coefficient absolute value range as discussed above so all numbers in the constraint matrix of the model are between 0.1 and 100.  (Note that models with more disparate coefficients will work.)  The steps to scaling I recommend follow

I.Examine the model first on a block-by-block basis where a block is all the set cases associated with each variable declared in the VARIABLES statements and each case for each equation declared in the EQUATIONS statements.  For each block discover variables and/or constraints with absolute value maximum or minimum coefficients significantly departing from one. You can use LIMROW and LIMCOL but this is not very efficient.  Use of GAMSCHK BLOCKPIC and BLOCKLIST is generally more efficient.
II.Develop positive scaling factors for the blocks that when employed will alter median coefficients to one concentrating on either variables or equations but ordinarily not both.
For example, when all coefficients associated with a variable block exceed an absolute value of one (e.g. 5 to 50), then enter a variable scale factor to divide all coefficients so the median is close to one (e.g. 25).
Simultaneously use problem knowledge to scale associated variable and/or equation blocks that should be in same units if at all possible (e.g. if you are scaling water available then scale the water sales variables by the same amount).  If you don't use such knowledge you will not do any better than the solver.
III.Tell GAMS to scale with those factors.
IV.Examine the block scaling characteristics after scaling.  If there are items with high or low scaling across entire blocks then iteratively work over the variables and equations until the coefficients converge in value.If the block scaling is all centered on one then proceed to individual variable and equation scaling.  Here use the same steps as above employing LIMROW and LIMCOL, or GAMSCHK MATCHIT,  PICTURE or DISPLAYCR to obtain data on model item scaling characteristics.

scalegck.gms provides an example.