This function computes an equivalent nonexceedance probability \(F\) of a single value \(x\) for the sample data set (\(\hat{X}\)) through inversion of the empricial quantile function as computable through Bernstein or Kantorovich Polynomials by the dat2bernqua
function.
dat2bernquaf(x, data, interval=NA, ...)
An R
list
is returned.
An echoing of the \(x\) value via the x
argument.
The equivalent nonexceedance probability \(F(x{\mid}\hat{X})\).
The search interval of \(F\) used.
Corresponds to the f.root
element returned by the uniroot()
function.
Corresponds to the iter
element returned by the uniroot()
function.
Corresponds to the estim.prec
element returned by the uniroot()
function.
An attribute identifying the computational source: “dat2bernquaf”.
A scalar value for which the equivalent nonexceedance probability \(F\) through the function dat2bernqua
is to be computed.
A vector of data values that directly correspond to the argument x
in the function dat2bernqua
.
The search interval. If NA
, then \([1/(n+1), 1 - 1/(n+1)]\) is used. If interval
is a single value \(a\), then the interval is computed as \([a, 1 - a]\).
Additional arguments passed to dat2bernqua
through the uniroot()
function in R.
W.H. Asquith
The basic logic is thus. The \(\hat{X}\) in conjunction with the settings for the polynomials provides the empirical quantile function (EQF). The dat2bernquaf
function then takes the EQF (through dynamic recomputation) and seeks a root for the single value also given.
The critical piece likely is the search interval, which can be modified by the interval
argument if the internal defaults are not sufficient. The default interval is determined as the first and last Weibull plotting positions of \(\hat{X}\) having a sample size \(n\): \([1/(n+1), 1 - 1/(n+1)]\). Because the dat2bernqua
function has a substantial set of options that control how the empirical curve is (might be) extrapolated beyond the range of \(\hat{X}\), it is difficult to determine an always suitable interval for the rooting. However, it should be considered obvious that the result is more of an interpolation if \(F(x)\) is within \(F \in [1/(n+1), 1 - 1/(n+1)]\) and increasingly becomes an accurate interpolation as \(F(x) \rightarrow 1/2\) (the median).
If the value \(x\) is too far beyond the data or if the search interval is not sufficient then the following error will be triggered:
Error in uniroot(afunc, interval, ...) :
f() values at end points not of opposite sign
The Examples section explores this aspect.
dat2bernqua