computeFrac: Numerical weighting functions

View source: R/computeFrac.R

computeLinearR Documentation

Numerical weighting functions

Description

Customize weight-updating within factor levels in case of numerical calibration. The functions described here serve as inputs for ipf.

Usage

computeLinear(curValue, target, x, w, boundLinear = 10)

computeLinearG1(curValue, target, x, w, boundLinear = 10)

computeFrac(curValue, target, x, w)

Arguments

curValue

Current summed up value. Same as sum(x*w)

target

Target value. An element of conP in ipf

x

Vector of numeric values to be calibrated against

w

Vector of weights

boundLinear

The output f will satisfy 1/boundLinear <= f <= boundLinear. See bound in ipf

Details

computeFrac provides the "standard" IPU updating scheme given as

f = target/curValue

which means that each weight inside the level will be multtiplied by the same factor when doing the actual update step (w := f*w). computeLinear on the other hand calculates f as

fi = a ยท xi + b

where a and b are chosen, so f satisfies the following two equations.

โˆ‘ fi wi xi = target
โˆ‘ fi wi = โˆ‘ wi

computeLinearG1 calculates f in the same way as computeLinear, but if f_i*w_i<1 f_i will be set to 1/w_i.

Value

A weight multiplier f


surveysd documentation built on Dec. 28, 2022, 2:15 a.m.