minimize_MSEHat {kader} | R Documentation |
Minimization of Estimated MSE
Description
Minimization of the estimated MSE as function of \sigma
in four steps.
Usage
minimize_MSEHat(VarHat.scaled, BiasHat.squared, sigma, Ai, Bj, h, K, fnx,
ticker = FALSE, plot = FALSE, ...)
Arguments
VarHat.scaled |
Vector of estimates of the scaled variance
(for values of |
BiasHat.squared |
Vector of estimates of the squared bias
(for values of |
sigma |
Numeric vector |
Ai |
Numeric vector expecting |
Bj |
Numeric vector expecting |
h |
Numeric scalar, where (usually) |
K |
Kernel function with vectorized in- & output. |
fnx |
|
ticker |
Logical; determines if a 'ticker' documents the iteration
progress through |
plot |
Should graphical output be produced? Defaults to |
... |
Currently ignored. |
Details
Step 1: determine first (= smallest) maximizer of VarHat.scaled
(!)
on the grid in sigma
. Step 2: determine first (= smallest) minimizer
of estimated MSE on the \sigma
-grid LEFT OF the first maximizer of
VarHat.scaled
. Step 3: determine a range around the yet-found
(discrete) minimizer of estimated MSE within which a finer search for the
“true” minimum is continued using numerical minimization. Step 4: check if
the numerically determined minimum is indeed better, i.e., smaller than the
discrete one; if not keep the first.
Value
A list with components sigma.adap
, msehat.min
and
discr.min.smaller
whose meanings are as follows:
sigma.adap | Found minimizer of MSE estimator. |
msehat.min | Found minimum of MSE estimator. |
discr.min.smaller | TRUE iff the numerically found minimum was smaller than the discrete one. |
Examples
require(stats)
set.seed(2017); n <- 100; Xdata <- sort(rnorm(n))
x0 <- 1; Sigma <- seq(0.01, 10, length = 11)
h <- n^(-1/5)
Ai <- (x0 - Xdata)/h
fnx0 <- mean(dnorm(Ai)) / h # Parzen-Rosenblatt estimator at x0.
# For non-robust method:
Bj <- mean(Xdata) - Xdata
# # For rank transformation-based method (requires sorted data):
# Bj <- -J_admissible(1:n / n) # rank trafo
BV <- kader:::bias_AND_scaledvar(sigma = Sigma, Ai = Ai, Bj = Bj,
h = h, K = dnorm, fnx = fnx0, ticker = TRUE)
kader:::minimize_MSEHat(VarHat.scaled = BV$VarHat.scaled,
BiasHat.squared = (BV$BiasHat)^2, sigma = Sigma, Ai = Ai, Bj = Bj,
h = h, K = dnorm, fnx = fnx0, ticker = TRUE, plot = FALSE)