RAS: Generalized RAS procedure. Takes an initial matrix, a target...

View source: R/UtilityFunctions.R

RASR Documentation

Generalized RAS procedure. Takes an initial matrix, a target row sum vector and target colsum vector. Iterates until all row sums of matrix equal to target row sum vector and colsums of matrix equal target col sum vector, within a tolerance.

Description

Generalized RAS procedure. Takes an initial matrix, a target row sum vector and target colsum vector. Iterates until all row sums of matrix equal to target row sum vector and colsums of matrix equal target col sum vector, within a tolerance.

Usage

RAS(m0, t_r, t_c, t, max_itr = 1e+06)

Arguments

m0

A matrix object.

t_r

A vector setting the target row sums of the matrix.

t_c

A vector setting the target column sums of the matrix.

t

A numeric value setting the tolerance of RAS.

max_itr

A numeric value setting the maximum number of iterations to try for convergence. Default is 1,000,000.

Value

A RAS balanced matrix.


USEPA/useeior documentation built on April 12, 2024, 1:36 p.m.