lambda
, threshold u
GPD scale sigmau
and shape xi
and tail fraction phiu
.dkdengpd(x, kerncentres, lambda = NULL,
u = as.vector(quantile(kerncentres, 0.9)),
sigmau = sqrt(6 * var(kerncentres))/pi, xi = 0,
phiu = TRUE, log = FALSE)
pkdengpd(q, kerncentres, lambda = NULL,
u = as.vector(quantile(kerncentres, 0.9)),
sigmau = sqrt(6 * var(kerncentres))/pi, xi = 0,
phiu = TRUE, lower.tail = TRUE)
qkdengpd(p, kerncentres, lambda = NULL,
u = as.vector(quantile(kerncentres, 0.9)),
sigmau = sqrt(6 * var(kerncentres))/pi, xi = 0,
phiu = TRUE, lower.tail = TRUE)
rkdengpd(n = 1, kerncentres, lambda = NULL,
u = as.vector(quantile(kerncentres, 0.9)),
sigmau = sqrt(6 * var(kerncentres))/pi, xi = 0,
phiu = TRUE)
phiu
permitting a parameterised value
for the tail fraction $\phi_u$. Alternatively, when
phiu=TRUE
the tail fraction is estimated as the
tail fraction from the normal bulk model.
The cumulative distribution function with tail fraction
$\phi_u$ defined by the upper tail fraction of the
kernel density estimation using normal kernel
(phiu=TRUE
), upto the threshold $x \le u$,
given by: mean(pnorm(x, kerncentres,
lambda))
and pgpd(x, u, sigmau, xi)
).
The cumulative distribution function for pre-specified
$\phi_u$, upto the threshold $x \le u$, is given
by: gpd
for details of GPD upper
tail component and dnorm
for
details of normal bulk component.gpd
and
dnorm
Other kdengpd: fkdengpd
par(mfrow=c(2,2))
kerncentres=rnorm(500, 0, 1)
xx = seq(-4, 4, 0.01)
hist(kerncentres, breaks = 100, freq = FALSE)
lines(xx, dkdengpd(xx, kerncentres, u = 1.2, sigmau = 0.56, xi = 0.1))
plot(xx, pkdengpd(xx, kerncentres), type = "l")
lines(xx, pkdengpd(xx, kerncentres, xi = 0.3), col = "red")
lines(xx, pkdengpd(xx, kerncentres, xi = -0.3), col = "blue")
legend("topleft", paste("xi =",c(0, 0.3, -0.3)),
col=c("black", "red", "blue"), lty = 1, cex = 0.5)
kerncentres=rnorm(1000, 0, 1)
x = rkdengpd(1000, kerncentres, phiu = 0.1, u = 1.2, sigmau = 0.56, xi = 0.1)
xx = seq(-4, 6, 0.01)
hist(x, breaks = 100, freq = FALSE, xlim = c(-4, 6))
lines(xx, dkdengpd(xx, kerncentres, phiu = 0.1))
plot(xx, dkdengpd(xx, kerncentres, xi=0, phiu = 0.2), type = "l")
lines(xx, dkdengpd(xx, kerncentres, xi=-0.2, phiu = 0.2), col = "red")
lines(xx, dkdengpd(xx, kerncentres, xi=0.2, phiu = 0.2), col = "blue")
legend("topleft", c("xi = 0", "xi = 0.2", "xi = -0.2"),
col=c("black", "red", "blue"), lty = 1)
Run the code above in your browser using DataLab