function smsp=mcsmooth(H,sp)
%function smsp=mcsmooth(H,sp)
% provides for each t p(S_t|data_T)
smsp=zeros(size(sp));
[T ns]=size(sp);
smsp(T,:)=sp(T,:);
for it=T-1:-1:1
   X=H.*(repmat(sp(it,:),ns,1));
   smsp(it,:)=smsp(it+1,:)*(X./repmat(sum(X')',1,ns));
end
