
clear all;

% parameters
m = 16; % dimension of inputs
sigma1 = 1.0; % std-dev of linear coefficients
sigma2 = 0.01; % std-dev of quadratic coefficients
sigma_x = 1.0; % std-dev of inputs
sigma_y = 1.0; % std-dev of prediction error

% generate random coefficient 2nd order prediction model
model = reg_least_sq_model(m,sigma1,sigma2);

% generate random training/test sets...

[X,y] = reg_least_sq_data(8,model,sigma_x,sigma_y);
train_small = struct('X',X,'y',y);

[X,y] = reg_least_sq_data(16,model,sigma_x,sigma_y);
train_med = struct('X',X,'y',y);

[X,y] = reg_least_sq_data(64,model,sigma_x,sigma_y);
train_large = struct('X',X,'y',y);

[X,y] = reg_least_sq_data(1024,model,sigma_x,sigma_y);
test = struct('X',X,'y',y);

save reg_least_sq.mat train_small train_med train_large test model;

