function [xs, xes, er]=Lsq_Occlusion(A, y, index);

[m,T]=size(A);Jb=length(index);

ind=[1:m];ind=ind';
ind(index{2})=[];

As=A(ind,index{1}); ys=y(ind); 
xs=pinv(As'*As)*As'*ys;

As=A(:,index{1}); e=y-As*xs;
xe=zeros(m,1);
xe(index{2})=e(index{2});
xes=e(index{2});
% x=[xs;xes];
er=e-xe;
return

