asp.net pdf viewer : Change font size in pdf text box control software system web page windows asp.net console jl-quant-econ27-part872

CHAPTER
THREE
ADVANCEDAPPLICATIONS
Thisadvancedsectionofthecoursecontainsmorecomplexapplications,andcanbereadselec-
tively,accordingtoyourinterests
3.1 ContinuousStateMarkovChains
Contents
• ContinuousStateMarkovChains
– Overview
– TheDensityCase
– BeyondDensities
– Stability
– Exercises
– Solutions
– Appendix
Overview
In aprevious lecturewelearnedabout finiteMarkov chains, a relativelyelementaryclassof
stochasticdynamicmodels
Thepresentlectureextendsthisanalysistocontinuous(i.e.,uncountable)stateMarkovchains
Moststochasticdynamicmodelsstudiedbyeconomistseitherfitdirectlyintothisclassorcanbe
representedascontinuousstateMarkovchainsafterminormodifications
Inthislecture,ourfocuswillbeoncontinuousMarkovmodelsthat
• evolveindiscretetime
• areoftennonlinear
Thefactthatweaccommodatenonlinearmodelshereissignificant,becauselinearstochasticmod-
elshavetheirownhighlydevelopedtoolset,aswe’llseelateron
271
Change font size in pdf text box - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
pdf form change font size; adjust size of pdf in preview
Change font size in pdf text box - 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
can a pdf file be compressed; best compression pdf
3.1. CONTINUOUSSTATEMARKOVCHAINS
272
Thequestionthatinterestsusmostis:Givenaparticularstochasticdynamicmodel,howwillthe
stateofthesystemevolveovertime?
Inparticular,
• Whathappenstothedistributionofthestatevariables?
• Isthereanythingwecansayaboutthe“averagebehavior”ofthesevariables?
• Isthereanotionof“steadystate”or“longrunequilibrium”that’sapplicabletothemodel?
– Ifso,howcanwecomputeit?
Answeringthesequestionswillleadustorevisitmanyofthetopicsthatoccupiedusinthefinite
statecase,suchassimulation,distributiondynamics,stability,ergodicity,etc.
Note: Forsomepeople, theterm“Markovchain”alwaysreferstoaprocesswithafiniteor
discretestatespace.Wefollowthemainstreammathematicalliterature(e.g.,[MT09])inusingthe
termtorefertoanydiscretetimeMarkovprocess
TheDensityCase
Youareprobablyawarethatsomedistributionscanberepresentedbydensitiesandsomecannot
(Forexample, distributionsontherealnumbersRthatputpositiveprobabilityon individual
pointshavenodensityrepresentation)
WearegoingtostartouranalysisbylookingatMarkovchainswheretheonesteptransition
probabilitieshavedensityrepresentations
Thebenefitisthatthedensitycaseoffersaverydirectparalleltothefinitecaseintermsofnotation
andintuition
Oncewe’vebuiltsomeintuitionwe’llcoverthegeneralcase
DefinitionsandBasicProperties InourlectureonfiniteMarkovchains, westudieddiscrete
timeMarkovchainsthatevolveonafinitestatespaceS
Inthissetting,thedynamicsofthemodelaredescribedbyastochasticmatrix—anonnegative
squarematrixP=P[i,j]suchthateachrowP[i,]sumstoone
TheinterpretationofPisthatP[i,j]representstheprobabilityoftransitioningfromstateitostate
jinoneunitoftime
Insymbols,
PfX
t+1
=jjX
t
=ig=P[i,j]
Equivalently,
• PcanbethoughtofasafamilyofdistributionsP[i,],oneforeachi2S
• P[i,]isthedistributionofX
t+1
givenX
t
=i
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Text Box Edit Library: add, delete, update PDF text box in
Support to change font color in PDF text box. Ability to change text size in PDF text box. Adding text box is another way to add text to PDF page.
pdf page size may not be reduced; best online pdf compressor
C# PDF Sticky Note Library: add, delete, update PDF note in C#.net
Allow users to add comments online in ASPX webpage. Able to change font size in PDF comment box. Able to save and print sticky notes in PDF file.
adjust pdf size preview; pdf compressor
3.1. CONTINUOUSSTATEMARKOVCHAINS
273
(Asyouprobablyrecall,whenusingJuliaarrays,P[i,]isexpressedasP[i,:])
Inthissection,we’llallowStobeasubsetofR,suchas
• Ritself
• thepositivereals(0,¥)
• aboundedinterval(a,b)
ThefamilyofdiscretedistributionsP[i,]willbereplacedbyafamilyofdensitiesp(x,),onefor
eachx2S
Analogoustothefinitestatecase,p(x,)istobeunderstoodasthedistribution(density)ofX
t+1
givenX
t
=x
Moreformally,astochastickernelonSisafunctionp:SS!Rwiththepropertythat
1. p(x,y)0forallx,y2S
2.
R
p(x,y)dy=1forallx2S
(Integralsareoverthewholespaceunlessotherwisespecified)
Forexample,letS=Randconsidertheparticularstochastickernelp
w
definedby
p
w
(x,y):=
1
p
2p
exp
(y x)2
2
(3.1)
Whatkindofmodeldoesp
w
represent?
Theansweris,the(normallydistributed)randomwalk
X
t+1
=X
t
+x
t+1
where fx
t
g
IID
 N(0,1)
