Description Usage Arguments Value Author(s) References See Also Examples
Routine to calculate the weights for deconvolution via weighted kernel density estimates for the bivariate case.
1 |
y |
a matrix with two columns containing the observed, contaminated data. |
Sigma |
the variance-covariance matrix of the contaminating (normal) distribution. |
H |
the matrix of smoothing parameters to be used for the
weighted bivariate kernel density estimate; if missing the bandwidth
returned by |
gamma |
the regularisation parameter to be used; either a scalar or a vector of values from which a suitable value is selected via K-fold cross-validation. |
... |
optional parameters passed to the cross-validation routine
|
A vector containing the weights; if gamma
is chosen by
cross-validation, the selected value is returned as an attribute.
Martin L Hazelton m.hazelton@massey.ac.nz
Berwin A Turlach Berwin.Turlach@gmail.com
Hazelton, M.L. and Turlach, B.A. (2009). Nonparametric density deconvolution by weighted kernel estimators, Statistics and Computing 19(3): 217–228. http://dx.doi.org/10.1007/s11222-008-9086-7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(ks)
Age <- framingham[,2]
Age.lim.2 <- 56
SBP1.A <- framingham[Age>=Age.lim.2,3] # SBP, measure 1, Exam 2
SBP2.A <- framingham[Age>=Age.lim.2,4] # SBP, measure 2, Exam 2
SBP1.B <- framingham[Age>=Age.lim.2,5] # SBP, measure 1, Exam 3
SBP2.B <- framingham[Age>=Age.lim.2,6] # SBP, measure 2, Exam 3
sigma.fram.A <- sd(SBP1.A-SBP2.A)
sigma.fram.B <- sd(SBP1.B-SBP2.B)
Sigma.fram <- diag(c(sigma.fram.A,sigma.fram.B))^2
SBP.A <- SBP1.A
SBP.B <- SBP1.B
SBP.bi <- cbind(SBP.A,SBP.B)
H.fram <- Hpi(SBP.bi)
w <- w.hat.mv(SBP.bi, Sigma.fram, H.fram, gamma = 0.4)
plot(SBP.bi, cex=w)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.