Internal helper functions for generating interpolation grids for speed up in package ROptEst
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, up.Rad.s = 1, withStartLM = TRUE, len = 13) .saveGridToCSV(Grid, toFileCSV, namPFam, nameInSysdata) .readGridFromCSV <- function(fromFileCSV) .generateInterpGrid(thGrid, PFam, toFileCSV = "temp.csv", getFun = .getLMGrid, ..., modifyfct, nameInSysdata, GridFileName, withPrint = TRUE, len = 13)
th |
numeric of length 1; the grid value at which to compute LMs. |
PFam |
an object of class |
modifyfct |
function with arguments |
radius |
[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. |
loRad |
the lower end point of the interval to be searched in the inner optimization (for the least favorable situation to the user-guessed radius). |
upRad |
the upper end point of the interval to be searched in the inner optimization (for the least favorable situation to the user-guessed radius). |
loRad.s |
the lower end point of the interval
to be searched in the outer optimization
(for the user-guessed radius); if |
upRad.s |
the upper end point of the interval to be searched in the
outer optimization (for the user-guessed radius); if
|
z.start |
initial value for the centering constant. |
A.start |
initial value for the standardizing matrix. |
upper |
upper bound for the optimal clipping bound. |
lower |
lower bound for the optimal clipping bound. |
OptOrIter |
character; which method to be used for determining Lagrange
multipliers |
maxiter |
the maximum number of iterations. |
tol |
the desired accuracy (convergence tolerance). |
loRad0 |
for numerical reasons: the effective lower bound for the zero search;
internally set to |
... |
additional parameters. |
withStartLM |
logical of length 1: shall the LM's of the preceding grid value serve as starting value for the next grid value? |
withSmooth |
logical of length 1: shall a smoothing spline be used? |
withPrint |
logical of length 1: shall current grid value be printed out? |
thGrid |
numeric; grid values. |
optFct |
function with arguments |
GridFileName |
character; if |
Grid |
numeric; grid matrix (x- and y-values). |
toFileCSV |
character; name of the csv file to which the grid is written. |
namPFam |
character; name of the parametric family for which the grid was generated. |
nameInSysdata |
character; grid name (e.g., 'OMSE', 'Sn') for which the grid was generated. |
fromFileCSV |
character; name of the csv file from which the grid is read. |
getFun |
function with first argument |
... |
further arguments to be passed on to |
len |
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
.
.MBRE.th |
A list with items |
.OMSE.th |
as |
.RMXE.th |
as |
.getLMGrid |
A grid (in form of a matrix of x and y-values) pasted
together by |
.saveGridToCSV
invisible(NULL)
.
.readGridFromCSV
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.
.generateInterpGrid
invisible(NULL)
.
These functions are only meant for the developers of package
ROptEst (or respective packages).
They can be used to speed up things by interpolation.
Our use case is a speed up for further scale-shape families (or enhance
existing speed-ups) such that the respective grids are stored in
a ‘sysdata.rda’ file of an external package RobAStRda
—see mail exchange P.Ruckdeschel - U.Ligges on R-devel—
https://stat.ethz.ch/pipermail/r-devel/2013-February/065794.html.
Special attention has to be paid for R-versions pre and post R-2.16
which is why we use .versionSuff
.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.