IpfpCov: Covariance matrix of the estimators produced by Ipfp...

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

View source: R/deprecated.R

Description

This function determines the (asymptotic) covariance matrix of the estimates produced by the iterative proportional fitting procedure using the formula designed by Little and Wu (1991).

Usage

1
IpfpCov(estimate, seed, target.list, replace.zeros = 1e-10)

Arguments

estimate

The array of estimates produced by the Ipfp function.

seed

The intial array (seed) that was updated by the Ipfp function.

target.list

A list of dimensions of the marginal target constrains. Each component of the list is an array whose cells indicate which dimension the corresponding margin relates to.

replace.zeros

If a cell of the estimate or the seed has a value equals to 0, then it is replaced with this value. Default is 1e-10.

Details

The asymptotic covariance matrix of the estimates produced by the iterative proportional fitting procedure has the form (Little and Wu, 1991)

K * inv(t(K) * inv(D1) * K) * t(K) * inv(D2) * K * inv(t(K) * inv(D1) * K) * t(K)

where

Value

A matrix of dimension length(estimate) x length(estimate) of the asymptotic variance of the proportion estimates produced by Ipfp.

Warning

Note: this function is deprecated, instead use vcov.mipfp.

Author(s)

Johan Barthelemy.

Maintainer: Johan Barthelemy johan@uow.edu.au.

References

Little, R. J., Wu, M. M. (1991) Models for contingency tables with known margins when target and seed populations differ. Journal of the American Statistical Association 86 (413): 87-95.

See Also

Ipfp function to update an initial multidimensional array with respect to given constraints.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# true contingency (2-way) table
true.table <- array(c(43, 44, 9, 4), dim = c(2, 2))
# generation of sample, i.e. the seed to be updated
seed <- ceiling(true.table / 10)
# desired targets (margins)
target.row <- apply(true.table, 2, sum)
target.col <- apply(true.table, 1, sum)
# storing the margins in a list
target.data <- list(target.col, target.row)
# list of dimensions of each marginal constrain
target.list <- list(1, 2)
# calling the Ipfp function
res <- Ipfp(seed, target.list, target.data)
# computation of the covariance matrix of the produced estimated probabilities
res.cov <- IpfpCov(res$x.hat, seed, target.list)
# 0.95 level confidence interval of the estimates
n <- sum(res$x.hat)
# ... lower bound
ci.lb <- Array2Vector(res$x.hat) - 1.96 * sqrt(n * diag(res.cov))
# ... upperbound
ci.ub <- Array2Vector(res$x.hat) + 1.96 * sqrt(n * diag(res.cov))

Example output

Loading required package: cmm
Loading required package: Rsolnp
Loading required package: numDeriv

mipfp documentation built on May 2, 2019, 6:01 a.m.