H.inv.select {snfa} | R Documentation |
Bandwidth matrix selection
Description
Computes inverse of bandwidth matrix using rule-of-thumb from Silverman (1986).
Usage
H.inv.select(X, H.mult = 1)
Arguments
X |
Matrix of inputs |
H.mult |
Scaling factor for rule-of-thumb smoothing matrix |
Details
This method performs selection of (inverse) multivariate bandwidth matrices using Silverman's (1986) rule-of-thumb. Specifically, Silverman recommends setting the bandwidth matrix to
H_{jj}^{1/2} = \left(\frac{4}{M + 2}\right)^{1 / (M + 4)}\times N^{-1 / (M + 4)}\times \mbox{sd}(x^j) \mbox{\ \ \ \ for }j=1,...,M
H_{ab} = 0\mbox{\ \ \ \ for }a\neq b
where M
is the number of inputs, N
is the number of observations, and
\mbox{sd}(x^j)
is the sample standard deviation of input j
.
Value
Returns inverse bandwidth matrix
References
Silverman BW (1986). Density estimation for statistics and data analysis, volume 26. CRC press.
Examples
data(USMacro)
USMacro <- USMacro[complete.cases(USMacro),]
#Extract data
X <- as.matrix(USMacro[,c("K", "L")])
#Generate bandwidth matrix
print(H.inv.select(X))
# [,1] [,2]
# [1,] 3.642704e-08 0.000000e+00
# [2,] 0.000000e+00 1.215789e-08