% A simple example of how to use monreggpav.m

clear;
clc;
[data, names] = xlsread('Simulation','READ');

[s1,s2]=size(data);
N=s1;
p=s2-2;

X=data(:,1:p);
Y=data(:,p+1);
W=data(:,p+2);

Yfit=monreggpav(X,Y,W);

%Computing sum of square residuals

f=norm(Y-Yfit)^2;