These functions are used internally to generate interpolation grids,
for Lagrange multipliers or LDEstimators in package RobExtremes,
to be stored in the
respective sysdata.rda
file.
.RMXE.th(th, PFam, modifyfct, loRad = 0, upRad = Inf, z.start = NULL,
A.start = NULL, upper = NULL, lower = NULL,
OptOrIter = "iterate", maxiter = 50,
tol = .Machine$double.eps^0.4, loRad0 = 1e-3, ...)
.MBRE.th(th, PFam, modifyfct,
z.start = NULL, A.start = NULL, upper = 1e4,
lower = 1e-4, OptOrIter = "iterate",
maxiter = 50, tol = .Machine$double.eps^0.4, ...)
.OMSE.th(th, PFam, modifyfct, radius = 0.5,
z.start = NULL, A.start = NULL, upper = 1e4,
lower = 1e-4, OptOrIter = "iterate",
maxiter = 50, tol = .Machine$double.eps^0.4, ...).getLMGrid(thGrid, PFam, optFct = .RMXE.th, modifyfct, radius = 0.5,
GridFileName = "LMGrid.Rdata", withPrint = FALSE,
upper = 1e4, lower = 1e-4, OptOrIter = "iterate",
maxiter = 50, tol = .Machine$double.eps^0.4,
loRad = 0, upRad = Inf, loRad0 = 1e-3,
loRad.s = 0.2, upRad.s = 1, withStartLM = TRUE, len = 13)
.saveGridToCSV(Grid, toFileCSV, namPFam, nameInSysdata)
.readGridFromCSV(fromFileCSV)
.generateInterpGrid(thGrid, PFam, toFileCSV = "temp.csv",
getFun = .getLMGrid, ..., modifyfct, nameInSysdata,
GridFileName, withPrint = TRUE, len = 13)
A list with items b
(a number; clipping height),
a
(a 2-vector; outer centering),
a.w
(a 2-vector; inner centering, in
the weight), A
(a 2x2 matrix; outer standardization),
A.w
(a 2x2 matrix; inner standardization, in the weight).
as .MBRE.th
.
as .MBRE.th
.
A grid (in form of a matrix of x and y-values) pasted
together by cbind
.
invisible(NULL)
.
a list with the read-in items, i.e.,
an item Grid
with the grid, an item namPFam
with the name of
the parametric family, and namInSysdata
, the name of the read in grid.
invisible(NULL)
.
numeric of length 1; the grid value at which to compute LMs.
an object of class "ParamFamily"
, the parametric family
at which to evaluate the Lagrange multipliers or LDEstimators;
in our use case, it is a shape-scale model, hence the respective
(main) parameter must contain "scale"
and "shape"
.
function with arguments th
and PFam
to move
the parametric family to the point of the grid value; returns the
moved parametric family.
[for OMSE]: positive numeric of length 1: the radius of the neighborhood for which the LM's are to be computed; defaults to 0.5.
the lower end point of the interval to be searched in the inner optimization (for the least favorable situation to the user-guessed radius).
the upper end point of the interval to be searched in the inner optimization (for the least favorable situation to the user-guessed radius).
the lower end point of the interval
to be searched in the outer optimization
(for the user-guessed radius); if NULL
set to loRad
in the algorithm.
the upper end point of the interval to be searched in the
outer optimization (for the user-guessed radius); if
NULL
set to upRad
in the algorithm.
initial value for the centering constant.
initial value for the standardizing matrix.
upper bound for the optimal clipping bound.
lower bound for the optimal clipping bound.
character; which method to be used for determining Lagrange
multipliers A
and a
: if (partially) matched to "optimize"
,
getLagrangeMultByOptim
is used; otherwise: by default, or if matched to
"iterate"
or to "doubleiterate"
,
getLagrangeMultByIter
is used. More specifically,
when using getLagrangeMultByIter
, and if argument risk
is of
class "asGRisk"
, by default and if matched to "iterate"
we use only one (inner) iteration, if matched to "doubleiterate"
we use up to Maxiter
(inner) iterations.
the maximum number of iterations.
the desired accuracy (convergence tolerance).
for numerical reasons: the effective lower bound for the zero search;
internally set to max(loRad,loRad0)
.
logical of length 1: shall the LM's of the preceding grid value serve as starting value for the next grid value?
logical of length 1: shall current grid value be printed out?
numeric; grid values.
function with arguments theta
, PFam
,
and modifyfct; determines the Lagrange multipliers.
character; if GridFileName!=""
, the pure
y-grid values are saved under this filename.
numeric; grid matrix (x- and y-values).
character; name of the csv file to which the grid is written.
character; name of the parametric family for which the grid was generated.
character; grid name (e.g., 'OMSE', 'Sn') for which the grid was generated.
character; name of the csv file from which the grid is read.
function with first argument th
, second argument
PFam
and last arguments GridFileName
,
withPrint
; produces the y-values for the
interpolation grid.
further arguments to be passed on, e.g., to getFun
.
integer; number of Lagrange multipliers to be calibrated.
.MBRE.th
computes the Lagrange multipliers for the MBRE estimator,
.OMSE.th
for the OMSE estimator at radius radius
,
and .RMXE.th
the RMXE estimator.
.getLMGrid
in a large loop computes the Lagrange multipliers for
optimally robust IFs for each element of a given grid.
.saveGridToCSV
saves a given grid to a csv file, and in addition,
in a file with same name but with file extension ".txt" writes the
parametric family and the grid name.
.readGridFromCSV
reads in a grid from a csv file together with the
information given in the corresponding ".txt" file.
.generateInterpGrid
by means of calls to function-argument getFun
(e.g. getLMGrid
computes the grid, if desired smoothes it, and
then saves it to .csv
.