function [mst_new, vst_new] = upd_moments_psn_obs(mstold, ...
vstold, mstsp, vstsp, xt, nodes, ndps, w, mthd);
  
global ws scl rt;
if mthd == 0
    if 1
     chovst = chol(vstsp)';
     chovsp = chovst*ndps;
     nsp = repmat(mstsp,1,nodes) + chovsp; % is a matrix. each column  corresponds to a node
     wpr = exp( gauss_logProb(nsp, mstold, vstold) ...
       - gauss_logProb(nsp, mstsp, vstsp));
     w = w' .* wpr;
    else
     chovst = chol(vstold)';
     chovsp = chovst*ndps;
     nsp = repmat(mstold,1,nodes) + chovsp; % is a matrix. each column  corresponds to a node
     w = w';
    end
else
    nsp = normrnd_mt(nodes, mstsp, vstsp);
    % nsp = sort(nsp);    
    w = exp( gauss_logProb(nsp, mstold, vstold) ...
       - gauss_logProb(nsp, mstsp, vstsp));
end
       
psm = exp(nsp*scl);
h = poisspdf(xt(1),psm*rt);
for i=2:ws
    h = h.*poisspdf(xt(i),psm*rt);
end

c = h.*w; 
np = 0;
if np
    figure(4),subplot(311),plot(nsp,h);
    subplot(312), plot(nsp,normpdf(nsp,mstsp,sqrt(vstsp)));
    subplot(313), plot(nsp,h.*normpdf(nsp,mstold,sqrt(vstold)));
   % pause;
end

mst_new = sum(c.*nsp)/sum(c);
vst_new = sum(c.*nsp.*nsp)/sum(c)-mst_new^2;