edgeworth {EQL} | R Documentation |
Computes the Edgeworth expansion of either the standardized mean, the mean or the sum of i.i.d. random variables.
edgeworth(x, n, rho3, rho4, mu, sigma2, deg=3, type = c("standardized", "mean", "sum"))
x |
a numeric vector or array giving the values at which the approximation should be evaluated. |
n |
a positive integer giving the number of i.i.d. random variables in the sum. |
rho3 |
a numeric value giving the standardized 3rd cumulant. May
be missing if deg <= 1 . |
rho4 |
a numeric value giving the standardized 4th cumulant. May
be missing if deg <= 2 . |
mu |
a numeric value giving the mean.
May be missing if type = "standardized" , since it is
only needed for transformation purposes. |
sigma2 |
a positive numeric value giving the variance.
May be missing if type= "standardized" . |
deg |
an integer value giving the order of the approximation:
|
type |
determines which sum should be approximated. Must be one of (“standardized”, “mean”, “sum”), representing the shifted and scaled sum, the weighted sum and the raw sum. Can be abbreviated. |
The Edgeworth approximation (EA) for the density of the standardized mean Z=(S_n-n*mu)/(n*sigma^2)^(1/2), where
is given by:
f_Z(s) = phi(z)*[1 + rho3/(6*n^(1/2))*H_3(z) +
rho4/(24*n)*H_4(z) + rho3^2/(72*n)*H_6(z)],
with phi denoting the density of the standard normal
distribution and rho3 and rho4 denoting
the 3rd and the 4th standardized cumulants of Y_i
respectively. H_n(x) denotes the nth Hermite polynomial (see
hermite
for details).
The EA for the mean and the sum can be obtained by applying
the transformation theorem for densities. In this case, the expected
value mu
and the variance sigma2
must be given to allow
for an appropriate transformation.
edgeworth
returns an object of the class
approximation
. See approximation
for further
details.
Thorn Thaler
Reid, N. (1991). Approximations and Asymptotics. Statistical Theory and Modelling, London: Chapman and Hall.
approximation
,hermite
,saddlepoint
# Approximation of the mean of n iid Chi-squared(2) variables n <- 10 df <- 2 mu <- df sigma2 <- 2*df rho3 <- sqrt(8/df) rho4 <- 12/df x <- seq(max(df-3*sqrt(2*df/n),0), df+3*sqrt(2*df/n), length=1000) ea <- edgeworth(x, n, rho3, rho4, mu, sigma2, type="mean") plot(ea, lwd=2) # Mean of n Chi-squared(2) variables is n*Chi-squared(n*2) distributed lines(x, n*dchisq(n*x, df=n*mu), col=2)