g.ipf: Generalized Iterative Proportional Fitting for Relational...

Description Usage Arguments Value Author(s) References Examples

Description

g.ipf computes the maximum likelihood estimates of the cell frequencies and of the model parameters under a relational model specified by a model matrix.

Usage

1
g.ipf(ModelMatrix, ObsTable, tol, estimand, adjustment)

Arguments

ModelMatrix

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

ObsTable

a vector of observed cell frequencies of length I.

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.

adjustment

set to "grid" if a grid is used to update the adjustment factor; set to "bisection" if the bisection method is used to update the adjustment factor; set to "none" if estimand is "intensities".

Value

model.matrix

the model matrix.

observed.data

the vector of observed cell frequencies.

fitted.values

the maximum likelihood estimates of the cell frequencies.

estimated.total

the sum of the estimated cell frequencies.

adjustment.for.total

the estimated total divided by the observed total.

adjustment.for.subsets

the adjustment factor for the subset sums.

model.parameters

the maximum likelihood estimates for model parameters on the multiplicative scale.

degrees.of.freedom

the degrees of freedom of the relational model.

chisq.statistic

Pearson's chi-squared statistic.

p.value.chisq

the p-value, based on Pearson's chi-squared statistic.

log.likelihood.ratio.statistic

the log likelihood ratio statistic.

p.value.log.likelihood.ratio.statistic

the p-value, based on the log likelihood ratio statistic.

Bregman.statistic

the Bregman statistic.

p.value.Bregman.statistic

the p-value, based on the Bregman statistic.

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.

A.Agresti, Categorical Data Analysis. Wiley, New York, 1990.

J.Aitchison, S.D.Silvey, Maximum-likelihood estimation procedures and associated tests of significance. J. Roy. Statist. Soc. Ser.B, 1960, 22, 154–171.

G.Kawamura, T.Matsuoka, T.Tajiri, M.Nishida, M.Hayashi, Effectiveness of a sugarcane-fish combination as bait in trapping swimming crabs. Fisheries Research, 1995, 22, 155–160.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
### Multiplicative model from Aitchison and Silvey (1960)

A = matrix(c(1, 0, 0, 1, 0, 1, 1, 
             0, 1, 0, 1, 1, 0, 1,
             0, 0, 1, 0, 1, 1, 1), byrow=TRUE, nrow=3) ## the model matrix 

y = c(46,24,7,15,3,4,1) ## the observed data

g.ipf(A, y, 1e-6, "probabilities", "bisection")
g.ipf(A, y, 1e-4, "probabilities", "grid")



### Bait study in swimming crabs, see Kawamura at al. (1995) :  

A = matrix(c(1,1,0,1,0,1), 2,3,byrow=TRUE) ## the model matrix

y1 = c(36,2,11)  ## the observed data for Charybdis japonica
y2 = c(71,3,44)  ## the observed data for Portunuspelagicus 

## If the model is for intensities, the adjustemnt factor is equal to one;
## the adjustment parameter is redundant.

g.ipf(A, y1, 1e-6, "intensities", "none")
g.ipf(A, y2, 1e-6, "intensities", "none")

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