% Generate employment scenarios, collected into a matrix.
function emplPaths = SampleEmplPaths(empl0,transMatrix,timeHorizon,numRepl)
  cumProbs = cumsum(transMatrix,2);
  emplPaths = zeros(numRepl, timeHorizon);
  for k = 1:numRepl
      emplPaths(k,1) = sum(rand > cumProbs(empl0,:))+1;
      for t = 2:timeHorizon
        emplPaths(k,t) = sum(rand > cumProbs(emplPaths(k,t-1),:))+1;
      end
  end
end

