{VERSION 2 3 "APPLE_PPC_MAC" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Title " 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 11 "Nelwin 1977" }}}{EXCHG {PARA 19 "" 0 "" {TEXT -1 126 "Version: 20 Sep 96\nŠ Esben Sloth Ander sen (esa@business.auc.dk).\nWritten in collaboration with Anne K. Jens en and Lars Madsen," }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 567 "The progr am is called NW77param since it is very flexible with respect to makin g parameter changes. The calling sequence is NW77param(N, T, par1=x, p ar2=y, ...), where N is the number of firms, T is the number of period s, par1 is the name of the first parameter to be changed and x is its \+ value, par2 is the name of the second parameter to be changed and y is its value, etc. One of the parameters to change is seed which has bee n discussed earlier. In these runs there is normally a split between f irms so that only half are innovators while all firms are imitators." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "The program has not been checke d after it has been translated from Maple V.2 to Maple V.4." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 3748 "NW77param := proc(n,T)\nlocal i, t;\noptio ns `ESA, 20 Sep 96`;\nglobal _descr, _, A, K, Kave, Aave, HHs, HHk, pi , Piave, SDPiave, P, s, sK, SDAave, SDKave, Ktot, Qtot, rin, Q, Drawsn o, Inv, Qgap, _seed, Aim, Ain, Rmax, Rmean, Aprel, Ides, Imax, lambda, loans, Lottery, muact, mudes, NormalDistr, param;\n\nwith (stats);\nw ith(random);\n\n# MODEL DESCRIPTION\n_descr \011\011:= table();\n_desc r[Model] \011:= `NW77param 2.0.1`;\n_descr[Date] \011:= `20 Sep 96`;\n _descr[Variant] \011:= `Half innovators; multidraws off.`;\n\n# PARAME TERS\nparam\011\011:= \{b, c, delta, dem, dim, din, eta, \n\011\011 \011phi, rim, rin, Seed, sigma, split\};\n_\011\011:= table();\n_[Aini t]\011:= 0.16;\n_[b]\011\011:= 1;\n_[c]\011\011:= 0.16;\n_[delta]\011: = 0.03;\n_[dim]\011\011:= 0.125;\n_[din]\011\011:= 0.125;\n_[Dtot]\011 \011:= 67;\n_[eta]\011\011:= 1;\n_[phi]\011\011:= 0.01;\n_[psi]\011 \011:= 1;\n_[TRim]\011\011:= 0.4;\n_[TRin]\011\011:= 4.0;\n_[Seed]\011 \011:= 11;\n_[sigma]\011:= 0.05;\n_[split]\011:= true;\n\n# PARAMETER \+ REVISION\nif nargs > 2 then\n\011for i from 3 to nargs do\n\011\011if \+ not member(op(1,args[i]), param) then\n\011\011\011ERROR(`wrong name o f parameter`);\n\011\011fi;\n\011_[op(1,args[i])] := op(2,args[i]);\n \011od;\nfi;\n_seed\011\011:= _[Seed];\n\n# STATE VARIABLES\nA\011\011 := table();\nK\011\011:= table();\n\n# OTHER VARIABLES\nAave\011:= tab le();\nKave\011:= table();\nHHs\011\011:= table();\nHHk\011\011:= tabl e();\npi\011\011:= table();\nPiave\011:= table();\nSDPiave\011:= table ();\nP\011\011:= table();\ns \011\011:= table();\nsK \011\011:= table( );\nSDAave\011:= table();\nSDKave \011:= table();\nKtot \011:= table() ;\nQtot \011:= table();\nRmax\011:= table();\nRmean\011:= table();\n\n # INITIALISATION\nfor i from 1 to n do\n\011A[i,1] := _[Ainit];\n \011s[i,1] := 1/n;\n\011mudes \011 := (2*_[eta]-s[i,1])/(2*_[eta]- 2*s[i,1]);\n\011K[i,1] := _[Dtot]/(n*_[c]*mudes);\nod;\nRmean[0] := _[Ainit];\nKtot[1] := sum(K['i',1], 'i'=1..n);\n_[rim] := _[TRim]/Kt ot[1];\nif _[split] then\n\011if not type(n/2, integer) then\n\011\011 ERROR(`with split = true, the number of firms must be even`);\n\011fi; \n\011_[rin] := (_[TRin]*2)/Ktot[1];\n\011for i from 1 to n do\n\011 \011if i <= n/2 then\n\011\011\011rin[i] := _[rin];\n\011\011else\n \011\011\011rin[i] := 0.00000001;\n\011\011fi;\n\011od;\nelse \n\011_[ rin] := _[TRin]/Ktot[1];\n\011for i from 1 to n do\n\011\011rin[i] := \+ _[rin];\n\011od;\nfi;\n\n# MAIN LOOP\nfor t from 1 to T do\n\011\n\011 # SHORT-RUN MARKET\n\011for i from 1 to n do \n\011\011Q[i] := A[i,t]* K[i,t];\n\011od;\n\011Qtot[t] := sum(Q[k], k = 1..n);\n\011P[t]:= _[Dt ot]/Qtot[t];\n\n\011# NEW TECHNOLOGY\n\011Rmax[t] := max(seq(A[i,t], i = 1..n));\n\011Rmean[t] := Rmean[t-1]*(1 + _[phi]);\n\011for i from 1 to n do \n\011\011# INNOVATE\n\011\011lambda := _[din]*rin[i]*K[i,t]; \n\011\011Drawsno := poisson[lambda]();\n\011\011if Drawsno > 0 then A in := exp(normald[ln(Rmean[t]),_[sigma]]());\n\011\011else Ain := 0;\n \011\011fi;\n\011\011# IMITATE\n\011\011lambda := _[dim]*_[rim]*K[i,t] ;\n\011\011Lottery := poisson[lambda]();\n\011\011if Lottery > 0 then \+ Aim := Rmax[t];\011\n\011\011else Aim := 0;\n\011\011fi;\n\011\011# TE CHNO-CHOICE (later: add error to Ain)\n\011\011A[i,t+1] := max(A[i,t], Ain, Aim);\n\011od;\n\n\011# NEW CAPITAL\n\011for i from 1 to n do\n \011\011# DESIRED INVESTMENT\n\011\011s[i,t] := Q[i]/Qtot[t];\n\011 \011muact := (P[t]*A[i,t+1])/_[c];\n\011\011mudes := (2-s[i,t])/(2 - 2 *s[i,t]);\n\011\011Ides[i] := _[delta] + 1 - mudes/muact;\n\011\011# M AXIMUM INVESTMENT\n\011\011pi[i,t] := P[t]*A[i,t] - (_[delta]+_[rim]+r in[i]);\n\011\011if pi[i,t] <= 0 then loans[i] := 0;\n\011\011else loa ns[i] := 1*pi[i,t];\n\011\011fi;\n\011\011Imax[i] := _[delta] + pi[i,t ] + loans[i];\n\011\011# NEW CAPITAL\n\011\011Inv := max(0, min(Ides[i ], Imax[i]));\n\011\011K[i,t+1] := K[i,t]*(Inv + 1 - _[delta]);\n\011o d;\n\011\n \011# INDUSTRY STATISTICS\n\011Ktot[t] := sum(K[k,t], k = 1 ..n);\n\011Aave[t] := sum(A[k,t], k = 1..n)/n;\n\011Kave[t]:= sum(K[k, t], k = 1..n)/n;\n\011Piave[t]:=sum(pi[k,t], k = 1..n)/n;\n\011Qgap[t] := Qtot[t]/(Rmax[t]*Ktot[t]);\n\011\n\011\011for i from 1 to n do\n \011\011\011sK[i,t] := K[i,t]/Ktot[t];\n\011\011od;\n\011SDAave[t] := \+ (sum((A[k,t] - Aave[t])^2, k = 1..n)/(n-1))^0.5;\n\011SDKave[t] := (su m((K[k,t] - Kave[t])^2, k = 1..n)/(n-1))^0.5;\n\011SDPiave[t] := (sum( (pi[k,t] - Piave[t]^2), k = 1..n)/(n-1))^0.5;\n\011HHk[t] := 1/sum(sK[ k,t]^2, k = 1..n);\n\011HHs[t] := 1/sum(s[k,t]^2, k = 1..n);\n\nod;\n \nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "NW77param(4,20); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+)*QD*y$!\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "DrawVariable(A,4,20);" }}{PARA 13 "" 1 " " {INLPLOT "6)-%'CURVESG6%767$\"\"\"$\"#;!\"#7$\"\"#F)7$\"\"$F)7$\"\"% F)7$\"\"&F)7$\"\"'$\"+!3rso\"!#57$\"\"(F67$\"\")F67$\"\"*F67$\"#5F67$ \"#6F67$\"#7$\"+'[6gv\"F87$\"#8FE7$\"#9FE7$\"#:FE7$F*$\"+]E\\s=F87$\"# FN7$\"#?FN-%'COLOURG6$%$HUEG#F(F1-%*THICKNESSG6#F--F$ 6%76F'F,F.F0F27$F5F)7$F:F)7$FF)7$F@F)7$FBF)7$FDF)7$FHF)7$FJF)7$ FL$\"+Y#ziw\"F87$F*$\"+$G#4A=F87$FQFjo7$FSFjo7$FU$\"+E'yt$=F87$FW$\"+X *3v'=F8-FY6$Fen#F(F-Fgn-F$6%76F'F,F.F0F2F]oF^oF_oF`oFaoFboFcoFdoFeo7$F LF)7$F*F)7$FQF)7$FSF)7$FUF)7$FWF)-FY6$Fen#F/F1Fgn-F$6%Fip-FY6$FenF(Fgn -%&TITLEG6#%GVariable~A~for~4~firms~and~20~periods.G-%*AXESSTYLEG6#%'N ORMALG-%*AXESTICKSG6$F3F3" 2 272 272 272 2 0 1 0 2 9 0 4 2 1.000000 45.000000 45.000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "4 0 0" 8 }{VIEWOPTS 1 1 0 1 1 1803 }