gpd(y, data, ...)## S3 method for class 'default':
gpd(y, data, th, qu, phi = ~1, xi = ~1, penalty = "gaussian",
prior = "gaussian", method = "optimize", cov="observed", start = NULL,
priorParameters = NULL, maxit = 10000, trace = NULL,
iter = 40500, burn = 500, thin = 4,
proposal.dist = c("gaussian", "cauchy"),
jump.cov, jump.const, verbose = TRUE,...)
## S3 method for class 'gpd':
print(x, digits=max(3, getOption("digits") - 3), ...)
## S3 method for class 'gpd':
summary(object, nsim=1000, alpha=0.05, ...)
## S3 method for class 'gpd':
show(x, digits=max(3, getOption("digits") - 3), ...)
## S3 method for class 'gpd':
plot(x, main=rep(NULL, 4), xlab=rep(NULL, 4), nsim=1000, alpha=0.05, ...)
## S3 method for class 'gpd':
AIC(object, ..., k=2)
## S3 method for class 'bgpd':
print(x, print.seed=FALSE, ...)
## S3 method for class 'bgpd':
plot(x, which.plots=1:3, density.adjust=2, print.seed=FALSE, ...)
data
.y
and any covariates.y
, exceedances above which will be used to fit the GPD upper tail model.th
, a probability defined such that quantile(y,qu)
equals th
.phi = ~ 1
- i.e. no covariates.xi = ~ 1
- i.e. no covariates.penalty
is "gaussian" or "lasso" then the parameters for
the penalization are specified through the method = "optimize"
, just an alternative way of
specifying the pentalty, and only one or neither of penalty
and prior
should be given. If method = "simulate"
,
prior must be ``gaussian''optim
and point estimates (either Mcov = "observed"
in which case the observed information matrix
is used, as given in Appendix A of Davison and Smith. The only other
option is co
optim
.
If not provided, an exponential distribution (shape = 0) is assumed as the starting
point.optim
.method = "optimize"
,
the argument is passed into optim
-- see the help for that
function. If method = "simulate"
, the argument determines at
how manmethod = "simulate"
.
Defaults to 40000.jump.const
.verbose=TRUE
.gpd
, bgpd
, summary.gpd
or summary.bgpd
returned by gpd
or summary.gpd
.plot
method for class gpd
, titles for diagnostic plots. Should be a vector of length 4, with values corresponding to the character strings to appear on the titles of the pp- qq- return level and density estimate plots respectimain
but labels for x-axes rather than titles.plot
and summary
methods for class gpd
. The number of replicates to be simulated to produce the simulated tolerance intervals. Defaults to nsim = 1000
plot
and summary
methods for class gpd
. A (1 - alpha)% simulation envelope is produced. Defaults to alpha = 0.05
k=2
.print.seed=FALSE
.plot
method for class bgpd
. Which plots to produce. Option 1 gives kernel density estimates,
2 gives traces of the Markov chains with superimposed
cumulative means, 3 gives autocorrelaplot
method for class bgpd
. Passed into density
. Controls the amount of
smoothing of the kernel density estimate. Defaults to
density.adjust=2
.method = "optimize"
, an object of class gpd
:optim
relating to whether or
not the optimizer converged.gpd
that produced the object.method = "simulate"
, an object of class bgpd
:gpd
that produced the object.gpd
and methods for this
class (such as resid and plot) may be useful.th
are estimated by using penalized maximum likelihood (method="optimize"
), or by simulating from the posterior distribution of the model parameters using a Metropolis algorithm (method="simulate"
). In the latter case, start
is used as a starting value for the Metropolis algorithm; in its absence, the maximum penalized likelhood point estimates are computed and used.When a summary or plot is performed, a pointwise (1 - alpha)% tolerance envelope is simulated, based on quantiles of the fitted model. Since the ordered observations will be correlated, if any observation is outside the envelope, it is likely that a chain of observations will be outside the envelope. Therefore, if the number outside the envelope is a little more than alpha%, that does not immediately imply a serious shortcoming of the fitted model.
When method = "optimize"
, the plot
function produces
diagnostic plots for the fitted generalized Pareto model. These differ
depending on whether or not there are covariates in the model. If there
are no covariates then the diagnostic plots are PP- and QQ-plots, a
return level plot (produced by plotrl.gpd
) and a histogram of the data with superimposed generalized
Pareto density estimate. These are all calculated using the data on
the original scale. If there are covariates in the model then the
diagnostics consist of PP- and QQ- plots calculated by using the model
residuals (which will be standard exponential devaiates under the GPD model),
and plots of residuals versus fitted model parameters.
The PP- and QQ-plots show simulated pointwise tolerance intervals.
The region is a (1 - alpha)% region based on nsim
simulated
samples.
When method = "simulate"
the plot
function produces
diagnostic plots for the Markov chains used to simulate from the posterior
distributions for the model parameters. If the chains have converged on
the posterior distributions, the trace plots should look like "fat hairy
caterpillars" and their cumulative means should converge rapidly. Moreover,
the autocorrelation functions should converge quickly to zero.
When method = "simulate"
the print
and summary
functions
give posterior means and standard deviations. Posterior means are also
returned by the coef
method. Depending on what you want to do
and what the posterior distributions look like (use plot
method)
you might want to work with quantiles of the posterior distributions
instead of relying on standard errors.
rl.gpd
, predict.gpd
, gpd.declustered
.x <- rnorm(1000)
mod <- gpd(x, qu = 0.7)
mod
par(mfrow=c(2, 2))
plot(mod)
x <- runif(100,-0.2,0.2)
data <- data.frame(x=x,y=rgpd(100,sigma=exp(3 + 2*x),xi=x))
mod <- gpd(y, data, phi = ~x, xi = ~x, th = 0)
plot(mod)
# Following lines commented out to keep CRAN happy
# mod <- gpd(x, qu=.7, method="sim")
# mod
# par(mfrow=c(3, 2))
# plot(mod)
Run the code above in your browser using DataLab