% regional model for kwrt reg N=2; % the number of regions alpha=[.6;.6]; alpha_= alpha.^(-alpha).*(1-alpha).^(alpha-1); r=1; beta=0.8; % share of income going to consumption instead of housing L=[3;3]; %w=[0.77185;0.72815]; % this about works for supply/demand sumK=3; K=[1;1]; lambda=1; %A=[1;1]; pens=[3;1]; tau = [1 1.3;1.3 1]; for i=1:N pensshare(i,1)=pens(i)/sum(pens); end P=pensshare*ones(1,N); H=[1;1]; % housing stock Hp=[1;1]; % housing rent flow % compute equilibrium values [w,K]=fixk(sumK,w,r,L,alpha,N); exp_nohouse= L.*w+ pensshare*sum(r*K); expenditures=inv(eye(N)-(1-beta)*P)*exp_nohouse; Hp=(1-beta)*expenditures./H; supply = alpha_.*A.*(L.^alpha).*(K.^(1-alpha)); q=(w.^alpha).*(r.^(1-alpha))./A; % share: how much of the expenditures in (column) go to (row)?. for column=1:N for row=1:N rawshare(row,column)=supply(row)*exp(-lambda*q(row)*tau(row,column)); end end for column=1:N share(:,column)=rawshare(:,column)/sum(rawshare(:,column)); end p=sum(share.*(tau.*(q*ones(1,2))))'; util_work=log(w)-beta*log(p)-(1-beta)*log(Hp); util_pens=-beta*log(p)-(1-beta)*log(Hp); demand=share*beta*expenditures./q; supply-demand