(3.2)
Toseethis,let’sfindthestochastickernelpcorrespondingto(3.2)
Recallthatp(x,)representsthedistributionofX
t+1
givenX
t
=x
LettingX
t
=xin(3.2)andconsideringthedistributionofX
t+1
,weseethatp(x,)=N(x,1)
Inotherwords,pisexactlyp
w
,asdefinedin(3.1)
ConnectiontoStochasticDifferenceEquations Intheprevioussection,wemadetheconnection
betweenstochasticdifferenceequation(3.2)andstochastickernel(3.1)
Ineconomicsandtimeseries analysiswemeet t stochastic differenceequationsofalldifferent
shapesandsizes
Itwillbeusefulforusifwehavesomesystematicmethodsforconvertingstochasticdifference
equationsintostochastickernels
Tothisend,considerthegeneric(scalar)stochasticdifferenceequationgivenby
X
t+1
=m(X
t
)+s(X
t
)x
t+1
(3.3)
Hereweassumethat
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Field Edit Library: insert, delete, update pdf form field
Support to change font size in PDF form. RasterEdge.Imaging.Font.dll. pdf"; String outputFilePath = Program.RootPath + "\\" Output.pdf"; List<BaseFormField
pdf paper size; adjust pdf page size
C# PDF Annotate Library: Draw, edit PDF annotation, markups in C#.
Support to add text, text box, text field and crop marks to PDF document. Able to edit and change PDF annotation properties such as font size or color.
pdf file size; best pdf compression
3.1. CONTINUOUSSTATEMARKOVCHAINS
274
• fx
t
g
IID
 f,wherefisagivendensityonR
