Last chance! 50% off unlimited learning
Sale ends in
flognormgpd(x, phiu = TRUE, pvector = NULL,
std.err = TRUE, method = "BFGS",
control = list(maxit = 10000), finitelik = TRUE, ...)
lnmean
, lnsd
, u
,
sigmau
, xi
) or NULL
optim
)optim
)optim
call
: optim
call
x
: data vector x
init
: pvector
optim
: complete
optim
output
mle
: vector of MLE of
model parameters
cov
: variance-covariance
matrix of MLE of model parameters
se
: vector of standard errors of MLE of model parameters
rate
: phiu
to be consistent with
evd
nllh
: minimum
negative log-likelihood
allparams
: vector
of MLE of model parameters and phiu
allse
: vector of standard error of all
parameters and phiu
n
: total sample
size
nmean
: MLE of log-normal mean
nsd
: MLE of log-normal standard deviation
u
: threshold
sigmau
: MLE of
GPD scale
xi
: MLE of GPD shape
phiu
: MLE of tail fraction
}
The output list has some duplicate entries and repeats
some of the inputs to both provide similar items to those
from fpot
and to make it as
useable as possible.phiu=TRUE
so that the tail
fraction is specified by normal distribution $\phi_u
= 1 - H(u)$. When phiu=FALSE
then the tail
fraction is treated as an extra parameter estimated using
the MLE which is the sample proportion above the
threshold. In this case the standard error for
phiu
is estimated and output as sephiu
.
Missing values (NA
and NaN
) are assumed to
be invalid data so are ignored, which is inconsistent
with the evd
library which
assumes the missing values are below the threshold.
The default optimisation algorithm is "BFGS", which
requires a finite negative log-likelihood function
evaluation finitelik=TRUE
. For invalid parameters,
a zero likelihood is replaced with exp(-1e6)
. The
"BFGS" optimisation algorithms require finite values for
likelihood, so any user input for finitelik
will
be overridden and set to finitelik=TRUE
if either
of these optimisation methods is chosen.
It will display a warning for non-zero convergence result
comes from optim
function
call.
If the hessian is of reduced rank then the variance
covariance (from inverse hessian) and standard error of
parameters cannot be calculated, then by default
std.err=TRUE
and the function will stop. If you
want the parameter estimates even if the hessian is of
reduced rank (e.g. in a simulation study) then set
std.err=FALSE
.lgpd
and
gpd
Other lognormgpd: dlognormgpd
,
llognormgpd
, lognormgpd
,
nllognormgpd
, plognormgpd
,
qlognormgpd
, rlognormgpd
par(mfrow=c(2,1))
x = rlnorm(1000)
xx = seq(-1, 6, 0.01)
y = dlnorm(xx)
# Bulk model base tail fraction
fit = flognormgpd(x, phiu = TRUE, std.err = FALSE)
hist(x, breaks = 100, freq = FALSE, xlim = c(-1, 6))
lines(xx, y)
lines(xx, dlognormgpd(xx, lnmean = fit$lnmean, lnsd = fit$lnsd, u = fit$u,
sigmau = fit$sigmau, xi = fit$xi, phiu = TRUE), col="red")
abline(v = fit$u)
# Parameterised tail fraction
fit2 = flognormgpd(x, phiu = FALSE, std.err = FALSE)
plot(xx, y, type = "l")
lines(xx, dlognormgpd(xx, lnmean = fit$lnmean, lnsd = fit$lnsd, u = fit$u,
sigmau = fit$sigmau, xi = fit$xi, phiu = TRUE), col="red")
lines(xx, dlognormgpd(xx, lnmean = fit2$lnmean, lnsd = fit2$lnsd, u = fit2$u,
sigmau = fit2$sigmau, xi = fit2$xi, phiu = fit2$phiu), col="blue")
abline(v = fit$u, col = "red")
abline(v = fit2$u, col = "blue")
legend("topright", c("True Density","Bulk Tail Fraction","Parameterised Tail Fraction"),
col=c("black", "red", "blue"), lty = 1)
Run the code above in your browser using DataLab