Computes the (normalized) saddlepoint approximation of the mean of
n i.i.d. random variables.
Usage
saddlepoint(x, n, cumulants, correct = TRUE, normalize = FALSE)
Arguments
x
a numeric vector or array with 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.
cumulants
a cumulants object giving the cumulant
functions and the saddlepoint function. See cumulants
for further information.
correct
logical. If TRUE (the default) the correction term
involving the 3rd and the 4th standardized cumulant functions is included.
normalize
logical. If TRUE the renormalized version of
the saddlepoint approximation is calculated. The renormalized
version does neither make use of the 3rd nor of the 4th cumulant
function so setting correct=TRUE will result in a
warning. The default is FALSE.
Details
The saddlepoint approximation (SA) for the density of the
mean Z=S_n/n of i.i.d. random variables
Y_i with S_n=Y_1+…+Y_n is given
by:
where c is an appropriatly chosen correction term, which is
based on higher cumulants. The function K_Y() denotes the cumulant
generating function and s denotes the saddlepoint
which is the solution of the saddlepoint function:
K'(s)=z.
For the renormalized version of the SA one chooses c
such that f_Z(z) integrates to one, otherwise it includes the
3rd and the 4th standardized cumulant.
The saddlepoint approximation is an improved version of the Edgeworth
approximation and makes use of ‘exponential tilted’
densities. The weakness of the Edgeworth method lies in the
approximation in the tails of the density. Thus, the saddlepoint
approximation embed the original density in the “conjugate
exponential family” with parameter theta. The mean of
the embeded density depends on theta which allows for
evaluating the Edgeworth approximation at the mean, where it is known
to give reasonable results.
Value
saddlepoint returns an object of class approximation. See
function approximation for further details.
Author(s)
Thorn Thaler
References
Reid, N. (1991). Approximations and Asymptotics. Statistical
Theory and Modelling, London: Chapman and Hall.
See Also
approximation, cumulants, edgeworth
Examples
# Saddlepoint approximation for the density of the mean of n Gamma
# variables with shape=1 and scale=1
n <- 10
shape <- scale <- 1
x <- seq(0, 3, length=1000)
sp <- saddlepoint(x, n, gammaCumulants(shape, scale))
plot(sp, lwd=2)
# Mean of n Gamma(1,1) variables is n*Gamma(n,1) distributed
lines(x, n*dgamma(n*x, shape=n*shape, scale=scale), col=2)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(EQL)
Loading required package: ttutils
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/EQL/saddlepoint.Rd_%03d_medium.png", width=480, height=480)
> ### Name: saddlepoint
> ### Title: Saddlepoint Approximation
> ### Aliases: saddlepoint
>
> ### ** Examples
>
> # Saddlepoint approximation for the density of the mean of n Gamma
> # variables with shape=1 and scale=1
> n <- 10
> shape <- scale <- 1
> x <- seq(0, 3, length=1000)
> sp <- saddlepoint(x, n, gammaCumulants(shape, scale))
> plot(sp, lwd=2)
>
> # Mean of n Gamma(1,1) variables is n*Gamma(n,1) distributed
> lines(x, n*dgamma(n*x, shape=n*shape, scale=scale), col=2)
>
>
>
>
>
>
> dev.off()
null device
1
>