When b is sparse and constant by blocks, one can use isbf(Y,K=...) where K is the expected maximal size for a block. The method used is Iterative Selection of Blocks of Features procedure of Alquier (2010). When b is only sparse, one can use isbf(Y), as the default value for K is 1. Of course, one can always set K=p, but be careful, the computation time and the memory used is directly proportional to p*K.
NOTE: one can used isbfReg(X,Y) with X the identity matrix instead, but isbf(Y) is really faster.
isbf(Y, epsilon = 0.05, K = 1, impmin = 1/100,
s = NULL, v = NULL)
# generating data
b = c(rep(0,100),rep(2,40),rep(0,60))
e = rnorm(200,0,0.3)
Y = b + e
# call of isbf
A = isbf(Y,K=200,v=0.3)
# visualization of the results
plot(Y)
lines(A$beta,col="red")
Run the code above in your browser using DataLab