% Example 5.1 from the paper % SSVS on the Hald dataset. data = load('hald'); X_ = data.ingredients; Y_ = data.heat; n = size(X_,1); p = size(X_,2); a = ones(n,1); % Preprocess the data (as described in Section 1 of the paper). This is % necessary in cases where there is a feature that must be included in all % models (e.g. an intercept term). b = eye(n) - (a*a'/n); X = b*X_; Y = b*Y_; samples = ssvs(X,Y,5000,[1,5]); counts = count(samples)