RAS_MATRIX


The function RAS_MATRIX lets you carry out a RAS procedure by writing a Formula in your TABLO Input file, for example:

Formula ERROR_RAS =

RAS_MATRIX(InMat,RowTgt,ColTgt,OutMat,RowMult,ColMult,50);

where inputs are

InMat (the matrix to scale) and the target totals RowTgt and ColTgt

and outputs are

OutMat (the scaled matrix) and the multiplier vectors RowMult and ColMult

The last parameter of RAS_MATRIX lets you choose how many iterations or steps are used. Each iteration is either a row scaling or a column scaling. The first and all odd-numbered iterations scale rows; even-numbered iterations scale columns. If you specify an odd number of iterations, the final iteration will be odd (a row scaling), so you can expect that the scaled (output) matrix will add up exactly to the row targets — but perhaps will not quite add up to the column targets. Conversely, if you specify an even number of iterations, column targets will be met exactly (but perhaps not row targets).

If you specify a large number of steps, the RAS may well converge: both constraints are satisfied, and so row and column multipliers stop changing. In this case, RAS_MATRIX will finish early, to save time. However, if you ask for an even number of iterations (say 100), you can be sure that the last iteration will be even (to favour column targets), even if only 40 iterations were needed. Similarly, if you ask for an odd number of iterations, RAS_MATRIX will finish with a row scaling.

back to TABLO language contents



URL of this topic: www.copsmodels.com/webhelp/tabmate/hc_rasmatrix.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage