doGRAS: Do the GRAS algorithm for updating matrizes

Description Usage Arguments Value Author(s) References Examples

Description

This function calculates an updated matrix X, based on a matrix A, which meets the given row and columns totals. Note: A can contain negative elements.

Usage

1
doGRAS(A, u, v, epsilon = 0.0000000001, maxiter = 1000L, verbose = FALSE)

Arguments

A

the "base" matrix

u

column vector with the row totals

v

row vector with the column totals

epsilon

the error tolerance level, default is 1e-10.

maxiter

maximum number of iterations, default is 10000.

verbose

should some information of the iterations be displayed? Default is FALSE

Value

the updated matrix X

Author(s)

Oliver Reiter

References

Junius T. and J. Oosterhaven (2003), The solution of updating or regionalizing a matrix with both positive and negative entries, Economic Systems Research, 15, pp. 87-96.

Lenzen M., R. Wood and B. Gallego (2007), Some comments on the GRAS method, Economic Systems Research, 19, pp. 461-465.

Temurshoev, U., R.E. Miller and M.C. Bouwmeester (2013), A note on the GRAS method, Economic Systems Research, 25, pp. 361-367.

Examples

1
2
3
4
5
6
## example from the papers
A <- matrix(c(7, 3, 5, -3, 2, 9, 8, 0, -2, 0, 2, 0),
            ncol = 4, nrow = 3, byrow = TRUE)
u <- c(15, 26, -1)
v <- c(9, 16, 17, -2)
doGRAS(A, u, v)

zauster/riot documentation built on May 4, 2019, 9:12 p.m.