2014-02-16 21:48:40 +00:00
|
|
|
# Saddlepoint approximation of the distribution function of the Esscher
|
|
|
|
# transform of the GAL distribution
|
|
|
|
#
|
|
|
|
# Author: Francois Pelletier
|
|
|
|
#
|
|
|
|
# LGPL 3.0
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
#' Saddlepoint approximation of the distribution function of the Esscher
|
|
|
|
#' transform of the GAL distribution
|
|
|
|
#' @param x vector of quantiles
|
|
|
|
#' @param param Parameter vector
|
|
|
|
#' @param eval.time Time of the process
|
|
|
|
#' @param type Choose between "mu" or "kappa" parametrization
|
|
|
|
#' @param log Logical for log-parameters
|
|
|
|
#' @return Saddlepoint approximation of the distribution function
|
2014-03-06 02:44:52 +00:00
|
|
|
#' @export psaddleapproxEsscherGAL
|
|
|
|
#' @author Francois Pelletier
|
2014-02-16 21:48:40 +00:00
|
|
|
psaddleapproxEsscherGAL <- function(x,param,eval.time=1,type="mu",log=FALSE)
|
|
|
|
{
|
|
|
|
s <- saddlepointEsscherGAL(x,param,eval.time,type,log)
|
|
|
|
u <- s * sqrt(diffcgfEsscherGAL(s,2,param,eval.time,type,log))
|
2014-07-27 23:02:08 +00:00
|
|
|
w <- sign(s)*sqrt(2*(s*x-cgfEsscherGAL(s,param,1,eval.time,type,log)))
|
2014-02-16 21:48:40 +00:00
|
|
|
|
2014-07-07 02:57:57 +00:00
|
|
|
(x==round(mGAL(param,1,type,log),4))*
|
|
|
|
(1/2 + diffcgfEsscherGAL(0,3,param,eval.time,type,log)/
|
2014-03-06 02:44:52 +00:00
|
|
|
(6*sqrt(2*pi)*diffcgfEsscherGAL(0,2,param,eval.time,type,log)^(3/2)))
|
2014-07-07 02:57:57 +00:00
|
|
|
+(x!=round(mGAL(param,1,type,log),4)) * (pnorm(w)+dnorm(w)*(1/w-1/u))
|
|
|
|
|
2014-02-16 21:48:40 +00:00
|
|
|
}
|