ipf: Iterative Proportional Fitting (ipf)

View source: R/iterativeproportionalfitting.R

ipfR Documentation

Iterative Proportional Fitting (ipf)

Description

Iterative Proportional Fitting (ipf)

Usage

ipf(
  X = matrix(),
  Xhat = matrix(0.5, nrow = nrow(X), ncol = ncol(X)),
  Delta = 1,
  func = function(i, j, A, B, Delta) {
     1
 },
  anchor = NULL,
  v = 1
)

Arguments

X

A matrix, e.g. of persons responses (rows) to items (columns)

Xhat

Initial values of the solution (optional). Defaults to 0.5 in all cells

Delta

Interaction parameters. A matrix or scalar. Defaults to 1.

func

A function of parameters i, j (row and column numbers), A, B (current estimations), and Delta.

anchor

A function to anchor A or B estimates. Defaults to NULL.

v

Verbose level (0: none, 1: progression, 2: verbose)

Details

This function does the estimation. Used by specific estimation functions.

Value

Returns a list of estimates Ahat, Bhat, and Xhat

Author(s)

Jeppe Bundsgaard & Svend Kreiner

References

Svend Kreiner (manuscript, 2023). Appendix H - Estimation of Rasch parameters by iterative proportional fitting.

Examples

X<-matrix(data=c(0,0,0,1,1,1,0,1,0,0,0,1,

jeppebundsgaard/RDigram documentation built on Oct. 29, 2023, 7:15 p.m.