function err = target(w,x,y,lambda,w1)
% Target function for a demo  optimization problem
%
% err = target(w,x,y,lambda,w1)
% 
% w [1,W] parameter vector to be optimized
% x [N,1] independent variable of the regression model
% y [N,1] dependent variable
% lambda [scalar] regularization parameter (optional)
%
% This dummy function does something
%
num = nargin;

if num == 5 
      regul = lambda* sumsqr(w-w1);
else
      regul = 0;
end

err = sumsqr(y-x*w) + regul;
return
