*** UNDER CONSTRUCTION *** Provided are the S-plus functions for the paper titled "Improving power and sensitivity in multinomial goodness-of-fit tests," written by Basu, A., Surajit, R., Park, C. and Basu, S. (2000). This paper can be obtained via internet at http://www.stat.psu.edu/~cspark/m7.ps (postscript) http://www.stat.psu.edu/~cspark/m7.pdf (Adobe pdf) We assume that we throw n=# of balls into k=# of different boxes with p probability. We have the following functions: * support(n,k) generates the sample sample of multinomial (n,k) * rmultinom(n,size,size) n = sample size size = vector of (positive integer) numbers of flips for which the Multinomial distribution measures the number of each outcomes. prob = vector (matrix) of probabilities of each outcome. when matrix if nrow(prob) > 1, random vector for each row vector of prob matrix is returned. If n > nrow(prob), repeat prob matrix from 1st row vector. if sum(prob) for each row is not 1, then normalize by itself : (n,k) matrix * dmultinom(x,prob) the density at x of multinomial dist. * critical.value(stat, prob, alpha) gives critical values of size alpha proposed by Read and Cressie (1988, p.77) output: cv, alpha1, alpha2 * rpower(stat, prob, cv, alpha, alpha1, alpha2): randomized power of size alpha test * PD() generalized Power Divergence (combined and penalized version of PD) #- a=tuning parameter #- h=penalty #- a.in, a.out = in- and out-lier tuning parameter For ordinary PD, use PD(d,f,a). For penalized PD, use PD(d,f,a,h). For combined PD, use PD(d,f,a.in,a.out). For combined and penalized PD, use PD(d,f, a.in, a.out, h). * PBHM() mixture of Pearson Chisquare and blended weight Hellinger distance #- h=penalty For ordinary PBHM, use PBHM(d,f,a). For penalized PBHM, use PBHM(d,f,a,h).