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
where is the number of inputs,
is the number of observations, and
is the sample standard deviation of input
.
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
[Package snfa version 0.0.1 Index]