ipfR Documentation

(Weighted) iterative proportional fitting

Description

(Weighted) iterative proportional fitting (IPF)

Usage

## Standard implementation
ipf(bottomMargin, rightMargin, maxit = 100, tol = 1e-4)

## with weights
ipf_weighted(bottomMargin, rightMargin, weights, maxit = 100, tol = 1e-4)

Arguments

bottomMargin

numeric vector

rightMargin

numeric vector

weights

numeric vector (only use in ipf_weighted)

maxit

maximal number of iterations (default: 100)

tol

numerical tolerance (default: 1e-4)

Details

Function ipf is an implementation of the iterative proportional fitting method of Deming and Stephan (1940) using a factor-estimation approach (cf. Batten and Boyce, 1986). Function ipf_weighted implements a weighted IPF method.

Value

A matrix with dimensions: length(rightMargin) times length(bottomMargin)

warning

You must not call this function unless you really know how it works! Also, the function does not check whether the provided arguments are meaningful. It is the user's responsibility to make sure that the arguments are properly specified.

Author(s)

Tobias Schoch

References