Occupational Choice - Between Worker and Entrepreneur

This function determines the occupational choice for all combinations of state of assets and productivity based on degree of imperfect enforcement of contracts

Back to full code page https://kritikhanna.github.io/BKS-modified/

Function Inputs : asset grid(1 by M) and entrepreneurial productivity grid(1 by N) relevant model parameters required

Function Outputs : Matrices O, COH, K and L (both M X N) for each combination of a and z O is the occupational choice function - o = 0 for worker, 1 for entrepreneur

Contents

function [mt_o, mt_coh, mt_k, mt_l]= OC2(varargin)
close all;
bl_profile = false;      % Switch off profile if running a tester/calling from another function
bl_saveimg = true;
if(bl_profile)
profile off;
profile on;
end

addpath(genpath('/Users/sidhantkhanna/Documents/GitHub/BKS modified/'));

Assigning Parameters

if ~isempty(varargin)

    [ar_a,ar_z, ...
        fl_alpha,fl_theta,fl_delta,fl_kappa,fl_r,fl_w,fl_phi,fl_ahi,fl_zhi, ...
         it_zgridno, it_agridno, ...
        ] = varargin{:};

    bl_print  = false;
    bl_plot   = true;


else
    close all;

    fl_ahi         = 5;
    fl_zhi         = 2.5;
    it_agridno     = 5;
    it_zgridno     = 6;
    ar_a = linspace(0,fl_ahi,it_agridno);
    ar_z = linspace(1.2,fl_zhi,it_zgridno);
    fl_phi         = 0.5;

    fl_alpha = 0.4;
    fl_theta = 0.79-fl_alpha;
    fl_delta = 0.05;
    fl_kappa = 0;

    [fl_r,fl_w,fl_ahi] = ...
        deal(0.05,1.5,100);
    bl_print       = true;
    bl_plot        = true;

end

fl_R = fl_r + fl_delta;

[a_m,z_m] = meshgrid(ar_a,ar_z);
a_m       = a_m';
z_m       = z_m';

Making Occupational choice

[mt_k_star, mt_l_star] = optikl(ar_a,ar_z, ...
        fl_alpha,fl_theta,fl_delta,fl_kappa,fl_r,fl_w,fl_phi,fl_ahi,fl_zhi, ...
         it_zgridno, it_agridno);

 mt_wage         = fl_w.*ones(it_agridno, it_zgridno);
 mt_profit       = z_m.*(mt_k_star.^fl_alpha).*(mt_l_star.^fl_theta) - fl_R.*mt_k_star - fl_w.*mt_l_star - ((1+fl_r)*(fl_kappa)).*ones(it_agridno, it_zgridno);
 mt_o            = zeros(it_agridno, it_zgridno);
 mt_o(mt_wage<mt_profit) = 1;                        % Matrix for Occupational Choice
 mt_income       = max(mt_wage,mt_profit);           % Matrix for Income
 mt_coh          = mt_income + a_m.*(1+fl_r);        % Matrix for COH
 mt_k            = mt_k_star;
 mt_l            = mt_l_star;
 mt_k(mt_o==0)   = 0;                                % If you choose worker, you do not rent any capital
 mt_l(mt_o==0)   = 0;                                % If you choose worker, you do not hire any workers

Printing Outputs

 if(bl_print)
    disp('Below is mt_wage');
    disp(mt_wage);
    disp('Below is mt_profit ');
    disp(mt_profit );
    disp('Below is mt_o ');
    disp(mt_o);
    disp('Below is mt_income');
    disp(mt_income);
    disp('Below is mt_coh');
    disp(mt_coh);
    disp('Below is mt_k');
    disp(mt_k);
    disp('Below is mt_l');
    disp(mt_l);
 end


 if(bl_plot)
figure(1)
imagesc(ar_a,ar_z,mt_o');
set(gca,'YDir','normal')
xlabel('assets','FontSize', 20);
ylabel('Entrepreneurial productivity','FontSize', 20);
if(bl_saveimg)
saveas(gcf, '/Users/sidhantkhanna/Documents/GitHub/BKS modified/code/Households/figures/OC2/OC2.png');
end
end

if(bl_profile)
profile off;
profile viewer;
st_file_name = '/Users/sidhantkhanna/Documents/GitHub/BKS modified/code/Profile/Households/OC2';
profsave(profile('info'), st_file_name);

end
Below is mt_wage
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000

Below is mt_profit 
    0.0325    0.0827    0.1805    0.3528    0.6349    1.0710
    0.4081    0.7048    1.0811    1.5570    2.1585    2.9199
    0.5128    0.9454    1.4797    2.1357    2.9390    3.9227
    0.5596    1.1032    1.7662    2.5685    3.5361    4.7013
    0.5746    1.2159    1.9917    2.9221    4.0332    5.3573

Below is mt_o 
     0     0     0     0     0     0
     0     0     0     1     1     1
     0     0     0     1     1     1
     0     0     1     1     1     1
     0     0     1     1     1     1

Below is mt_income
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000
    1.5000    1.5000    1.5000    1.5570    2.1585    2.9199
    1.5000    1.5000    1.5000    2.1357    2.9390    3.9227
    1.5000    1.5000    1.7662    2.5685    3.5361    4.7013
    1.5000    1.5000    1.9917    2.9221    4.0332    5.3573

Below is mt_coh
    1.5000    1.5000    1.5000    1.5000    1.5000    1.5000
    2.8125    2.8125    2.8125    2.8695    3.4710    4.2324
    4.1250    4.1250    4.1250    4.7607    5.5640    6.5477
    5.4375    5.4375    5.7037    6.5060    7.4736    8.6388
    6.7500    6.7500    7.2417    8.1721    9.2832   10.6073

Below is mt_k
         0         0         0         0         0         0
         0         0         0    3.9828    4.5557    5.2808
         0         0         0    7.0340    7.7991    8.7359
         0         0    9.1821    9.9462   10.8677   11.9774
         0         0   11.8968   12.7830   13.8411   15.1022

Below is mt_l
         0         0         0         0         0         0
         0         0         0    0.8334    1.1142    1.4696
         0         0         0    1.2101    1.5851    2.0443
         0         0    1.1442    1.5187    1.9704    2.5143
         0         0    1.3560    1.7903    2.3090    2.9271