ipf.gamma: Iterative Proportional Fitting in Relational Models, with a...

Description Usage Arguments Value Author(s) References Examples

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

1
ipf.gamma(ModelMatrix, ObsTable, gamma, tol, estimand)

Arguments

ModelMatrix

an I by J model matrix of a relational model. I is the number of observations; J is the number of generating subsets.

ObsTable

a vector of observed cell frequencies.

gamma

an adjustment factor.

tol

tolerance used in stopping criteria.

estimand

set to "probabilities" in the case of multinomial sampling; set to "intensities" in the case of Poisson sampling.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 

gIPFrm documentation built on May 1, 2019, 9:16 p.m.