nmean
and standard deviation
nsd
, lower tail (threshold ul
, GPD shape
xil
and tail fraction phiul
) and upper tail
(threshold ur
, GPD shape xiR
and tail
fraction phiuR
).dgngcon(x, nmean = 0, nsd = 1,
ul = qnorm(0.1, nmean, nsd), xil = 0, phiul = TRUE,
ur = qnorm(0.9, nmean, nsd), xir = 0, phiur = TRUE,
log = FALSE)
pgngcon(q, nmean = 0, nsd = 1,
ul = qnorm(0.1, nmean, nsd), xil = 0, phiul = TRUE,
ur = qnorm(0.9, nmean, nsd), xir = 0, phiur = TRUE,
lower.tail = TRUE)
qgngcon(p, nmean = 0, nsd = 1,
ul = qnorm(0.1, nmean, nsd), xil = 0, phiul = TRUE,
ur = qnorm(0.9, nmean, nsd), xir = 0, phiur = TRUE,
lower.tail = TRUE)
rgngcon(n = 1, nmean = 0, nsd = 1,
ul = qnorm(0.1, nmean, nsd), xil = 0, phiul = TRUE,
ur = qnorm(0.9, nmean, nsd), xir = 0, phiur = TRUE)
phiul
and phiur
permitting a
parameterised value for the lower and upper tail fraction
respectively. Alternatively, when phiul=TRUE
or
phiur=TRUE
the corresponding tail fraction is
estimated as from the normal bulk model.
Notice that the tail fraction cannot be 0 or 1, and the
sum of upper and lower tail fractions
phiul+phiur<1< code="">, so the lower threshold must be less
than the upper, ul.
The cumulative distribution function now has three
components. The lower tail with tail fraction
$\phi_{ul}$ defined by the normal bulk model
(phiul=TRUE
) upto the lower threshold $x <
u_l$: $$F(x) = H(u_l) G_l(x).$$ where $H(x)$ is
the normal cumulative distribution function (i.e.
pnorm(ur, nmean, nsd)
). The $G_l(X)$ is the
conditional GPD cumulative distribution function with
negated data and threshold, i.e. dgpd(-x, -ul,
sigmaul, xil, phiul)
. The normal bulk model between the
thresholds $u_l \le x \le u_r$ given by: $$F(x) =
H(x).$$ Above the threshold $x > u_r$ the usual
conditional GPD: $$F(x) = H(u_r) + [1 - H(u_r)] G(x)$$
where $G(X)$.
The cumulative distribution function for the
pre-specified tail fractions $\phi_{ul}$ and
$\phi_{ur}$ is more complicated. The unconditional
GPD is used for the lower tail $x < u_l$: $$F(x)
= \phi_{ul} G_l(x).$$ The normal bulk model between the
thresholds $u_l \le x \le u_r$ given by: $$F(x) =
\phi_{ul}+ (1-\phi_{ul}-\phi_{ur}) (H(x) - H(u_l)) /
(H(u_r) - H(u_l)).$$ Above the threshold $x > u_r$ the
usual conditional GPD: $$F(x) = (1-\phi_{ur}) +
\phi_{ur} G(x)$$ Notice that these definitions are
equivalent when $\phi_{ul} = H(u_l)$ and
$\phi_{ur} = 1 - H(u_r)$.
The continuity constraint at the ul
means that:
$$\phi_{ul} g_l(x) = (1-\phi_{ul}-\phi_{ur}) h(u_l)/
(H(u_r) - H(u_l)).$$ The GPD scale parameter
sigmaul
is replaced by: $$\sigma_ul =
\phi_{ul} (H(u_r) - H(u_l))/ h(u_l)
(1-\phi_{ul}-\phi_{ur}).$$ In the special case of where
the tail fraction is defined by the bulk model this
reduces to $$\sigma_ul = H(u_l)/ h(u_l)$$.
The continuity Constraint at the ur
means that:
$$\phi_{ur} g_r(x) = (1-\phi_{ul}-\phi_{ur}) h(u_l)/
(H(u_r) - H(u_l)).$$ By rearrangement, the GPD scale
parameter sigmaur
is then: $$\sigma_ur =
\phi_{ur} (H(u_r) - H(u_l))/ h(u_l)
(1-\phi_{ul}-\phi_{ur}).$$ where $h(x)$, $g_l(x)$
and $g_r(x)$ are the normal and conditional GPD
density functions for lower and upper tail (i.e.
dnorm(x, nmean, nsd)
, dgpd(-x, -ul, sigmaul,
xil, phiul)
, and dgpd(x, ur, sigmaur, xir,
phiur)
) In the special case of where the tail fraction
is defined by the bulk model this reduces to
$$\sigma_ur = [1-H(u_r)] / h(u_r)$$.
See gpd
for details of GPD upper
tail component, dnorm
for
details of normal bulk component,
dnormgpd
for normal with GPD
extreme value mixture model and
dgng
for normal bulk with GPD
upper and lower tails extreme value mixture model.
gng
,
normgpd
,
gpd
and
dnorm
Other gngcon: fgngcon
,
lgngcon
, nlgngcon
par(mfrow=c(2,2))
x = rgngcon(1000, phiul = 0.15, phiur = 0.15)
xx = seq(-6, 6, 0.01)
hist(x, breaks = 100, freq = FALSE, xlim = c(-6, 6))
lines(xx, dgngcon(xx, phiul = 0.15, phiur = 0.15))
# three tail behaviours
plot(xx, pgngcon(xx), type = "l")
lines(xx, pgngcon(xx, xil = 0.3, xir = 0.3), col = "red")
lines(xx, pgngcon(xx, xil = -0.3, xir = -0.3), col = "blue")
legend("topleft", paste("Symmetric xil=xir=",c(0, 0.3, -0.3)),
col=c("black", "red", "blue"), lty = 1)
x = rgngcon(1000, xil = -0.3, phiul = 0.2, xir = 0.3, phiur = 0.2)
xx = seq(-6, 6, 0.01)
hist(x, breaks = 100, freq = FALSE, xlim = c(-6, 6))
lines(xx, dgngcon(xx, xil = -0.3, phiul = 0.2, xir = 0.3, phiur = 0.2))
plot(xx, dgngcon(xx, xil = -0.3, phiul = 0.2, xir = 0.3, phiur = 0.2), type = "l", ylim = c(0, 0.4))
lines(xx, dgngcon(xx, xil = -0.3, phiul = 0.3, xir = 0.3, phiur = 0.3), col = "red")
lines(xx, dgngcon(xx, xil = -0.3, phiul = TRUE, xir = 0.3, phiur = TRUE), col = "blue")
legend("topleft", c("phiul = phiur = 0.2", "phiul = phiur = 0.3", "Bulk Tail Fraction"),
col=c("black", "red", "blue"), lty = 1)
Run the code above in your browser using DataLab