function [dist]=locshare(util, theta) % % returns the distribution of people over regions, based on their strict utility levels and (unobserved) preferences theta global mu N; fact=1; expo=mu*util+theta; afhalen=max(max(expo)-500,0); expo=expo-afhalen; for i=1:N dist(i,1)=exp(expo(i)); end dist=dist/sum(dist);