check.homog {cta}R Documentation

ZZ Homogeneity Check

Description

Checks whether the constraint function h()h(\cdot) satisfies a necessary condition for ZZ homogeneity.

Usage

check.homog(h.fct, Z, tol = NULL)

Arguments

h.fct

An R function object, indicating the constraint function h()h(\cdot) for ZZ homogeneity check.

Z

Population (aka strata) matrix ZZ.

tol

The pre-set tolerance with which norm(diff) is to be compared with.

Details

The main idea:

h()h(\cdot) is ZZ homogeneous if h(Diag(Zγ)x)=G(γ)h(x)h(Diag(Z\gamma)x) = G(\gamma)h(x), where GG is a diagonal matrix with γ\gamma elements raised to some power.

As a check, if h()h(\cdot) is homogeneous then

h(Diag(Zγ)x1)/h(Diag(Zγ)x2)=h(x1)/h(x2);h(Diag(Z\gamma) x_{1}) / h(Diag(Z\gamma) x_{2}) = h(x_{1}) / h(x_{2});

That is,

diff=h(Diag(Zγ)x1)h(x2)h(Diag(Zγ)x2)h(x1)=0.\texttt{diff} = h(Diag(Z\gamma) x_{1}) h(x_{2}) - h(Diag(Z\gamma) x_{2}) h(x_{1}) = 0.

Here, the division and multiplication are taken element-wise.

This program randomly generates gamma, x1, and x2, and computes norm(diff). It returns a warning if norm(diff) is too far from 00.

Value

check.homog returns a character string chk that states whether h()h(\cdot) is ZZ homogeneous. If chk = "", it means that based on the necessary condition, we cannot state that h()h(\cdot) is not ZZ homogeneous.

Author(s)

Joseph B. Lang

References

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

See Also

check.zero.order.homog, mph.fit, check.HLP

Examples

# EXAMPLE 1
h.fct <- function(m) {m[1] - m[2]}
Z <- matrix(c(1, 1), nrow = 2)
check.homog(h.fct, Z)

# EXAMPLE 2
h.fct.2 <- function(m) {m[1]^2 - m[2]}
Z <- matrix(c(1, 1), nrow = 2)
check.homog(h.fct.2, Z)

[Package cta version 1.3.0 Index]