normalc_ function(n) { # Obtain estimated critical values for the D-Test statistic, # assuming that the mixture parameters were estimated via # unpenalized maximum likelihood. # # Scenario: # H_0: There exists mu_0 such that # p_1 f(x | mu_1, sigma^2_1 = 1) + p_2 f(x | mu_2, sigma^2_2 = 1) # may be written as f(x | mu_0, sigma^2_0 = 1). # H_1: There is no such mu_0. # # Required Input: # n is the size of the underlying data set ("sample size"). # It is assumed that n is at least 10. # # Outputs: # a01 is an estimated level 0.01 critical value for the # D-Test statistic, assuming that the mixture parameters # were estimated via unpenalized maximum likelihood, # obtained by a suitable interpolation between estimated # critical values that have been tabulated for particular # choices of n. The tabulated values are based on # simulations of size 10000 and typically have relative # standard errors between two and five percent. # a05 is an estimated level 0.05 critical value. # a10 is an estimated level 0.10 critical value. n_ as.integer(n) if (n > 4000) { ninf_ 4000 a10.inf_ 0.000043 a05.inf_ 0.000072 a01.inf_ 0.000145 nsup_ Inf a10.sup_ 0 a05.sup_ 0 a01.sup_ 0 } if (n == 4000) { ninf_ 4000 a10.inf_ 0.000043 a05.inf_ 0.000072 a01.inf_ 0.000145 nsup_ 4000 } if ((3000 ninf) { a10_ a10.inf*(n^(-1) - nsup^(-1))/(ninf^(-1)-nsup^(-1)) + a10.sup*(- n^(-1) + ninf^(-1))/(ninf^(-1)-nsup^(-1)) a05_ a05.inf*(n^(-1) - nsup^(-1))/(ninf^(-1)-nsup^(-1)) + a05.sup*(- n^(-1) + ninf^(-1))/(ninf^(-1)-nsup^(-1)) a01_ a01.inf*(n^(-1) - nsup^(-1))/(ninf^(-1)-nsup^(-1)) + a01.sup*(- n^(-1) + ninf^(-1))/(ninf^(-1)-nsup^(-1)) } return(a01,a05,a10) result }