home *** CD-ROM | disk | FTP | other *** search
-
- _b_o_o_t_s_t_r_a_p _e_s_t_i_m_a_t_e_s _o_f _p_r_e_d_i_c_t_i_o_n _e_r_r_o_r
-
- bootpred(x,y,nboot,theta.fit,theta.predict,err.meas,...)
-
- _A_r_g_u_m_e_n_t_s:
-
- x: a matrix containing the predictor (regressor)
- values. Each row corresponds to an observa-
- tion.
-
- y: a vector containing the response values
-
- nboot: the number of bootstrap replications
-
- theta.fit: function to be cross-validated. Takes x and y
- as an argument. See example below.
-
- theta.predict: function producing predicted values for
- theta.fit. Arguments are a matrix x of pred-
- ictors and fit object produced by theta.fit.
- See example below.
-
- err.meas: function specifying error measure for a sin-
- gle response y and prediction yhat
- - see examples below
-
- _V_a_l_u_e_s:
-
- list with the following components
-
- app.err: the apparent error rate- that is, the mean value
- of err.meas when theta.fit is applied to x and y,
- and then used to predict y.
-
- optim: the bootstrap estimate of optimism in app.err. A
- useful estimate of prediction error is
- app.err+optim
-
- err.632: the ".632" bootstrap estimate of prediction error.
-
- _R_e_f_e_r_e_n_c_e_s:
-
- Efron, B. (1983). Estimating the error rate of a pred-
- iction rule: improvements on cross-validation. J. Amer.
- Stat. Assoc, vol 78. pages 316-31.
-
- Efron, B. and Tibshirani, R. (1993) An Introduction to
- the Bootstrap. Chapman and Hall, New York, London.
-
- _E_x_a_m_p_l_e_s:
-
- # bootstrap prediction error estimation in least squares
- # regression
- x <- rnorm(85)
- y <- 2*x +.5*rnorm(85)
- theta.fit <- function(x,y)lsfit(x,y)
- theta.predict <- function(fit,x)
- cbind(1,x)%*%fitoef
-
- sq.err_function(y,yhat) (y-yhat)^2
- results <- bootpred(x,y,20,theta.fit,theta.predict,
- err.meas=sq.err)
-
- # for a classification problem, a standard choice
- # for err.meas would simply count up the
- # classification errors:
- miss.clas <- function(y,yhat) 1*(yhat!=y)
- # with this specification, bootpred estimates
- # misclassification rate
-
-