asp.net pdf reader : Best compression pdf application software utility azure windows .net visual studio jl-quant-econ19-part863

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
Best compression pdf - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
pdf file size limit; pdf compressor
Best compression pdf - VB.NET PDF File Compress Library: Compress reduce PDF size in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Compression and Decompression Control SDK
acrobat compress pdf; compress pdf
2.9. UNCERTAINTYTRAPS
192
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
Best C#.NET PDF converter SDK for converting PDF to Tiff in page and multipage tiff image files can be created from PDF. Supports tiff compression selection.
adjusting page size in pdf; pdf markup text size
VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.
When converting PDF document to TIFF image using VB can be compressed and uncompressed by using lossless compression. image is regarded as the best image format
pdf font size change; change page size pdf acrobat
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# Create PDF from Tiff Library to convert tif images to PDF in C#
Best and free C# tiff to adobe PDF converter SDK for Visual Studio .NET. Description: Convert to PDF with specified compression method and save it on the
pdf compression; change font size pdf
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
Best C#.NET PDF to Microsoft Office Word The magnification of the original PDF page size. DocumentType targetType, ImageCompress compression, String filePath).
change font size fillable pdf; change font size in pdf form
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# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
Best C# Microsoft Office PowerPoint to adobe PDF file converter SDK for Visual Description: Convert to PDF/TIFF with specified compression method and save
pdf page size; pdf optimized format
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Best Microsoft Office Excel to adobe PDF file converter SDK for Visual Studio .NET. Description: Convert to PDF/TIFF with specified compression method and
pdf change font size in textbox; adjust size of pdf
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
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
Best Microsoft Office Word to adobe PDF file converter SDK for Visual Studio .NET. Description: Convert to PDF/TIFF with specified compression method and
adjust pdf page size; change page size pdf
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
Best C# OpenOffice to adobe PDF file converter SDK for Visual Studio .NET. Description: Convert to PDF/TIFF with specified compression method and save it
pdf file size; best pdf compressor
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
C# TIFF: C#.NET Code to Process TIFF, RasterEdge XDoc.Tiff for .
TIFF, JPEG, GIF, BMP, PNG, PDF, Word and can fulfill different users' needs best, which include corresponding information, such as Tiff compression mode, color
.pdf printing in thumbnail size; change font size on pdf text box
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