fence.NF {fence} | R Documentation |
Fence model selection (Nonparametric Model)
Description
Fence model selection (Noparametric Model)
Usage
fence.NF(full, data, spline, ps = 1:3, qs = NA, B = 100, grid = 101,
bandwidth = NA, lambda)
Arguments
full |
formula of full model |
data |
data |
spline |
variable needed for spline terms |
ps |
order of power |
qs |
number of knots |
B |
number of bootstrap sample, parametric for lmer |
grid |
grid for c |
bandwidth |
bandwidth for kernel smooth function |
lambda |
A grid of lambda values |
Value
models |
list all model candidates with p polynomial degrees and q knots in the model space |
Qd_matrix |
list a matrix of QM - QM.tilde for all model candidates. Each row is for each bootrap sample |
bandwidth |
list the value of bandwidth |
model_mat |
list a matrix of selected models at each c values in grid (in columns). Each row is for each bootstrap sample |
freq_mat |
list a matrix of coverage probabilities (frequency/smooth_frequency) of each selected models for a given c value (index) |
c |
list the adaptive choice of c value from which the parsimonious model is selected |
lambda |
penalty (or smoothing) parameter estimate given selected p and q |
sel_model |
list the selected (parsimonious) model given the adaptive c value |
beta.est.u |
A list of coefficient estimates given a lambda value |
f.x.hat |
A vector of fitted values obtained from a given lambda value and beta.est.u |
@note The current Fence method in Nonparametric model focuses on one spline variable. This method can be extended to a general case with more than one spline variables, and includes non-spline variables.
Author(s)
Jiming Jiang Jianyang Zhao J. Sunil Rao Bao-Qui Tran Thuan Nguyen
References
Jiang J., Rao J.S., Gu Z., Nguyen T. (2008), Fence Methods for Mixed Model Selection. The Annals of Statistics, 36(4): 1669-1692
Jiang J., Nguyen T., Rao J.S. (2009), A Simplified Adaptive Fence Procedure. Statistics and Probability Letters, 79, 625-629
Jiang J., Nguyen T., Rao J.S. (2010), Fence Method for Nonparametric Small Area Estimation. Survey Methodology, 36, 1, 3-11
Examples
## Not run:
require(fence)
n = 100
set.seed(1234)
x=runif(n,0,3)
y = 1-x+x^2- 2*(x-1)^2*(x>1) + 2*(x-2)^2*(x>2) + rnorm(n,sd=.2)
lambda=exp((c(1:60)-30)/3)
data=data.frame(cbind(x,y))
test_NF = fence.NF(full=y~x, data=data, spline='x', ps=c(1:3), qs=c(2,5), B=1000, lambda=lambda)
plot(test_NF)
summary <- summary(test_NF)
model_sel <- summary[[1]]
model_sel
lambda_sel <- summary[[2]]
lambda_sel
## End(Not run)