rcl.em: Rudas-Clogg-Lindsay EM Algorithm

View source: R/rcl.em.R

rcl.emR Documentation

Rudas-Clogg-Lindsay EM Algorithm

Description

rcl.em is used to fit a two-point mixture composed of a user-supplied model of interest and an unrestricted distribution fit to a contingency table with supplied mixing proportions using the Rudas-Clogg-Lindsay (1994) EM algorithm.

Usage

rcl.em(pi_out, FNEM, data, max_dif = .Machine$double.neg.eps, 
       zeta = 1, lr_only = TRUE, chi_stat = 0, 
       lr_eps = .Machine$double.neg.eps^0.25)

Arguments

pi_out

out-of-model proportion, i.e. the mixing weight of the unrestricted component

FNEM

user-supplied function that estimates the model of interests. Must input only the observed values as a contingency table. Must output the predicted values as a contingency table as item named "fit" in a named list. Optionally can output parameter estimates of interest as a vector named "param" in the outputed named list.

data

a contingency table.

max_dif

largest acceptable difference, i.e. the largest number practically indistinguishable from 0.

zeta

weighing constant; default is 1. The EM algorithm might crash due to very low cell values; in such case increasing the zeta might help.

lr_only

logical: return only the value of the log-likelihood ratio statistic?

chi_stat

Chi squared statistic penalty; default 0. Supply a different value e.g. if you want to find the lower endpoint of a one-sided confidence interval for pi*.

lr_eps

penalty for finding pi*, the largest small positive number that can be still considered practically indistinguishable from 0.

Value

A named list with the following components: (if lr_only is TRUE then the list contains only the "lr" component)

pi_out

the out-of-model proportion, i.e. the mixing weight of the unrestricted component

param

a vector of the estimated parameter values fit to an unscaled model density, i.e. to M and not (1-pi) x M.

lr

general contingency table log-likelihood ratio statistic for the two-point mixture.

model

scaled density of predicted values following the model of interest, i.e. (1-pi) x M.

unrestricted

Scaled density of predicted values following unrestricted component, i.e. pi x U

predicted

values predicted by the two-point mixture, i.e. (1-pi) x M + pi x U.

Author(s)

Juraj Medzihorsky

Developed from J.M.Grego's functions, see ‘References’

References

Rudas, T., Clogg, C. C., Lindsay, B. G. (1994) A New Index of Fit Based on Mixture Methods for the Analysis of Contingency Tables. Journal of the Royal Statistical Society. Series B (Methodological), Vol. 56, No. 4, 623-639.

Grego, J. M. clr and clr.root functions available at http://www.stat.sc.edu/~grego/courses/stat770/CLR.txt

See Also

pistar.ct


jmedzihorsky/pistar documentation built on June 4, 2022, 9:58 a.m.