#simulate a dataset with continuous data
dataset <- matrix(runif(2000 * 50, 1, 100), nrow = 1000 , ncol = 50)
#the target feature is the last column of the dataset as a vector
b <- matrix( rnorm(100, 3, 0.4), ncol = 2 )
id <- sample(1:50, 5)
b[-id,] <- 0
e <- matrix( rnorm(2 * 1000, 0, 5), ncol = 2 )
target <- crossprod( t(cbind(1, dataset)), rbind(c(10, 15), b) ) + e
results <- testIndMVreg(target, dataset, xIndex = 1, csIndex = 50)
results
aa <- SES(as.matrix(target), dataset, max_k = 3, threshold = 0.05)
Run the code above in your browser using DataLab