IpfpCov {mipfp} | R Documentation |
Covariance matrix of the estimators produced by Ipfp (deprecated)
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
IpfpCov(estimate, seed, target.list, replace.zeros = 1e-10)
Arguments
estimate |
The array of estimates produced by the |
seed |
The intial array (seed) that was updated by the
|
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 |
Details
The asymptotic covariance matrix of the estimates produced by the iterative proportional fitting procedure has the form (Little and Wu, 1991)
K(K^T D1^{-1} K)^{-1} K^T D2^{-1} K (K^T D1^{-1} K)^{-1} K^T
where
K
is the orthogonal complement of the marginal matrix, i.e. the matrix required to obtain the marginal frequencies;D1
is a diagonal matrix of the estimates probabilities;D2
is a diagonal matrix of the seed probabilities.
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
# 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))