vcov.mipfp: Calculate variance-covariance matrix for mipfp objects

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

View source: R/s3_mipfp.R

Description

This function determines the (asymptotic) covariance matrix of the estimates in an mipfp object using either the Delta formula designed by Little and Wu (1991) or Lang's formula (2004).

Usage

1
2
3
## S3 method for class 'mipfp'
vcov(object, method.cov = "delta", seed = NULL, 
     target.data = NULL, target.list = NULL, replace.zeros = 1e-10, ...)

Arguments

object

An object of class mipfp.

method.cov

Select the method to use for the computation of the covariance. The available methods are delta and lang.

seed

The initial multi-dimensional array used to create object (optional).

target.data

A list containing the data of the target margins used to create object. Each component of the list is an array storing a margin. The list order must follow the one defined in target.list (optional).

target.list

A list of the target margins used to create object function. Each component of the list is an array whose cells indicates which dimension the corresponding margin relates to (optional).

replace.zeros

If 0-cells are to be found, then their values are replaced with this value.

...

Not used.

Details

The asymptotic covariance matrix of the estimates probabilities using Delta's formula 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

If the estimation process has been done using

where p.hat is the vector of estimated probabilities and p.seed is the vector of the seed probabilities.

Using Lang's formula (2004), the covariance matrix becomes

1/N (D - p.hat * t(p.hat) - D * H * inv(t(H) * D * H) * t(H) * D)

where

Value

A list with the following components:

x.hat.cov

A covariance matrix of the estimated counts (last index move fastest) computed using the method specified in cov.method.

p.hat.cov

A covariance matrix of the estimated probabilities (last index move fastest) computed using the method specified in cov.method.

x.hat.se

The standard deviation of the estimated counts (last index move fastest) computed using the method specified in cov.method.

p.hat.se

The standard deviation of the estimated probabilities (last index move fastest) computed using the method specified in cov.method.

df

Degrees of freedom of the estimates.

method.cov

The method used to compute the covariance matrix.

Author(s)

Johan Barthelemy.

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

References

Lang, J.B. (2004) Multinomial-Poisson homogeneous models for contingency tables. Annals of Statistics 32(1): 340-383.

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

Estimate function to create an object of class mipfp and 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
# 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 Estimate function
res <- Estimate(seed, target.list, target.data)
# printing the variance-covariance matrix
print(vcov(res))

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