Let and , evaluated from the given polylogarithm formulas. Generate a large sample of independent and identically distributed random variables with
r_sample_f, and compute its sample mean and sample variance using mean and var. The central limit theorem gives the first standardized check:For the second check, the correct asymptotic variance of the sample variance involves the fourth central moment :The denominator is not unless the probability distribution has the requisite fourth central moment, as does the normal distribution. Here the probability density function decays exponentially, so all required moments are finite.To compute , expand the denominator of the probability density function as a geometric series and integrate each nonnegative term. The gamma function integral gives the raw momentsThus and . The following R code implements both checks for chosen interior parameters and large
n:p <- 0.4
beta <- 1.3
n <- 100000
raw_m <- vapply(1:4, function(j) {
-factorial(j) * polylog(j + 1, 1 - p) / (beta^j * log(p))
}, numeric(1))
m <- raw_m[1]
v <- raw_m[2] - m^2
mu4 <- raw_m[4] - 4 * m * raw_m[3] +
6 * m^2 * raw_m[2] - 3 * m^4
x <- r_sample_f(n, p, beta)
c(mean_check = sqrt(n) * (mean(x) - m) / sqrt(v),
variance_check = sqrt(n) * (var(x) - v) / sqrt(mu4 - v^2))For each check separately, an absolute value below is consistent with its approximate confidence interval. Repeat with many independent samples: the two standardized statistics should each resemble a standard normal distribution, with about outside that range. Also vary , and
n; a systematic discrepancy that grows with suggests a bias. The two checks from the same sample are generally dependent, so passing both is not itself a joint statement, nor can a finite test prove that a generator is correct.The second central limit theorem follows from the central limit theorem for the sample variance: differs by a quantity tending to zero in probability from .
Articles by others on the same topic
There are currently no matching articles.