
function [prob] = eval_pst_probs(data,pst)

X = data(:,2:end-1);
N = data(:,end); % counts
n = size(X,1); 

prob = repmat(pst{1}.p,n,1); % root predictions

for i=2:length(pst), 
  nx = length(pst{i}.x); % length of history
  I  = find(sum(abs(X(:,1:nx)-repmat(pst{i}.x,n,1)),2)==0);
  prob(I) = pst{i}.p; % more specific predictions overwrite earlier ones
end;
