bsml {bsml} | R Documentation |
Basis Selection from Multiple Libraries Ver. 1.0-5
Description
This is the implementation of the namesake methodology. You can supply as many basis libraries as you want that can potentially fit the data well. The program will adaptively select basis functions from each library and find the optimal model complexity by using the Generalized Degree of Freedom.
Usage
bsml(y,baseslist,method="bsmlc",maxbas=30,sub.maxbas=c(),backward=NULL,
has.control=list(crit="GCV",idf=1.2,ridge=F),
bsmlc.approach="gdf",
gdf.control=list(nrep=100,tauhat="Rice"),
gcvpk.control=list(delta=.1,job=1005,lamlim=c(-6,2),tau=10,ntbl=100,maxtbl=100))
Arguments
y |
Responses. |
baseslist |
List of libraries. |
method |
Three methods available: HAS, BSML-C and BSML-S. Use "has", "bsmlc" and "bsmls" to specify. |
maxbas |
Maximum number of bases to be selected. |
sub.maxbas |
Maximum number of bases to be pre-selected for each library. |
backward |
Backward elimination criterion. Available options are "AIC", "BIC", "Cp" and "GCV". Default is NULL, when no backward elimination is carried out. |
has.control |
Includes three controlling arguments: "crit" for basis selection criterion for HAS; Available options are "AIC", "BIC", "Cp" and "GCV". "idf" for IDF value for HAS; Default is 1.2; If value NA is supplied, it will be estimated. "ridge" for use ridge regression or not. TRUE or FALSE. |
bsmlc.approach |
GDF approach or Covariance Penalty approach. For BSML-C only. |
gdf.control |
Controlling parameters for GDF estimation. |
gcvpk.control |
Controlling parameters for HAS. |
Value
coefficients |
Coefficients |
residuals |
Residuals |
fitted.values |
Fitted Values |
chosen.bases.full |
Full list of indices of chosen bases, excluding null bases. |
chosen.bases.trim |
List of indices of chosen bases in the final model, excluding null bases. |
chosen.bases.matrix |
Matrix of chosen bases in final model, excluding null bases. |
score |
Scores used to determine optimal model complexity. The first score is for the null model. |
idf |
Inflated Degree of Freedom for each chosen basis |
gdf |
Cumulated Generalized Degree of Freedom for the corresponding number of chosen bases in the model. |
nb |
Total number of bases in the model, including both null and chosen bases. |
sigma_sq |
Estimated variance. |
dof |
Degree of Freedom for the model. |
index.bas |
HAS only. Indices of chosen bases in one-dimensional designations. For internal use. |
Author(s)
Junqing Wu, Jeff Sklar, Wendy Meiring, Yuedong Wang
Examples
##############################
# Heavisine Function Example #
##############################
n=128
x <- seq(0,1,length=n)
pt <- (rep(1,n)%o%x)[,-c(n)]
y <- 2.2*(4*sin(4*pi*x)-sign(x-.3)-sign(.72-x))
set.seed(123)
sigma=3
y.e <- y + sigma*rnorm(n)
null.bas.per <- stdz(as.matrix(cbind(rep(1,length=n))))
lib.tp0 <- stdz(as.matrix(1*cbind((x-pt)>0)))
baseslist=list(null.bas.per,lib.tp0)
has.obj=bsml(y.e,baseslist,method="has")
bsmlc.obj=bsml(y.e,baseslist,method="bsmlc")
bsmls.obj=bsml(y.e,baseslist,method="bsmls")
plot(x,y.e)
lines(x,has.obj$fit,col="red")
lines(x,bsmlc.obj$fit,col="green")
lines(x,bsmls.obj$fit,col="blue")
[Package
bsml version 1.0-5
Index]