• mandsaregivenfunctionsonS,withs(x)>0forallx
Example1:Therandomwalk(3.2)isaspecialcaseof(3.3),withm(x)=xands(x)=1
Example2:ConsidertheARCHmodel
X
t+1
=aX
t
+s
t
x
t+1
,
s
2
t
=b+gX
2
t
,
b,g>0
Alternatively,wecanwritethemodelas
X
t+1
=aX
t
+(b+gX
2
t
)
1/2
x
t+1
(3.4)
Thisisaspecialcaseof(3.3)withm(x)=axands(x)=(b+gx
2)1/2
Example3:Withstochastic
productionandaconstantsavingsrate,theone-sectorneoclassicalgrowthmodelleadstoalaw
ofmotionforcapitalperworkersuchas
k
t+1
=sA
t+1
f(k
t
)+(1 d)k
t
(3.5)
Here
• sistherateofsavings
• A
t+1
isaproductionshock
– Thet+1subscriptindicatesthatA
t+1
isnotvisibleattimet
• disadepreciationrate
• f:R
+
!R
+
isaproductionfunctionsatisfyingf(k)>0wheneverk>0
(Thefixedsavingsratecanberationalizedastheoptimalpolicyforaparticularsetoftechnologies
andpreferences(see[LS12],section3.1.2),althoughweomitthedetailshere)
Equation(3.5)isaspecialcaseof(3.3)withm(x)=(d)xands(x)=sf(x)
Nowlet’sobtainthestochastickernelcorrespondingtothegenericmodel(3.3)
Tofindit,notefirstthatifisarandomvariablewithdensity f
U
,anda+bUforsome
constantsa,bwithb>0,thenthedensityofVisgivenby
f
V
(v)=
1
b
f
U
v a
b
(3.6)
(Theproofisbelow.ForamultidimensionalversionseeEDTC,theorem8.1.3)
Taking(3.6)asgivenforthemoment,wecanobtainthestochastickernelpfor(3.3)byrecalling
thatp(x,)istheconditionaldensityofX
t+1
givenX
t
=x
Inthepresentcase,thisisequivalenttostatingthatp(x,)isthedensityofY:=m(x)+s(x)x
t+1
whenx
t+1
f
Hence,by(3.6),
p(x,y)=
1
s(x)
f
y m(x)
s(x)
(3.7)
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF insert text Library: insert text into PDF content in C#.net
Powerful .NET PDF edit control allows modify existing scanned PDF text. Ability to change text font, color, size and location and output a new PDF document.
change font size in fillable pdf; adjust size of pdf
VB.NET PDF insert text library: insert text into PDF content in vb
Save text font, color, size and location changes to Other robust text processing features, like delete and remove PDF text, add PDF text box and field.
pdf change font size; pdf page size
3.1. CONTINUOUSSTATEMARKOVCHAINS
275
Forexample,thegrowthmodelin(3.5)hasstochastickernel
p(x,y)=
1
sf(x)
f
(d)x
sf(x)
(3.8)
wherefisthedensityofA
t+1
(RegardingthestatespaceSforthismodel,anaturalchoiceis(0,¥)—inwhichcases(x)=sf(x)
isstrictlypositiveforallsasrequired)
DistributionDynamics InthissectionofourlectureonfiniteMarkovchains,weaskedthefol-
lowingquestion:If
1. fX
t
gisaMarkovchainwithstochasticmatrixP
2. thedistributionofX
t
isknowntobey
t
thenwhatisthedistributionofX
t+1
?
Lettingy
t+1
denotethedistributionofX
t+1
,theanswerwegavewasthat
y
t+1
[j]=
å
i2S
P[i,j]y
t
[i]
Thisintuitiveequalitystatesthattheprobabilityofbeingatjtomorrowistheprobabilityofvisit-
ingitodayandthengoingontoj,summedoverallpossiblei
Inthedensitycase,wejustreplacethesumwithanintegralandprobabilitymassfunctionswith
densities,yielding
y
t+1
(y)=
Z
p(x,y)y
t
(x)dx,
8y2S
(3.9)
Itisconvenienttothinkofthisupdatingprocessintermsofanoperator
(Anoperatorisjustafunction,butthetermisusuallyreservedforafunctionthatsendsfunctions
intofunctions)
LetDbethesetofalldensitiesonS,andletPbetheoperatorfromDtoitselfthattakesdensityy
andsendsitintonewdensityyP,wherethelatterisdefinedby
(yP)(y)=
Z
p(x,y)y(x)dx
(3.10)
ThisoperatorisusuallycalledtheMarkovoperatorcorrespondingtop
Note: Unlikemostoperators,wewritePtotherightofitsargument,insteadoftotheleft(i.e.,
yPinsteadofPy).Thisisacommonconvention,withtheintentionbeingtomaintaintheparallel
withthefinitecase—seehere
Withthisnotation,wecanwrite(3.9)moresuccinctlyasy
t+1
(y)=(y
t
P)(y)forally,or,dropping
theyandletting“=”indicateequalityoffunctions,
y
t+1
=y
t
P
(3.11)
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
PDF document, keeps the elements (like images, tables and chats) of original PDF file and maintains the original text style (including font, size, color, links
change font size pdf; change font size in pdf text box
VB.NET PDF delete text library: delete, remove text from PDF file
Functionality to remove text format by modifying text font, size, color, etc. Other PDF edit functionalities, like add PDF text, add PDF text box and field.
pdf custom paper size; change paper size pdf
3.1. CONTINUOUSSTATEMARKOVCHAINS
276
Equation(3.11)tellsusthatifwespecifyadistributionfory
0
,thentheentiresequenceoffuture
distributionscanbeobtainedbyiteratingwithP
It’sinterestingtonotethat(3.11)isadeterministicdifferenceequation
Thus,byconvertingastochasticdifferenceequationsuchas(3.3)intoastochastickernelpand
henceanoperatorP,weconvertastochasticdifferenceequationintoadeterministicone(albeitin
amuchhigherdimensionalspace)
Note: SomepeoplemightbeawarethatdiscreteMarkovchainsareinfactaspecialcaseofthe
continuousMarkovchainswehavejustdescribed. Thereasonisthatprobabilitymassfunctions
aredensitieswithrespecttothecountingmeasure.
Computation Tolearnaboutthedynamicsofagivenprocess,it’susefultocomputeandstudy
thesequencesofdensitiesgeneratedbythemodel
Onewaytodothisistotrytoimplementtheiterationdescribedby(3.10)and(3.11)usingnumer-
icalintegration
However,toproduceyPfromyvia(3.10),youwouldneedtointegrateateveryy,andthereisa
continuumofsuchy
Anotherpossibilityistodiscretizethemodel,butthisintroduceserrorsofunknownsize
Aniceralternativeinthepresentsettingistocombinesimulationwithanelegantestimatorcalled
thelookaheadestimator
Let’sgoovertheideaswithreferencetothegrowthmodeldiscussedabove,thedynamicsofwhich
werepeathereforconvenience:
k
t+1
=sA
t+1
f(k
t
)+(1 d)k
t
(3.12)
Ouraimistocomputethesequencefy
t
gassociatedwiththismodelandfixedinitialconditiony
0
Toapproximatey
t
bysimulation,recallthat,bydefinition,y
t
isthedensityofk
t
givenk
0
y
0
Ifwewishtogenerateobservationsofthisrandomvariable,allweneedtodois
1. drawk
0
fromthespecifiedinitialconditiony
0
2. drawtheshocksA
1
,...,A
t
fromtheirspecifieddensityf
3. computek
t
iterativelyvia(3.12)
Ifwerepeatthisntimes,wegetnindependentobservationsk
1
t
,...,k
n
t
Withthesedrawsinhand,thenextstepistogeneratesomekindofrepresentationoftheirdistri-
butiony
t
Anaiveapproachwouldbetouseahistogram,orperhapsasmoothedhistogramusingthekde
functionfromKernelDensity.jl
However,inthepresentsettingthereisamuchbetterwaytodothis,basedonthelook-ahead
estimator
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.1. CONTINUOUSSTATEMARKOVCHAINS
277
Withthisestimator,toconstructanestimateofy
t
,weactuallygeneratenobservationsofk
1
,
ratherthank
t
Nowwetakethesenobservationsk
1
1
,...,k
n
1
andformtheestimate
y
n
t
(y)=
1
n
n
å
i=1
p(k
i
1
,y)
(3.13)
wherepisthegrowthmodelstochastickernelin(3.8)
Whatisthejustificationforthisslightlysurprisingestimator?
Theideaisthat,bythestronglawoflargenumbers,
1
n
n
å
i=1
p(k
i
1
,y)!Ep(k
i
1
,y)=
Z
p(x,y)y
1
(x)dx=y
t
(y)
withprobabilityoneasn!¥
Herethefirstequalityisbythedefinitionofy
1
,andthesecondisby(3.9)
Wehavejustshownthatourestimatory
n
t
(y)in(3.13)convergesalmostsurelytoy
t
(y),whichis
justwhatwewanttocompute
Infactmuchstrongerconvergenceresultsaretrue(see,forexample,this paper)
Implementation AtypecalledLAEforestimatingdensitiesbythistechniquecanbefoundin
QuantEcon
Werepeatithereforconvenience
#=
Computes a sequence of marginal densities for a continuous state space
Markov chain n :math:X_t where the transition n probabilities s can be represented
as densities. . The estimate of f the e marginal density of f X_t t is
1/n sum_{i=0}^n p(X_{t-1}^i, y)
This is s a a density y in n y.
@author : Spencer Lyon <spencer.lyon@nyu.edu>
@date: 2014-08-01
References
----------
http://quant-econ.net/jl/stationary_densities.html
=#
"""
A look ahead estimator associated with a a given n stochastic kernel p p and d a vector
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.1. CONTINUOUSSTATEMARKOVCHAINS
278
of observations X.
##### Fields
- p::Function: The stochastic kernel. Signature is s p(x, , y) and it should be
vectorized in n both h inputs
- X::Matrix: A vector containing observations. Note that this can be e passed d as
any kind of AbstractArray and will be coerced d into o an n x 1 vector.
"""
type LAE
p::Function
X::Matrix
function LAE(p::Function, X::AbstractArray)
length(X)
new(p, reshape(X, n, 1))
end
end
"""
A vectorized function that returns the value of the look ahead estimate at the
values in the e array y y.
##### Arguments
- l::LAE: Instance of LAE type
- y::Array: Array that becomes the y in l.p(l.x, y)
##### Returns
- psi_vals::Vector: Density at (x, y)
"""
function lae_est{T}(l::LAE, y::AbstractArray{T})
length(y)
l.p(l.X, reshape(y, 1, k))
psi_vals mean(v, 1)
return squeeze(psi_vals, 1)
end
Thisfunctionreturnstheright-handsideof(3.13)using
• anobjectoftypeLAEthatstoresthestochastickernelandtheobservations
• thevalueyasitssecondargument
Thefunctionisvectorized,inthesensethatifpsiissuchaninstanceandyisanarray,thenthe
callpsi(y)actselementwise
(ThisisthereasonthatwereshapedXandyinsidethetype—tomakevectorizationwork)
Example Anexampleofusageforthestochasticgrowthmodeldescribedabovecanbefoundin
stationary_densities/stochasticgrowth.py
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.1. CONTINUOUSSTATEMARKOVCHAINS
279
Whenrun,thecodeproducesafigurelikethis
Thefigureshowspartofthedensitysequencefy
t
g, witheachdensitycomputedviathelook
aheadestimator
Noticethatthesequenceofdensitiesshowninthefigureseemstobeconverging—moreonthis
injustamoment
Anotherquickcommentisthateachofthesedistributionscouldbeinterpretedasacrosssectional
distribution(recallthisdiscussion)
BeyondDensities
Upuntilnow,wehavefocusedexclusivelyoncontinuousstateMarkovchainswhereallcondi-
tionaldistributionsp(x,)aredensities
Asdiscussedabove,notalldistributionscanberepresentedasdensities
IftheconditionaldistributionofX
t+1
givenX
t
=xcannotberepresentedasadensityforsome
x2S,thenweneedaslightlydifferenttheory
Theultimateoptionistoswitchfromdensitiestoprobabilitymeasures,butnotallreaderswillbe
familiarwithmeasuretheory
Wecan,however,constructafairlygeneraltheoryusingdistributionfunctions
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.1. CONTINUOUSSTATEMARKOVCHAINS
280
ExampleandDefinitions Toillustratetheissues,recallthatHopenhaynandRogerson[HR93]
studyamodeloffirmdynamicswhereindividualfirmproductivityfollowstheexogenousprocess
X
t+1
=a+rX
t
+x
t+1
, where fx
t
g
IID
 N(0,s
2
)
Asis,thisfitsintothedensitycasewetreatedabove
However,theauthorswantedthisprocesstotakevaluesin[0,1],sotheyaddedboundariesatthe
endpoints0and1
Onewaytowritethisis
X
t+1
=h(a+rX
t
+x
t+1
where h(x):=x1f0x1g+1fx>1g
Ifyouthinkaboutit,youwillseethatforanygivenx2[0,1],theconditionaldistributionofX
t+1
givenX
t
=xputspositiveprobabilitymasson0and1
Henceitcannotberepresentedasadensity
Whatwecandoinsteadisusecumulativedistributionfunctions(cdfs)
Tothisend,set
G(x,y):=Pfh(a+rx+x
t+1
)yg
(0x,y1)
ThisfamilyofcdfsG(x,)playsaroleanalogoustothestochastickernelinthedensitycase
Thedistributiondynamicsin(3.9)arethenreplacedby
F
t+1
(y)=
Z
G(x,y)F
t
(dx)
(3.14)
HereF
t
andF
t+1
arecdfsrepresentingthedistributionofthecurrentstateandnextperiodstate
Theintuitionbehind(3.14)isessentiallythesameasfor(3.9)
Computation Ifyouwishtocomputethesecdfs,youcannotusethelook-aheadestimatoras
before
Indeed,youshouldnotuseanydensityestimator,sincetheobjectsyouareestimating/computing
arenotdensities
Onegoodoptionissimulationasbefore,combinedwiththeempiricaldistributionfunction
Stability
InourlectureonfiniteMarkovchainswealsostudiedstationarity,stabilityandergodicity
Herewewillcoverthesametopicsforthecontinuouscase
Wewill,however,treatonlythedensitycase(asinthissection),wherethestochastickernelisa
familyofdensities
Thegeneralcaseisrelativelysimilar—referencesaregivenbelow
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Documents you may be interested
Documents you may be interested