Documentation |
obj = paretotails(x,pl,pu)
obj = paretotails(x,pl,pu,cdffun)
obj = paretotails(x,pl,pu) creates an object obj defining a distribution consisting of the empirical distribution of x in the center and Pareto distributions in the tails. x is a real-valued vector of data values whose extreme observations are fit to generalized Pareto distributions (GPDs). pl and pu identify the lower- and upper-tail cumulative probabilities such that 100*pl and 100*(1-pu) percent of the observations in x are, respectively, fit to a GPD by maximum likelihood. If pl is 0, or if there are not at least two distinct observations in the lower tail, then no lower Pareto tail is fit. If pu is 1, or if there are not at least two distinct observations in the upper tail, then no upper Pareto tail is fit.
obj = paretotails(x,pl,pu,cdffun) uses cdffun to estimate the cdf of x between the lower and upper tail probabilities. cdffun may be any of the following:
'ecdf' — Uses an interpolated empirical cdf, with data values as the midpoints in the vertical steps in the empirical cdf, and computed by linear interpolation between data values. This is the default.
'kernel' — Uses a kernel-smoothing estimate of the cdf.
@fun — Uses a handle to a function of the form [p,xi] = fun(x) that accepts the input data vector x and returns a vector p of cdf values and a vector xi of evaluation points. Values in xi must be sorted and distinct but need not equal the values in x.
cdffun is used to compute the quantiles corresponding to pl and pu by inverse interpolation, and to define the fitted distribution between these quantiles.
The output object obj is a Pareto tails object with methods to evaluate the cdf, inverse cdf, and other functions of the fitted distribution. These methods are well-suited to copula and other Monte Carlo simulations. The pdf method in the tails is the GPD density, but in the center it is computed as the slope of the interpolated cdf.
The paretotails class is a subclass of the piecewisedistribution class, and many of its methods are derived from that class.