Function LDEstimator
provides a general way to compute
estimates for a given parametric family of probability measures
(with a scale and shape parameter) which
can be obtained by matching location and dispersion functionals
against empirical counterparts.
getShapeGrid(gridsize=1000, centralvalue=0.7,
withPos=TRUE, cutoff.at.0=1e-4, fac = 2)getSnGrid(xiGrid = getShapeGrid(), PFam=GParetoFamily(), low=0,
upp=1.01, accuracy = 10000, GridFileName="SnGrid.Rdata",
withPrint = FALSE)
integer; the size of the grid to be created.
numeric of length 1: the central value of the grid (for details see below).
logical of length 1; are negative values for the shape forbidden?
numeric of length 1: How close may we come to 0?
a scaling factor used for the respective grid values (see below).
numeric; grid of shape values.
an object of class "ParamFamily"
. The parametric
family at which to evaluate the LDEstimator; the respective
(main) parameter must contain "scale"
and "shape"
.
numeric; argument for Sn
.
numeric; argument for Sn
.
numeric; argument for Sn
.
character; if GridFileName!=""
, the pure
y-grid values are saved under this filename.
logical of length 1: shall current shape value be printed out?
a numeric grid of xi-values.
a grid, i.e.; a matrix with columns
xi
and Sn
--the respective interpolation grid).
getShapeGrid
is a helper function to produce an unequally spaced
grid of shape values xi, with the rationale that we need values close
to some typical values more often than values at the border. The code
starts with an equally spaced grid of size gridsize
from 0.5
to 1-0.25/gridsize
. This is reflected at 0.5
,
and a grid of respective quantiles of Norm(mean=centralvalue, sd=fac)
is produced---with the heuristic rational that most estimators will be
asymptotically normal around a typical value. If withPos
is TRUE,
negative values are cut off and replaced by respective higher quantiles of the
corresponding normal; similarly, values to close to 0 are replaced by values
between the cutoff value and the next admissible value and again by
respective higher normal quantiles.
getSnGrid
is a helper function to produce a grid of Sn
values
for a given grid of shape values and scale equal to 1 in a given
shape-scale family.
This result of this function can then be used to speed
up calls to Sn
(or to medSn
) by providing particular methods
for Sn
.
For an example of such a particular method see the body of
getMethod("Sn", "GPareto")
where object
sng[["Generalized Pareto Family"]]
is just the result of a call
getSnGrid(xiGrid = getShapeGrid(), PFam=GParetoFamily())
which
has been stored in the namespace of package distrMod
.
# NOT RUN {
## (empirical) Data
getShapeGrid(50)
head(getShapeGrid(withPos=FALSE))
# }
# NOT RUN {
### code used for the grid stored in the namespace of distrMod:
getSnGrid()
# }
Run the code above in your browser using DataCamp Workspace