2.9. UNCERTAINTYTRAPS
191
However,therearetimeswhenmtracksqpoorlyduetoinsufficientinformation
Theseareepisodeswheretheuncertaintytrapstakehold
Duringtheseepisodes
• precisionislowanduncertaintyishigh
• fewfirmsareinthemarket
Togetaclearerideaofthedynamics,let’slookatallthemaintimeseriesatonce,foragivenset
ofshocks
Noticehowthetrapsonlytakeholdafterasequenceofbaddrawsforthefundamental
Thus,themodelgivesusapropagationmechanismthatmapsbadrandomdrawsintolongdown-
turnsineconomicactivity
Exercises
Exercise1 Fillinthedetailsbehind(2.64)and(2.65)basedonthefollowingstandardresult(see,
e.g.,p.24of[YS05])
FactLetx=(x
1
,...,x
M
)beavectorofIIDdrawsfromcommondistributionN(q,1/g
x
)andlet ¯x
bethesamplemean.Ifg
x
isknownandthepriorforqisN(m,1/g),thentheposteriordistribution
ofqgivenxis
p(qjx)=N(m
0
,1/g
0
)
where
m
0
=
mg+Mx¯g
x
g+Mg
x
and g
0
=g+Mg
x
Exercise2 Modulorandomness,replicatethesimulationfiguresshownabove
• UsetheparametervalueslistedasdefaultsinthefunctionUncertaintyTrapEcon
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Convert pdf to tiff open source - Convert PDF to tiff images in C#.net, ASP.NET MVC, Ajax, WinForms, WPF
Online C# Tutorial for How to Convert PDF File to Tiff Image File
online pdf to tiff conversion; c# convert pdf to tiff
Convert pdf to tiff open source - VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.net, ASP.NET MVC, Ajax, WinForms, WPF
Free VB.NET Guide to Render and Convert PDF Document to TIFF
pdf to tiff open source c#; convert pdf to tiff open source
2.9. UNCERTAINTYTRAPS
192
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Text Extract Library: extract text content from PDF file in
it is feasible for users to extract text content from source PDF document file the following C# example code for text extraction from PDF page Open a document
convert pdf to tiff file; pdf to tiff converter without watermark
VB.NET PDF Annotate Library: Draw, edit PDF annotation, markups in
Decode source PDF document file into an in-memory object, namely 2.pdf" Dim outputFilePath As String = Program.RootPath + "\\" Annot_8.pdf" ' open a PDF file
online convert pdf to tiff; convert pdf to tiff online
2.10. ASIMPLEOPTIMALGROWTHMODEL
193
Solutions
Solutionnotebook
2.10 ASimpleOptimalGrowthModel
Contents
• ASimpleOptimalGrowthModel
– Overview
– TheModel
– DynamicProgramming
– Computation
– WritingReusableCode
– Exercises
– Solutions
Overview
Inthislecturewe’regoingtostudyasimpleoptimalgrowthmodelwithoneagent
Themodelisaversionofthestandardonesectorinfinitehorizongrowthmodelstudiedin
• [SLP89],chapter2
• [LS12],section3.1
• EDTC,chapter1
• [Sun96],chapter12
Thetechniqueweusetosolvethemodelisdynamicprogramming
• Pervasiveineconomics,financeandmanyotherfields
• General,powerfulandyieldsbothintuitionandpracticalcomputationalmethods
Thegrowthmodelstudiedbelowisintentionallysimplistic—fornowwefavoreaseofexposition
overrealism
Ifyoufindthedynamicprogrammingargumentshardgoing,tryre-readingthelectureonshortest
paths
TheModel
Consideranagentwhoownsattimetcapitalstockk
t
2R
+
:=[0,¥)andproducesoutput
y
t
:=f(k
t
)2R
+
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
Free online C#.NET source code for combining multiple PDF pages together in .NET framework. Combine scanned images to PDF, such as tiff, jpg, png, gif, bmp
convert pdf to tiff format; how to convert pdf file to tiff
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
Online source code for C#.NET class. Free library and components for .NET framework. Description: Convert to PDF/TIFF and save it on the disk. Parameters:
how to convert pdf file to tiff for; how to change pdf to tiff file
2.10. ASIMPLEOPTIMALGROWTHMODEL
194
Thisoutputcaneitherbeconsumedorsavedascapitalfornextperiod
Forsimplicityweassumethatdepreciationistotal,sothatnextperiodcapitalisjustoutputminus
consumption:
k
t+1
=y
t
c
t
(2.69)
Takingk
0
asgiven,wesupposethattheagentwishestomaximize
¥
å
t=0
b
t
u(c
t
)
(2.70)
whereuisagivenutilityfunctionandb2(0,1)isadiscountfactor
Moreprecisely,theagentwishestoselectapathc
0
,c
1
,c
2
,...forconsumptionthatis
1. nonnegative
2. feasible,inthesensethatthecapitalpathfk
t
gdeterminedbyfc
t
g,k
0
and(2.69)isalways
nonnegative
3. optimal,inthesensethatitmaximizes(2.70)relativetoallotherfeasibleconsumptionse-
quences
Inthepresentcontext
• kiscalledthestatevariable—itsummarizesthe“stateoftheworld”atthestartofeach
period
• ciscalledthecontrolvariable—avaluechosenbytheagenteachperiodafterobservingthe
state
Awell-knownresultfromdynamicprogrammingtheory(cf.,e.g.,[SLP89],section4.1)statesthat,
forkindofthisproblem,anyoptimalconsumptionsequencefc
t
gisMarkov
Thatis,thereexistsafunctionssuchthat
c
t
=s(k
t
forallt
Inotherwords,thecurrentcontrolisafixed(i.e.,timehomogeneous)functionofthecurrentstate
ThePolicyFunctionApproach Asitturnsout,wearebetteroffseekingthefunctionsdirectly,
ratherthantheoptimalconsumptionsequence
Themainreasonisthatthefunctionalapproach—seekingtheoptimalpolicy—translatesdirectly
overtothestochasticcase,whereasthesequentialapproachdoesnot
Forthismodel,wewillsaythatfunctionsmappingR
+
intoR
+
isafeasibleconsumptionpolicyifit
satisfies
s(k)f(kforall k2R
+
(2.71)
ThesetofallsuchpolicieswillbedenotedbyS
Usingthisnotation,theagent’sdecisionproblemcanberewrittenas
max
s2S
(
¥
å
t=0
b
t
u(s(k
t
))
)
(2.72)
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
Online C# source code for extracting, copying and pasting PDF The portable document format, known as PDF document, is of file that allows users to open & read
how to convert pdf into tiff format; pdf converter to tiff
C# Word - MailMerge Processing in C#.NET
da.Fill(data); //Open the document DOCXDocument document0 = DOCXDocument.Open( docFilePath ); int counter = 1; // Loop though all records in the data source.
how to convert pdf to tiff in; to tiff
2.10. ASIMPLEOPTIMALGROWTHMODEL
195
wherethesequencefk
t
gin(2.72)isgivenby
k
t+1
=f(k
t
s(k
t
)k
0
given
(2.73)
Inthenextsectionwediscusshowtosolvethisproblemforthemaximizings
DynamicProgramming
Wewillsolvefortheoptimalpolicyusingdynamicprogramming
Thefirststepistodefinethepolicyvaluefunctionv
s
associatedwithagivenpolicys,whichis
v
s
(k
0
):=
¥
å
t=0
b
t
u(s(k
t
))
(2.74)
whenfk
t
gisgivenby(2.73)
Evidentlyv
s
(k
0
)isthetotalpresentvalueofdiscountedutilityassociatedwithfollowingpolicys
forever,giveninitialcapitalk
0
Thevaluefunctionforthisoptimizationproblemisthendefinedas
v
(k
0
):=sup
s2S
v
s
(k
0
)
(2.75)
Thevaluefunctiongivesthemaximalvaluethatcanbeobtainedfromstatek
0
,afterconsidering
allfeasiblepolicies
Apolicys2Siscalledoptimalifitattainsthesupremumin(2.75)forallk
0
2R
+
TheBellmanequationforthisproblemtakestheform
v
(k)= max
0cf(k)
fu(c)+bv
(f(kc)g forall k2R
+
(2.76)
Itstatesthatmaximalvaluefromagivenstatecanbeobtainedbytradingoff
• currentrewardfromagivenaction(inthiscaseutilityfromcurrentconsumption)vs
• thediscountedfuturevalueofthestateresultingfromthataction
(IftheintuitionbehindtheBellmanequationisnotcleartoyou,tryworkingthroughthislecture)
Asamatterofnotation,givenacontinuousfunctionwonR
+
,wesaythatpolicys2Sisw-greedy
ifs(k)isasolutionto
max
0cf(k)
fu
(c)+bw(f(kc)
g
(2.77)
foreveryk2R
+
TheoreticalResults Aswithmostoptimizationproblems,conditionsforexistenceofasolution
typicallyrequiresomeformofcontinuityandcompactness
Inaddition,somerestrictionsareneededtoensurethatthesumofdiscountedutilityisalways
finite
Forexample,ifwearepreparedtoassumethatfanduarecontinuousanduisbounded,then
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
VB.NET PDF Convert to HTML SDK: Convert PDF to html files in vb.
is designed to help .NET developers convert PDF to HTML are able to perform high fidelity PDF to HTML files preserve all the contents of source PDF file, like
convert multipage pdf to tiff; pdf to tiff converter c#
VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
addition, texts, pictures and font formatting of source PDF file are accurately retained in converted Word document file. Why do we need to convert PDF to Word
online pdf to tiff; create tiff from pdf
2.10. ASIMPLEOPTIMALGROWTHMODEL
196
1. Thevaluefunctionv
isfinite,bounded,continuousandsatisfiestheBellmanequation
2. Atleastoneoptimalpolicyexists
3. Apolicyisoptimalifandonlyifitisv
-greedy
(Foraproofsee,forexample,proposition10.1.13ofEDTC)
Inviewoftheseresults,tofindanoptimalpolicy,oneoption—perhapsthemostcommon—is
to
1. computev
2. solveforav
-greedypolicy
Theadvantageisthat,oncewegettothesecondstep,wearesolvingaone-dimensionaloptimiza-
tionproblem—theproblemontheright-handsideof(2.76)
Thisismucheasierthananinfinite-dimensionaloptimizationproblem,whichiswhatwestarted
outwith
(Aninfinitesequencefc
t
gisapointinaninfinite-dimensionalspace)
Infactstep2isalmosttrivialoncev
isobtained
Forthisreason,mostofourfocusisonthefirststep—howtoobtainthevaluefunction
ValueFunctionIteration Thevaluefunctionv
canbeobtainedbyaniterativetechnique:
• Startwithaguess—someinitialfunctionw
• successivelyimproveit
Theimprovement step involvesapplyinganoperator(i.e.,amapfromfunctionstofunctions)
calledtheBellmanoperator
TheBellmanoperatorforthisproblemisdenotedTandsendswintoTwvia
Tw(k):=
max
0cf(k)
fu
(c)+bw(f(kc)
g
(2.78)
Nowletwbeanycontinuousboundedfunction
IterativelyapplyingTfrominitialconditionwproducesasequenceoffunctionsw,Tw,T(Tw)=
T
2
w,...thatconvergesuniformlytov
Foraproofsee,forexample,lemma10.1.20ofEDTC
Thisconvergencewillbeprominentinournumericalexperiments
Unbounded Utility The theoretical l results s stated d above assume that t the e utility function n is
bounded
Inpracticeeconomistsoftenworkwithunboundedutilityfunctions
Forutilityfunctionsthatareboundedbelow(butpossiblyunboundedabove),acleanandcom-
prehensivetheorynowexists
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
VB.NET PDF File Split Library: Split, seperate PDF into multiple
Separate source PDF document file by defined page range in VB.NET class application. Divide PDF file into multiple files by outputting PDF file size.
bulk pdf to tiff converter; pdf to tiff converter open source c#
2.10. ASIMPLEOPTIMALGROWTHMODEL
197
(Section12.2ofEDTCprovidesoneexposition)
Forutilityfunctionsthatareunboundedbothbelowandabovethesituationismorecomplicated
Forrecentworkondeterministicproblems,see,forexample,[Kam12]or[MdRV10]
Inthislecturewewillusebothboundedandunboundedutilityfunctionswithoutdwellingon
thetheory
Computation
Let’snowlookatcomputingthevaluefunctionandtheoptimalpolicy
FittedValueIteration ThefirststepistocomputethevaluefunctionbyiteratingwiththeBell-
manoperator
Intheory,thealgorithmisasfollows
1. Beginwithafunctionw—aninitialcondition
2. Solving(2.78),obtainthefunctionTw
3. Unlesssomestoppingconditionissatisfied,setw=Twandgotostep2
However,thereisaproblemwemustconfrontbeforeweimplementthisprocedure:Theiterates
canneitherbecalculatedexactlynorstoredonacomputer
Toseetheissue,consider(2.78)
Evenifwisaknownfunction,unlessTwcanbeshowntohavesomespecialstructure,theonly
waytostorethisfunctionistorecordthevalueTw(k)foreveryk2R
+
Clearlythisisimpossible
Whatwewilldoinsteadisusefittedvaluefunctioniteration
The procedureis torecord thevalueofthefunction Tw at only y finitely many “grid” points
fk
1
,...,k
I
gR
+
,andreconstructitfromthisinformationwhenrequired
Moreprecisely,thealgorithmwillbe
1. Beginwithanarrayofvaluesfw
1
,...,w
I
g,typicallyrepresentingthevaluesofsomeinitial
functionwonthegridpointsfk
1
,...,k
I
g
2. buildafunctionwˆonthestatespaceR
+
byinterpolatingthepointsfw
1
,...,w
I
g
3. Byrepeatedlysolving(2.78),obtainandrecordthevalueTwˆ(k
i
)oneachgridpointk
i
4. Unlesssomestoppingconditionissatisfied,setfw
1
,...,w
I
g= fTwˆ(k
1
),...,Twˆ(k
I
)gand
gotostep2
Howshouldwegoaboutstep2?
Thisisaproblemoffunctionapproximation,andtherearemanywaystoapproachit
What’simportanthereisthatthefunctionapproximationschememustnotonlyproduceagood
approximationtoTw,butalsocombinewellwiththebroaderiterationalgorithmdescribedabove
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.10. ASIMPLEOPTIMALGROWTHMODEL
198
Onegoodchoicefrombothrespectsiscontinuouspiecewiselinearinterpolation(seethis paper
forfurtherdiscussion)
Thenextfigureillustratespiecewiselinearinterpolationofanarbitraryfunctionongridpoints
0,0.2,0.4,...,1
Anotheradvantageofpiecewiselinearinterpolationisthatitpreservesusefulshapeproperties
suchasmonotonicityandconcavity/convexity
AFirstPassImplementation Let’snowlookatanimplementationoffittedvaluefunctioniter-
ationusingJulia
Intheexamplebelow,
• f(k)=k
a
witha=0.65
• u(c)=lncandb=0.95
Asiswell-known(see[LS12],section3.1.2),forthisparticularproblemanexactanalyticalsolution
isavailable,with
v
(k)=c
1
+c
2
lnk
(2.79)
for
c
1
:=
ln(ab)
b
+
ln(ab)ab
(1 ab)(1 b)
and c
2
:=
a
ab
Atthisstage,ouronlyaimistoseeifwecanreplicatethissolutionnumerically,usingfittedvalue
functioniteration
Here’safirst-passsolution,thedetailsofwhichareexplainedbelow
Thecodecanbefoundinfileoptgrowth/optgrowth_v0.jlfromtheQuantEcon.applicationsrepos-
itory
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.10. ASIMPLEOPTIMALGROWTHMODEL
199
Werepeatithereforconvenience
#=
A first t pass at t solving the e optimal growth h problem via a value e function
iteration.
A more general l version is s provided in n optgrowth.py.
@author : Spencer Lyon <spencer.lyon@nyu.edu>
=#
using Optim: optimize
using Grid: CoordInterpGrid, BCnan, InterpLinear
using PyPlot
## Primitives s and d grid
alpha 0.65
bet 0.95
grid_max 2
grid_size 150
grid 1e-6:(grid_max-1e-6)/(grid_size-1):grid_max
## Exact solution
ab alpha bet
c1 (log(ab) log(ab) ab (ab)) (bet)
c2 alpha (ab)
v_star(k) c1 .+ c2 .* log(k)
function bellman_operator(grid, w)
Aw CoordInterpGrid(grid, w, BCnan, , InterpLinear)
Tw zeros(w)
for (i, k) in enumerate(grid)
objective(c) = - log(c) bet Aw[k^alpha c]
res optimize(objective, 1e-6, k^alpha)
Tw[i] = - objective(res.minimum)
end
return Tw
end
function main(n::Int=35)
.* log(grid) .- 25 # An initial condition -- fairly arbitrary
fig, ax subplots()
ax[:set_ylim](-40-20)
ax[:set_xlim](minimum(grid), maximum(grid))
lb "initial condition"
jet ColorMap("jet")[:__call__]
ax[:plot](grid, w, color=jet(0), lw=2, alpha=0.6, label=lb)
for i=1:n
bellman_operator(grid, w)
ax[:plot](grid, w, color=jet(i/n), lw=2, alpha=0.6)
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.10. ASIMPLEOPTIMALGROWTHMODEL
200
end
lb "true value e function"
ax[:plot](grid, v_star(grid), "k-", lw=2, alpha=0.8, label=lb)
ax[:legend](loc="upper left")
Void
end
Runningthecodeproducesthefollowingfigure
Thecurvesinthispicturerepresent
1. thefirst36functionsgeneratedbythefittedvaluefunctioniterationalgorithmdescribed
above,withhottercolorsgiventohigheriterates
2. thetruevaluefunctionasspecifiedin(2.79),drawninblack
Thesequenceofiteratesconvergestowardsv
Ifweincreasenandrunagainweseefurtherimprovement—thenextfigureshowsn = 75
Incidentally,itistruethatknowledgeofthefunctionalformofv
forthismodelhasinfluenced
ourchoiceoftheinitialcondition
log(grid) 25
Inmorerealisticproblemssuchinformationisnotavailable,andconvergencewillprobablytake
longer
Comments onthe Code Thefunctionbellman_operator implementssteps2–3ofthefitted
valuefunctionalgorithmdiscussedabove
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Documents you may be interested
Documents you may be interested