function V = valit(beta,c,w,p) ;



%%%% Value function iteration.

%%%% beta is the discount factor, c is the unemployment compensation

%%%% w is the wage grid and p is the probability distribution according to 

%%%% which wages are drawn.



N = size(w,1) ;



%%% Starting Value

V = zeros(N,1) ;



%%% Accuracy criterion

accur = 1e-10 ;

stop  = 0 ;



%%% Value function iteration.

while stop == 0

   

   newV = max(w + beta*V,c+beta*p*V) ;

   %%% Stopping Rule

   if max(abs(V-newV)) < accur

      stop = 1 ;

   end ;

   V = newV ;

end ;





