fence.NF: Fence model selection (Nonparametric Model)

Description Usage Arguments Value Author(s) References Examples

View source: R/methodNF.R

Description

Fence model selection (Noparametric Model)

Usage

1
2
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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## 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)

fence documentation built on May 1, 2019, 11:32 p.m.

Related to fence.NF in fence...