Learn R Programming

mht (version 3.1.2)

refit.mht: Refit a mht object

Description

Refit a mht object for a new observation Ynew

Usage

"refit"(object,Ynew,var_nonselect,sigma,maxordre,ordre,m,show,IT,...)

Arguments

object
Object of class "mht".
Ynew
Response variable of length n.
var_nonselect
Number of variables that don't undergo feature selection. They have to be in the first columns of data. Default is 1, the selection is not performed on the intercept.
sigma
Value of the variance if it is known; 0 otherwise. Default is 0.
maxordre
Number of variables to be ordered. Default is min(n/2-1,p/2-1).
ordre
Several possible algorithms to order the variables, ordre=c("bolasso","pval","pval_hd","FR"). "bolasso" uses the dyadic algorithm with the Bolasso technique dyadiqueordre, "pval" uses the p-values obtained with a regression on the full set of variables (only when p
m
Number of bootstrapped iteration of the Lasso. Only use if the algorithm is set to "bolasso". Default is m=100.
show
Vector of logical values, show=(showordre,showtest,showresult). Default is (1,0,1). If showordre=TRUE, shows the variables being ordered at each step of the algorithm. If showtest=TRUE, the number of regularization parameters tested is printed to show the advancement of the dyadic algorithm. Only used if the algorithm is set to "bolasso". if showresult=TRUE, shows the value of the statistics and the estimated quantile at each step of the procedure.
IT
Number of simulations for the calculation of the quantile. Default is 1000.
...
not used.

Value

data
A list containing:
  • Y - the input response vector
  • means.X - Vector of means of the input data matrix.
  • sigma.X - Vector of variances of the input data matrix.
coefficients
Matrix of the estimated coefficients. Each row concerns a specific user level alpha.
residuals
Matrix of the residuals. Each row concerns a specific user level alpha.
relevant_var
Set of the relevant variables for each alpha.
fitted.values
Matrix of the fitted values, each column concerns a specific user level alpha.
ordre
Order obtained on the maxordre variable.
ordrebeta
The full order on all the p variables.
kchap
Vector containing the length of the estimated set of relevant variables, for the matrix containing the intercept, for each values of alpha.
quantile
The estimated quantiles used in the second step of the procedure.
call
The call that has been used.
call.old
The call that produced the initial 'object'.

Details

maxq is not a parameter of refit.mht as the same number of alternative is neccessary for a refit of the model. For more details, see mht.

Examples

Run this code
## Not run: 
# x=matrix(rnorm(100*20),100,20)
# beta=c(rep(2,5),rep(0,15))
# y=x%*%beta+rnorm(100)
# ynew=x%*%beta+rnorm(100)
# 
# # mht
# mod=mht(x,y,alpha=c(0.1,0.05),maxordre=15)
# 
# # refit mht on a new vector of observation
# mod2=refit(mod,ynew,maxordre=15)
# ## End(Not run)

Run the code above in your browser using DataLab