Optimal variable selection in regression models