Two factor continuous case

A hook on the bottom a cell indicates hidden cells. Doubleclick on the hook to expose the hidden material. Some are nested.

Purpose

The aim of this work is introduce automation into the economy as a new form of capital.  We think of automation in terms of robots where one robot is the automation needed to replace one worker.  As capital grows, the cost of capital decreases so that automations previously unaffordable become affordable displacing more workers while slowing the rate at which the return on capital decreases.  Thus we need an economy in which the production of different goods has different costs of automation.

Overview of method

Warning: Most of the cells in this file are not intended to be executed unless you want to check something. The functions that one might want to use to create plots for example have been made initialization cells. If you want to use the functions here (normally this should not be necessary), evaluate initialization cells in the Evaluation menu above.  To use these functions in plots, etc., evaluate initialization cells of “Functions for 2 and 3 factors.nb”in the Evaluation menu for that notebook and then start a new notebook to use them.

In many calculations, one wants to compare the results of the 2 factor and 3 factor cases.  There is a separate file describing the creation of the functions needed for the 3 factor case. Because the symbols in that file overlap the symbols used in this file, there is a third file of functions for both cases in which this overlap has been removed.

Description of the economy

The first problem we encounter is that any model based upon maximizing total production will put all resources into the good with the smallest cost of robots. Since people want not just one good, but a variety of goods, this lopsided economy is not realistic.  This overproduction of a single good can be overcome by introducing a welfare moded with at welfare function of the form below will prevent this and result in a production scheme in which pi yi is independent of i . Here pi is the shadow price of good i.

Utility and welfare

The economy is thought of as a list of goods consolidating all firms producing each good into a single firm.  By taking the point of view of a planner optimizing welfare and using for the utility of a representative consumer the sum over i of

