
Density, cumulative distribution function, quantile function and
random number generation for the extreme value mixture model with normal
for bulk distribution between the upper and lower thresholds with
conditional GPD's for the two tails. The parameters are the normal mean
nmean
and standard deviation nsd
, lower tail (threshold ul
,
GPD scale sigmaul
and shape xil
and tail fraction phiul
)
and upper tail (threshold ur
, GPD scale sigmaur
and shape
xiR
and tail fraction phiuR
).
dgng(x, nmean = 0, nsd = 1, ul = qnorm(0.1, nmean, nsd), sigmaul = nsd,
xil = 0, phiul = TRUE, ur = qnorm(0.9, nmean, nsd), sigmaur = nsd,
xir = 0, phiur = TRUE, log = FALSE)pgng(q, nmean = 0, nsd = 1, ul = qnorm(0.1, nmean, nsd), sigmaul = nsd,
xil = 0, phiul = TRUE, ur = qnorm(0.9, nmean, nsd), sigmaur = nsd,
xir = 0, phiur = TRUE, lower.tail = TRUE)
qgng(p, nmean = 0, nsd = 1, ul = qnorm(0.1, nmean, nsd), sigmaul = nsd,
xil = 0, phiul = TRUE, ur = qnorm(0.9, nmean, nsd), sigmaur = nsd,
xir = 0, phiur = TRUE, lower.tail = TRUE)
rgng(n = 1, nmean = 0, nsd = 1, ul = qnorm(0.1, nmean, nsd),
sigmaul = nsd, xil = 0, phiul = TRUE, ur = qnorm(0.9, nmean, nsd),
sigmaur = nsd, xir = 0, phiur = TRUE)
quantiles
normal mean
normal standard deviation (positive)
lower tail threshold
lower tail GPD scale parameter (positive)
lower tail GPD shape parameter
probability of being below lower threshold TRUE
upper tail threshold
upper tail GPD scale parameter (positive)
upper tail GPD shape parameter
probability of being above upper threshold TRUE
logical, if TRUE then log density
quantiles
logical, if FALSE then upper tail probabilities
cumulative probabilities
sample size (positive integer)
dgng
gives the density,
pgng
gives the cumulative distribution function,
qgng
gives the quantile function and
rgng
gives a random sample.
Extreme value mixture model combining normal distribution for the bulk
between the lower and upper thresholds and GPD for upper and lower tails. The
user can pre-specify 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
, so the lower threshold must be less than the upper,
ul<ur
.
The cumulative distribution function now has three components. The lower tail with
tail fraction phiul=TRUE
)
upto the lower threshold pnorm(ur, nmean, nsd)
). The
dgpd(-x, -ul, sigmaul, xil, phiul)
. The normal
bulk model between the thresholds
The cumulative distribution function for the pre-specified tail fractions
See gpd
for details of GPD upper tail component,
dnorm
for details of normal bulk component and
dnormgpd
for normal with GPD extreme value
mixture model.
http://en.wikipedia.org/wiki/Normal_distribution
http://en.wikipedia.org/wiki/Generalized_Pareto_distribution
Scarrott, C.J. and MacDonald, A. (2012). A review of extreme value threshold estimation and uncertainty quantification. REVSTAT - Statistical Journal 10(1), 33-59. Available from http://www.ine.pt/revstat/pdf/rs120102.pdf
Zhao, X., Scarrott, C.J. Reale, M. and Oxley, L. (2010). Extreme value modelling for forecasting the market crisis. Applied Financial Econometrics 20(1), 63-72.
Other normgpd normgpdcon gng gngcon fnormgpd fnormgpdcon fgng fgngcon: fgngcon
,
fgng
, fitmgng
,
fnormgpdcon
, fnormgpd
,
gngcon
, itmgng
,
normgpdcon
, normgpd
# NOT RUN {
set.seed(1)
par(mfrow = c(2, 2))
x = rgng(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, dgng(xx, phiul = 0.15, phiur = 0.15))
# three tail behaviours
plot(xx, pgng(xx), type = "l")
lines(xx, pgng(xx, xil = 0.3, xir = 0.3), col = "red")
lines(xx, pgng(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 = rgng(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, dgng(xx, xil = -0.3, phiul = 0.2, xir = 0.3, phiur = 0.2))
plot(xx, dgng(xx, xil = -0.3, phiul = 0.2, xir = 0.3, phiur = 0.2), type = "l", ylim = c(0, 0.4))
lines(xx, dgng(xx, xil = -0.3, phiul = 0.3, xir = 0.3, phiur = 0.3), col = "red")
lines(xx, dgng(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)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab