src/baseline.m [236:311]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%%%%%%%%%%%%%
% Functions %
%%%%%%%%%%%%%

function e = excess_demand_lh(wage_lh, wage_sh, wage_o, params)
    lh_intercept = params(1);
    lh_demand_e = params(2);
    fe_long = params(3);
    fe_short = params(4);
    fe_other = params(5);
    supply_e = params(6);
    pool = params(7);
    demand_shift = params(8);
    demand = 140000000*exp(lh_intercept + log(wage_lh)*lh_demand_e) - demand_shift;
    supply_share = exp(fe_long + log(wage_lh)*supply_e)/ ...
                   (1+exp(fe_short + log(wage_sh)*supply_e)+ ...
                   exp(fe_long + log(wage_lh)*supply_e)+ ...
                   exp(fe_other + log(wage_o)*supply_e));
    e = abs(demand - pool*supply_share);
    if wage_lh < 0
        e = 100000000;
    end
end


function e = excess_demand_sh(wage_sh, wage_lh, wage_o, lh_employment, params)
    sh_intercept = params(1);
    sh_demand_e = params(2);
    sh_lh_response = params(3);
    fe_long = params(4);
    fe_short = params(5);
    fe_other = params(6);
    supply_e = params(7);
    pool = params(8);
    demand = 140000000*exp(sh_intercept + log(wage_sh)*sh_demand_e + lh_employment*sh_lh_response) ;
    supply_share = exp(fe_short + log(wage_sh)*supply_e)/ ...
                   (1+exp(fe_short + log(wage_sh)*supply_e)+ ...
                   exp(fe_long + log(wage_lh)*supply_e)+ ...
                   exp(fe_other + log(wage_o)*supply_e));
    e = abs(demand - pool*supply_share);
    if wage_sh < 0
        e = 100000000;
    end
end

function q = lh_demand(w,params)
    lh_intercept = params(1);
    lh_demand_e = params(2);
    q = 140000000*exp(lh_intercept + log(w)*lh_demand_e) - demand_shift;
end

function q = sh_demand(w,lh_employment,params)
    sh_intercept = params(1);
    sh_demand_e = params(2);
    sh_lh_response = params(3);
    q = 140000000*exp(sh_intercept + log(w)*sh_demand_e + lh_employment*sh_lh_response);
end

function q = lh_supply(w,params,ws,wo)
    lh_intercept = params(1);
    lh_demand_e = params(2);
    fe_long = params(3);
    fe_short = params(4);
    fe_other = params(5);
    supply_e = params(6);
    pool = params(7);
    supply_share = exp(fe_long + log(w)*supply_e)/ ...
                   (1+exp(fe_short + log(ws)*supply_e)+ ...
                   exp(fe_long + log(w)*supply_e)+ ...
                   exp(fe_other + log(wo)*supply_e));
   q = pool*supply_share;
end



end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/equilibrium_with_growth.m [241:316]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%%%%%%%%%%%%%
% Functions %
%%%%%%%%%%%%%

function e = excess_demand_lh(wage_lh, wage_sh, wage_o, params)
    lh_intercept = params(1);
    lh_demand_e = params(2);
    fe_long = params(3);
    fe_short = params(4);
    fe_other = params(5);
    supply_e = params(6);
    pool = params(7);
    demand_shift = params(8);
    demand = 140000000*exp(lh_intercept + log(wage_lh)*lh_demand_e) - demand_shift;
    supply_share = exp(fe_long + log(wage_lh)*supply_e)/ ...
                   (1+exp(fe_short + log(wage_sh)*supply_e)+ ...
                   exp(fe_long + log(wage_lh)*supply_e)+ ...
                   exp(fe_other + log(wage_o)*supply_e));
    e = abs(demand - pool*supply_share);
    if wage_lh < 0
        e = 100000000;
    end
end


function e = excess_demand_sh(wage_sh, wage_lh, wage_o, lh_employment, params)
    sh_intercept = params(1);
    sh_demand_e = params(2);
    sh_lh_response = params(3);
    fe_long = params(4);
    fe_short = params(5);
    fe_other = params(6);
    supply_e = params(7);
    pool = params(8);
    demand = 140000000*exp(sh_intercept + log(wage_sh)*sh_demand_e + lh_employment*sh_lh_response) ;
    supply_share = exp(fe_short + log(wage_sh)*supply_e)/ ...
                   (1+exp(fe_short + log(wage_sh)*supply_e)+ ...
                   exp(fe_long + log(wage_lh)*supply_e)+ ...
                   exp(fe_other + log(wage_o)*supply_e));
    e = abs(demand - pool*supply_share);
    if wage_sh < 0
        e = 100000000;
    end
end

function q = lh_demand(w,params)
    lh_intercept = params(1);
    lh_demand_e = params(2);
    q = 140000000*exp(lh_intercept + log(w)*lh_demand_e) - demand_shift;
end

function q = sh_demand(w,lh_employment,params)
    sh_intercept = params(1);
    sh_demand_e = params(2);
    sh_lh_response = params(3);
    q = 140000000*exp(sh_intercept + log(w)*sh_demand_e + lh_employment*sh_lh_response);
end

function q = lh_supply(w,params,ws,wo)
    lh_intercept = params(1);
    lh_demand_e = params(2);
    fe_long = params(3);
    fe_short = params(4);
    fe_other = params(5);
    supply_e = params(6);
    pool = params(7);
    supply_share = exp(fe_long + log(w)*supply_e)/ ...
                   (1+exp(fe_short + log(ws)*supply_e)+ ...
                   exp(fe_long + log(w)*supply_e)+ ...
                   exp(fe_other + log(wo)*supply_e));
   q = pool*supply_share;
end



end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