u=(∑_(i=1)^(OverTilde[n]))Log[y[i]

the consumer’s optimum utility corresponds to spending the same amount on each good.  This means that each good is produced in the same value for a given set of production factors.  Thus if one can find the optimum production value of one good, that production value is optimum for all goods.  Note that the actual amount of production can vary from good to good because the prices of goods can differ.

Initially the goods are numbered in order of increasing cost of robots; later this list is converted into a continuum. Since the way in which the cost of robots increases, the choice was made that the cost of a robot would increase by one unit in comparison with ordinary capital in going from one good to the next.

This work needs to compare to a baseline without robots.  Because inequality started growing about 1980, we choose to assume that automation was negligble in 1980.  This cost of a robot for good number 1 was chosen to be at the threshold cost for purchasing a robot.

Production functions

We chose a production function to be CES with basically the form

Y=AF (((a (Kc^ρ)+(1-a)(((L+R))^ρ)))^(1/ρ))

where Y is the gross domestic product, AF scales the CES function, Kc is conventional capital used in production, a determines capital’s share of production, L is the number of workers and R is the number of robots. ρ could be any of a range of values, but the only realistic cases are for ρ to be about -1 corresponding to an elasticity of 0.5 and ρ=-1 is the only value we have considered.

Since we are subdividing the economy into individual goods with different prices, the actual value function is of the form

value=(∑_(i=1)^(OverTilde[n]))(Subscript[p, i])A(((a ((Subscript[Kc, i])^ρ)+(1-a)((((Subscript[L, i])+(Subscript[R, i])))^ρ)))^(1/ρ))

Because the cost of robots  increases with i, there can be only one value of i, (Subscript[i, c]) , for which one is indifferent to using robots or human workers.  Upon converting from a discrete model to a continuous one, this critical good will have  negligble impact on the economy.  For i<(Subscript[i, c]), no humans will be employed, and for  i>(Subscript[i, c]), no robots will be employed. The economy is divided into a robot sector and a human sector.

The analysis of the system requires determining the value of (Subscript[i, c]) at various values of total capital, Kt, where

Kt=(∑_(i=1)^(OverTilde[n]))((Subscript[Kc, i])+(Subscript[CR, i])(Subscript[R, i]))

where (Subscript[CR, i])has the form

(Subscript[CR, i])=CR0+i

Procedure

A value of (Subscript[i, c]) determines CRcr by the immediately preceding equation substituting (Subscript[i, c]) for i.  At this value CRcr of CR, the wage of robots (Subscript[w, R]) is the cost of capital (Subscript[w, K]) times CRcr, (Subscript[w, R])=(Subscript[w, K]) CRcr = (Subscript[w, L]) because the operator is indifferent between robots or humans. Thus for an assumed CRcr, the ratio (Subscript[w, L])/(Subscript[w, K]) is known. This ratio can relate the amount of capital, KH, in the human sector to the amount of labor L through the first order condition.

D[Y, L]/D[Y, K] = wL/wK

where Mathematica notation for derivatives is used, i.e. D[Y,L] is the partial derivative of Y with respect  to L, etc.

For ρ=-1, this results in

KH=(((Sqrt[a]) (Sqrt[CRcr]) L)/(Sqrt[1-a]))

Thus YH can be expressed in terms of CRcr since a and L are inputs.

The number of firms in the human sector can be calculated from CRcr through the relation between CRcr and (Subscript[i, c]) combined with (OverTilde[n]).  Since all human goods have identical factors, all human produced goods have the same price. Making that price equal to 1, we have for the reference value of each good

value=(Subscript[p, i]) (Subscript[y, i])= ((YH[CRcr])/((OverTilde[n])-(Subscript[i, c])))

Because of the previous utility and welfare considerations, the value of any good robot or human is equal to the value expression above.

For a single good in the robot sector,

(Subscript[p, i]) (Subscript[y, i])= A (((a ((Subscript[Kc, i])^ρ)+(1-a)((Subscript[R, i])^ρ)))^(1/ρ))

By setting the derivative of this with respect to R equal to zero, the optimum apportionment of the total capital available to the good, (Subscript[Kt, i]) between conventional capital (Subscript[Kc, i]) and robot capital (Subscript[R, i]) is determined. Then (Subscript[Kc, i]) and (Subscript[R, i]) can be eliminated and replaced in the expression above for (Subscript[p, i]) (Subscript[y, i]) by (Subscript[Kt, i]).
Then the resulting expression for (Subscript[p, i]) (Subscript[y, i]), which we now call piyi, can be differentiated with respect to (Subscript[Kt, i]) give (Subscript[w, K]).

D[piyi, Kti] = wK

The resulting equation is solved for (Subscript[Kt, i]) .  At this point we know (Subscript[Kt, i]) for every good in the robot sector given a CRcr.

The (Subscript[Kt, i]) can be summed over the robot sector giving KtR as a function of CRcr.  We have already calculated KH as a function of CRcr.

Kt = KtR[CRcr] + KH[CRcr}

This equation can be solved for CRcr, and all the results can be used to calculate (Subscript[w, L]) and (Subscript[w, K]).

Glossary of symbols and purposes of each section

1. 1980 economy symbols

We need a somewhat realistic reference economy without automation. We choose 1980.

labor = 1980 tax returns filed
YCAL =1980  U.S. GDP  (here CAL stands for calibration not calculated)
Khat = Estimate of 1980 total capital based upon Piketty’s approximation of Khat=4 YCAL
α = estimated capital share of GDP (assumed 1/3)
γ = estimated labor’s share of GDP (assumed 2/3)
ρ = CES exponent of factors
a = coefficient of K^ρ from 1980 numbers
γ  = coefficient of L^ρ from 1980 numbers α+γ=1
AF = factor in front of CES production to make it  match 1980 CAL

2. Calculate KH assuming CRcr

The point of this section is to express KH in terms of L, a1, c1 and then to express total human production in terms of L, a1 and c1

YH = CES production function for human sector with ρ = -1
A = the symbolic coefficient with the same purpose as the numeric AF determined above
a1 = coefficient used instead of a because we need it to be symboiic rather than the numeric a determined above
KH = total capital in the human sector
c1 = coefficient used instead of a because we need it to be symboiic rather than the numeric c determined above
L = total number of human workers
CR = the value of the cost of robots relative to a unit of ordinary capital. We are splitting capital into ordinary and robots
wL = wage of labor. Equals price of a human good times D[YH,L]
wK = return on capital. Equals price of a human good times D[YH,KH]
CRcr   = wL/wK  and is the point where any lower CR is part of the robot sector and any higher CR is part of the human sector.

3. Wages

The point of this section is to determine the value of CR needed to prevent robots in 1980.

The result is CRcr1980v ≡ CR0

4. Developing yi at the critical point

Given a CRcr, the aim is to first determine the total human production and then to divide it by number of goods in the human sector to obtain a pi yi that applies to all sectors by the welfare criterion. All human goods have the same price which we set to 1.

CRmx is the maximum number of goods and the number of goods in the human sector is CRmx-CRcr
piyi is the value of the production of any good in the human sector

5. Basic treatment of the robot sector

The purpose of this section is to create the production functions for a good in the robot sector by treating the capital market competion to express yi in terms of the total capital available to produce the good

yi = the ith original robot production functiom for good i.
CRi = the relative cost of a robot for good i.
ri = the number of robots in the ith production function in terms of the total ith capital
av & cv  are symbolic versions of the numerics a & c
yip = the final version of the production function

6. Determine kti in the robot sector

In this section, the only thing we use from the last section is the result that yi depends only on CRi and kti.  This means that piyi in the robot sector is piyi=wK kti. Thus kti=piyi/wK both of which can be related to the human sector.  kti in the robot sector is given as a function of CRcr, L, a, c, and CRmx where CR0=CRcr1980.

All the quantities involve have been defined previously

7. Function for KTR using kti function

All that is happening here is that the expression previously determined for kti, which does not depend upon i, is multiplied by the number of goods in the robot section (CRcr-CR0)

8. Solving for CRcr

We now expressions for KTR and KH in which the only unknown is CRcr.  We use the expression
KTR[CRcr]+KH[CRcr]=Ktotal to solve for CRcr.  By a series of somewhat ugly manipulations, we obtain and expression for CRcr as the square of root to a quartic equation.  This equation seems to have 4 equal real roots although we have not been able demontrate that analytically.

Several new quantities are introduced in order to reach an analytic solution. There is no point in defining them as they seem to have no other significance.

9. Functions for wK,  wL, and total value of all goods

Having CRcr permits the development of expressions for the rate of return on capital and the wage of labor that depends only upon CRcr, A, a, and c.
The total value of all goods is merely the value of one good times the number of goods = CRmx-CR0.

1. Numerical test case

We are basing this work on the 1980 U.S. economy on the assumption that 1980 is the threshold year for automation.

From the IRS we can obtain a value for the total number of workers as just the number of tax returns filed.  This has to be inaccurate because some two worker families are filling jointly and some individuals are filing who do not work.  For our purposes, this does not matter because our central interest is qualitatively determining the effect of increasing capital in the presence of automation.

From tabulations, we get that GDP is 2.788 trillion $. Using Piketty’s proposal that capital is four times GDP, we obtain an estimate of total capital.

labor=99.634*10^6;
(* Output*)
YCAL=2.788*(10^12);
(* Capital Stock as a function of output *)
Khat =4*YCAL;

We propose that capital’s share of production in 1980 is 1/3 and labor’s is 2/3. Because shares depend drastically upon the relative sizes of the two factors for elasticity of 0.5, we must calculate the value of a defined above to make the shares 1/3 and 2/3.  Below c=1-a. The function cof defined below does this calculation.

cof[Kv_,L_,α_,γ_,ρ_]:={-(1/(-1-(((Kv^ρ) (L^(-ρ)) γ)/α))),(((Kv^ρ) (L^(-ρ)) γ)/(α (1+(((Kv^ρ) (L^(-ρ)) γ)/α))))}

cof[4 2.788 (10^12),99.634*10^6,1/3,2/3,-1]

a=1-0.00001786804514619618`

c=0.00001786804514619618`

The production function is YCAL=AF/(a/Khat+c/labor). Thus we use this calculate AF.

AF=YCAL(a/Khat+c/labor)

Then we can calculate the rate of return on capital as the derivative of the production function with respect to K. From thinking about Khat=4 YCAL and capital’s share being 1/3, we know that the capital’s rate of return should be 1/12 and are gratified that this checks.

D[(AF/(a/Kv+c/labor)),Kv]/.Kv-> Khat

We can calculate the yearly wage of labor by the same process.

D[(AF/(a/Khat+c/L)),L]/.L->labor

2. Calculate KH assuming a CRcr

First define a function for production in the human sector.  All goods in the human sector will have the same price because all humans get paid the same. Thus we might as well decide that the numeraire is the price a good in the human sector.

YH= A /(a1 /KH+ c1/L)

(A/((a1/KH)+(c1/L)))

Make this into a function.

YHf[KH_,L_,A_,a_,c_]:=(A/((a/KH)+(c/L)))   (* initialization cell *)

YHf[Khat,LI,AF,a,b,c]/.{a1-> a,c1->c}

Checks previous session

D[YHf[KH,L,A,a1,c1],KH]/. {KH-> Khat,L-> labor,a1->a,c1-> c,A-> AF}

Checks previous session

At the critical value of CRcr=wB/wK because the wage of robot should be the same as a human, i.e. wK CRcr=wB where wK is the return on capital, CRcr is the cost of a robot in terms of ordinary capital, and wB is the wage of labor. We can use this to express the amount of capital in the human sector in terms of CRcr and L. We know L, we don’t yet know CRcr.

CRcrit = D[YH,L]/D[YH,KH]

((c1 (KH^2))/(a1 (L^2)))

Solve[CRcr==((c1 (KH^2))/(a1 (L^2))),KH]

{{KH->-(((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))},{KH->(((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))}}

KH=(((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))

Thus we can create a function for the amount of capital in the human sector.

KHf[CRcr_,L_,a_,c_]:=(((Sqrt[a]) (Sqrt[CRcr]) L)/(Sqrt[c]))  (* initialization cell *)

And we can replace KH in the production function.

YH=FullSimplify[(A/((a1/KH)+(c1/L)))/.KH->(((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))//PowerExpand]

((A (Sqrt[CRcr]) L)/((Sqrt[a1]) (Sqrt[c1])+c1 (Sqrt[CRcr])))/.{A-> AF,L-> labor,CRcr-> CRcr1980v,a1->a,c1-> c}

2.788`*^12/.083333/3

3.  Wages

We are going to calculate wB, wK, and wA for arbitrary inputs.

We’ll need the production function for the human sector

Function for wL needed

wL=D[YH,L]

((A c1)/(((((a1/KH)+(c1/L)))^2) (L^2)))

wLv=wL/. (a1/KH)+(c1/L)-> A/ yHv

((c1 (yHv^2))/(A (L^2)))

The function for the wage of labor is thus

wLf[KH_,L_,A_,a_,c_]:=((A c)/(((((a/KH)+(c/L)))^2) (L^2)))

wLf[Khat,labor,AF,a,c]

Function for wK needed

D[YHf[KH,L,A,a1,c1],KH]

((A a1)/((KH^2) ((((a1/KH)+(c1/L)))^2)))

wKf[KH_,L_,A_,a_,c_]:=((A a)/((KH^2) ((((a/KH)+(c/L)))^2)))

wKf[Khat,labor,AF,a,c]

To ensure no robots in 1980 must start with CRcr at threshold for robots.

CRcr1980v=wLf[Khat,labor,AF,a,c]/wKf[Khat,labor,AF,a,c] (* initialization cell *)

4. Developing yi at the critical point

The program is assuming pH=1 to find yi at the critical point and thus (pi yi) at CRcr. Then one can integrate then to calculate (lai) crit and thus to integrate lai q[lai]  from the critical CR to CR=0

The second sentence in the above will be clearer later.

To implement the first sentence above we express YH in terms of CRcr.

YHf[KHf[CRcr,L,a1,c1],L,A,a1,c1]

(A/((c1/L)+(((Sqrt[a1]) (Sqrt[c1]))/((Sqrt[CRcr]) L))))

Assume that the goods are arranged in order of increasing cost of robots over the range 1 to (OverBar[n]), and that the cost of a good is proportional to its number in this line. CR[[i]]=CR0+ i.  Thus icr=(CRcr-CR0).  Thus the human sector corresponds to goods over the range icr to (OverBar[n]). Every good in the human range has the same yi. Thus the production of a good in the human sector is yi=YH/((OverBar[n])-icr).  (The good at icr can be thought of as belonging to either the human or the robot sector.) We define the price of all goods in the human sector as 1. Thus in the human sector:

piyi = YHf[KHf[CRcr, L, a1, c1], L, A, a1, c1]/((OverBar[n]) - icr)

It is useful to convert from good number to CR value. With icr=(CRcr-CR0) above and (OverBar[n]) = CRmx-CR0, we have introducing CRmx for the largest value of CR
(OverBar[n]) - icr = CRmx-CR0-(CRcr-CR0)=CRmx-CRcr

piyi= YHf[KHf[CRcr,L,a1,c1],L,A,a1,c1]/(CRmx-CRcr)

YH

piyi=((A (Sqrt[CRcr]) L)/((Sqrt[a1]) (Sqrt[c1])+c1 (Sqrt[CRcr])))/(CRmx-CRcr)

Thus every good will have the piyi [CRcr].

5. Basic treatment of the robot sector

production function for a single good i

yi= Av(((av (((kti-CRi ri))^ρ)+cv (((li+ri))^ρ)))^(1/ρ))

We don’t intend to ever make li ≠0.

yi= Av(((av (((kti-CRi ri))^ρ)+cv (ri^ρ)))^(1/ρ))/.ρ-> -1

determine ri using the capital market

The capital market requires that the derivative of yi w.r.t. ri equals zero

sri= Solve[D[yi,ri]==0,{ri}]

ri=ri/.sri[[2]]

Insert this expression for ri into yi to create yip
Assume that i is in the robot sector where li=0.

Create new form for yi by inserting solution for ri into yi eliminating ri and making li==0

yip=FullSimplify[yi//PowerExpand]

6. Determine kti in the robot sector

Because kti is the only factor in yipp and yipp is first order homogeneous, Eulers theorem gives

piyi = wK kti
kti=piyi/wK

Note that kti is not a function of CR!

Thus a function for kti, which we never further use after next line, is

ktif[CRcr_,L_,A_,a_,c_,CR0_,CRmx_]:=(( YHf[KHf[CRcr,L,a,c],L,A,a,c])/((CRmx-CRcr)wKf[KHf[CRcr,L,a,c],L,A,a,c]))

kti=FullSimplify[ktif[CRcr,L,A,a1,c1,CR0,CRmx]//PowerExpand]

The above is not a function of i

7. Function for KTR using kti function

KtR = (∑_(nG=1)^icr)ktif[CRcr,L,av,bcv,CRmx]

Need the number of terms.  Should be CRcr-CR0

KtR =FullSimplify[(((((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))+ CRcr L)/(-CRcr+CRmx))(CRcr-CR0)/(CRmx-CRcr)//PowerExpand]

KtRf[CRcr_,L_,A_,av_,cv_,CR0_,CRmx_]:=(((-CR0+CRcr) ((((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))+CRcr L))/( (-CRcr+CRmx)))

8. Solving for CRcr

At the critical point KtR+KH=Khat

Distribute[KtR/.{a1-> a,c1->c}]

KH=(((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))/. {a1-> a,c1->c}

Thus CRcr is to be adjusted until (((-CR0+CRcr) ((((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))+CRcr L))/(((CRcr-CRmx))^2))+ (((Sqrt[a]) (Sqrt[CRcr]) L)/(Sqrt[c]))=Kt

This is simple enough to imagine there might be an analytical solution.

(((-CR0+CRcr) ((((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))+CRcr L))/( (-CRcr+CRmx)))+ (((Sqrt[a]) (Sqrt[CRcr]) L)/(Sqrt[c]))=Kt=K0

Get rid of the roots by defiing x=(Sqrt[CRcr]) etc

(((-CR0+(x^2)) ((((Sqrt[a]) x L)/(Sqrt[c]))+(x^2) L))/((-(x^2)+CRmx)))+ (((Sqrt[a]) x L)/(Sqrt[c]))=Kt=K0

Let CR0 be called (x0^2)and CRmx be called (xmx^2)

Divide by L

(((-(x0^2)+(x^2)) ((((Sqrt[a]) x )/(Sqrt[c]))+(x^2) ))/((-(x^2)+(xmx^2))))+ (((Sqrt[a]) x )/(Sqrt[c]))=K0dL

(((-(x0^2)+(x^2)) (ac x+(x^2) ))/((-(x^2)+(xmx^2))))+  ac x =K0dL

(-(x0^2)+(x^2)) (ac x+(x^2) )+  (-(x^2)+(xmx^2)) ac x = (-(x^2)+(xmx^2))K0dL

Collect[Expand[(-(x0^2)+(x^2)) (ac x+(x^2) )+  (-(x^2)+(xmx^2)) ac x - (-(x^2)+(xmx^2))K0dL,x],x]

Reduce[(x^4)+(x^2) (K0dL-(x0^2))-K0dL (xmx^2)+x (-ac (x0^2)+ac (xmx^2))==0&&0≤ x≤ x0<xmx&&K0dL>x0 x0,x,Reals]

Table[Root[-K0dL (xmx^2)+(-ac (x0^2)+ac (xmx^2)) #1+(K0dL-(x0^2)) ((#1)^2)+((#1)^4)&,2]/.{K0dL-> Khat/labor,xmx->(Sqrt[400000]),ac->(Sqrt[a/c]),x0-> (Sqrt[223859.3251299757`])},{i,1,4}]

Table[Root[-K0dL (xmx^2)+(-ac (x0^2)+ac (xmx^2)) #1+(K0dL-(x0^2)) ((#1)^2)+((#1)^4)&,2]/.{K0dL->2  Khat/labor,xmx->(Sqrt[400000]),ac->(Sqrt[a/c]),x0-> (Sqrt[223859.3251299757`])},{i,1,4}]

511.116^2

CRcrf[K0_,L_,a_,c_,CR0_,CRmx_]:=(((Root[-((CRmx K0)/L)+#1+(-(Sqrt[(a/c)]) CR0+(Sqrt[(a/c)]) CRmx) #1+(-CR0+(K0/L)) ((#1)^2)+((#1)^4)&,2]))^2) (* initialization cell *)

CRcrf[Khat,labor,a,c,223859.3251299757`,400000]

CRcrf[2 Khat,labor,a,c,223859.3251299757`,400000]

9. Functions for wK,  wL, and total value of all goods

Now that we have a function for CRcr, we can use it to find the wages of labor and capital

Previously we found that

wL=D[YH,L]

((A c1)/(((((a1/KH)+(c1/L)))^2) (L^2)))

Substitute for KH

FullSimplify[((A c1)/(((((a1/KH)+(c1/L)))^2) (L^2)))/.KH-> (((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))//PowerExpand]

The expression above is for wL in terms of a, c, and CRcr

The easiest thing to do is to create a Module to combine CRcrf with the formula for wL

wL2crf[K0_,L_,A_,a_,c_,CR0_,CRmx_]:=Module[{CRcr},CRcr=CRcrf[K0,L,a,c,CR0,CRmx];Return[((A CRcr)/((((Sqrt[a])+(Sqrt[c]) (Sqrt[CRcr])))^2))];]  (* initialization cell *)

Check at initial conditions

wL2crf[Khat,labor,AF,a,c,223859.32510687847`,400000]

Previously we found that

wK=((A a1)/((KH^2) ((((a1/KH)+(c1/L)))^2)))

Substitute for KH

FullSimplify[((A a1)/((KH^2) ((((a1/KH)+(c1/L)))^2)))/.KH-> (((Sqrt[a1]) (Sqrt[CRcr]) L)/(Sqrt[c1]))//PowerExpand]

The expression above is for wK in terms of a, c, and CRcr

wK2crf[K0_,L_,A_,a_,c_,CR0_,CRmx_]:=Module[{CRcr},CRcr=CRcrf[K0,L,a,c,CR0,CRmx];Return[(A/((((Sqrt[a])+(Sqrt[c]) (Sqrt[CRcr])))^2))];]  (* initialization cell *)

Check at initial conditions

wK2crf[Khat,labor,AF,a,c,223859.32510687847`,400000]

The functions above are the most used.  A possibly useful addendum is an expression for the total value produced. This is given by (OverBar[n]) pi yi

Referring back to previous functions

piyi= YHf[KHf[CRcr,L,a1,c1],L,A,a1,c1]/(CRmx-CRcr)

To get the total value just multiply by NG = (CRmx-CR0)

valuef[K0_,L_,A_,a_,c_,CR0_,CRmx_]:=Module[{CRcr,Ytot}, CRcr=CRcrf[K0,L,a,c,CR0,CRmx];Ytot=YHf[KHf[CRcr,L,a,c],L,A,a,c](CRmx-CR0)/(CRmx-CRcr);Return[Ytot];] (* initialization cell*)

Check 1980 value

valuef[Khat,labor,AF,a,c,CRcr1980v,700000]

Checks

tresf[K0_,L_,A_,a_,c_,CR0_,CRmx_]:=Module[{CRcr,wK,wL,piyi,res},CRcr=CRcrf[K0,L,a,c,CR0,CRmx];wK=(A/((((Sqrt[a])+(Sqrt[c]) (Sqrt[CRcr])))^2));wL=((A CRcr)/((((Sqrt[a])+(Sqrt[c]) (Sqrt[CRcr])))^2));piyi= YHf[KHf[CRcr,L,a,c],L,A,a,c]/(CRmx-CRcr);res={CRcr,wK,wL,piyi};Return[res];]

tresf[Khat,labor,AF,a,c,223859.32510687847`,400000]

Ksharef[K0_,L_,A_,a_,c_,CR0_,CRmx_]:=Module[{CRcr,wK,wL,pY,tRes,res},tRes=tresf[K0,L,A,a,c,CR0,CRmx];wK=tRes[[2]];wL=tRes[[3]];pY=wK K0+wL L;Return[wK K0/pY];]

Ksharef[Khat,labor,AF,a,c,223859.32510687847`,400000]

Lsharef[K0_,L_,A_,a_,c_,CR0_,CRmx_]:=Module[{CRcr,wK,wL,pY,tRes,res},tRes=tresf[K0,L,A,a,c,CR0,CRmx];wK=tRes[[2]];wL=tRes[[3]];pY=wK K0+wL L;Return[wL L/pY];]

Lsharef[Khat,labor,AF,a,c,223859.32510687847`,400000]