function [ SSR ] = Varx1( theta, U, Y, xo )
%VARX1 evaluate the sum of the preidcion error for the following ARX model
% y(k+1) = a*y(k) + b1*u(k) + b2*u(k-1) + e(k+1)
%
%   [ SSR ] = Varx1( theta, U, Y, xo )
%
%Input values
%   theta   : column vector storing the paramethers [a b1 b2]'
%   U       : column vector storing the input data
%   Y       : column vector storing the output data
%   x0      : intial state for simulation  [y(0), y(-1), u(0)]


genTheta = [theta;0];
genXo = [xo;0];
Yp = ArxPred( U,Y,  genTheta,genXo);

SSR = sum((Yp -Y).^2);

