ipf.gamma {gIPFrm} | R Documentation |
Iterative Proportional Fitting in Relational Models, with a Given Adjustment Factor
Description
For a given model matrix and a given vector of observed cell frequencies,
ipf.gamma
computes the vector of frequencies whose subset sums are equal
to the observed subset sums times the adjustment factor and whose
relative frequencies satisfy the multiplicative structure prescribed by
the model.
Usage
ipf.gamma(ModelMatrix, ObsTable, gamma, tol, estimand)
Arguments
ModelMatrix |
an |
ObsTable |
a vector of observed cell frequencies. |
gamma |
an adjustment factor. |
tol |
tolerance used in stopping criteria. |
estimand |
set to |
Value
model.matrix |
the model matrix. |
observed.data |
the vector of observed cell frequencies. |
fitted.values |
the estimated cell frequencies. |
model.parameters |
the estimated model parameters on the multiplicative scale. |
Author(s)
Anna Klimova, Tamas Rudas
References
A.Klimova, T.Rudas, A.Dobra, Relational models for contingency tables. J. Multivariate Anal., 2012, 104, 159–173.
A.Klimova, T.Rudas, Iterative proportional scaling for curved exponential families. Scand. J. Statist., 2015, 42, 832–847.
A. Klimova, Coordinate-Free Exponential Families on Contingency Tables. PhD thesis. Advisers: Tamas Rudas and Thomas Richardson.
Examples
## The model of independence for a 2 by 2 contingency table
A = matrix(c( 1,1,0,0,
0,0,1,1,
1,0,1,0,
0,1,0,1), byrow=TRUE, nrow=4) ## the model matrix
y = c(1,2,3,4) ## the observed data
ipf.gamma(A, y, 1, 1e-6, "intensities") ## Adjustment factor is set to 1
ipf.gamma(A, y, 0.5, 1e-6, "intensities") ## Adjustment factor is set to 0.5