asp.net pdf reader : Advanced pdf compressor online software control dll winforms web page azure web forms jl-quant-econ16-part860

2.7. LINEARSTATESPACEMODELS
161
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Advanced pdf compressor online - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
pdf custom paper size; batch pdf compression
Advanced pdf compressor online - 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
change paper size in pdf; adjust pdf size
2.7. LINEARSTATESPACEMODELS
162
Ensemblemeans Intheprecedingfigurewerecoveredthedistributionofy
T
by
1. generatingIsamplepaths(i.e.,timeseries)whereIisalargenumber
2. recordingeachobservationy
i
T
3. histogrammingthissample
Justasthehistogramcorrespondstothedistribution,theensembleorcross-sectionalaverage
y¯
T
:=
1
I
I
å
i=1
y
i
T
approximatestheexpectation
[y
T
]=Gm
t
(asimpliedbythelawoflargenumbers)
Here’sasimulationcomparingtheensembleaveragesandpopulationmeansattimepointst=
0,...,50
Theparametersarethesameasfortheprecedingfigures,andthesamplesizeisrelativelysmall
(I=20)
Theensemblemeanforx
t
is
¯
x
T
:=
1
I
I
å
i=1
x
i
T
!m
T
(I!¥)
Thelimitm
T
canbethoughtofasa“populationaverage”
(Bypopulationaveragewemeantheaverageforaninfinite(I=¥)numberofsamplex
T
‘s)
Anotherapplicationofthelawoflargenumbersassuresusthat
1
I
I
å
i=1
(x
i
T
¯x
T
)(x
i
T
x¯
T
)
0
!S
T
(I!¥)
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
VB.NET Word: Word Docuemnt Compression and Decompression Guide
multiple threaded VB.NET project(s) to utilize and apply the advanced Word doc to compress Word file, and also customize your own Word compressor via changing
pdf markup text size; pdf font size change
2.7. LINEARSTATESPACEMODELS
163
JointDistributions Intheprecedingdiscussionwelookedatthedistributionsofx
t
andy
t
in
isolation
Thisgivesususefulinformation,butdoesn’tallowustoanswerquestionslike
• what’stheprobabilitythatx
t
0forallt?
• what’stheprobabilitythattheprocessfy
t
gexceedssomevalueabeforefallingbelowb?
• etc.,etc.
Suchquestionsconcernthejointdistributionsofthesesequences
Tocomputethejointdistributionofx
0
,x
1
,...,x
T
, recallthatjointandconditionaldensitiesare
linkedbytherule
p(x,y)=p(yjx)p(x)
(joint conditional  marginal)
Fromthisrulewegetp(x
0
,x
1
)=p(x
1
jx
0
)p(x
0
)
TheMarkovpropertyp(x
t
jx
1
,...,x
0
)=p(x
t
jx
1
)andrepeatedapplicationsofthepreceding
ruleleadusto
p(x
0
,x
1
,...,x
T
)=p(x
0
)
1
Õ
t=0
p(x
t+1
jx
t
)
Themarginalp(x
0
)isjusttheprimitiveN(m
0
,S
0
)
Inviewof(2.30),theconditionaldensitiesare
p(x
t+1
jx
t
)=N(Ax
t
,CC
0
)
Autocovariancefunctions Animportantobjectrelatedtothejointdistributionistheautocovari-
ancefunction
S
t+j,t
:=
[(x
t+j
m
t+j
)(x
t
m
t
)
0
]
(2.43)
Elementarycalculationsshowthat
S
t+j,t
=A
j
S
t
(2.44)
NoticethatS
t+j,t
ingeneraldependsonbothj,thegapbetweenthetwodates,andt,theearlier
date
StationarityandErgodicity
Stationarityandergodicityaretwopropertiesthat,whentheyhold,greatlyaidanalysisoflinear
statespacemodels
Let’sstartwiththeintuition
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
164
VisualizingStability Let’slookatsomemoretimeseriesfromthesamemodelthatweanalyzed
above
Thispictureshowscross-sectionaldistributionsforyattimesT,T
0
,T
00
Notehowthetimeseries“settledown”inthesensethatthedistributionsatT
0
andT
00
arerela-
tivelysimilartoeachother—butunlikethedistributionatT
Apparently,thedistributionsofy
t
convergetoafixedlong-rundistributionast!¥
Whensuchadistributionexistsitiscalledastationarydistribution
StationaryDistributions Inoursetting,adistributiony
¥
issaidtobestationaryforx
t
if
x
t
y
¥
and x
t+1
=Ax
t
+Cw
t+1
=)
x
t+1
y
¥
Since
1. inthepresentcasealldistributionsareGaussian
2. aGaussiandistributionispinneddownbyitsmeanandvariance-covariancematrix
wecanrestatethedefinitionasfollows:y
¥
isstationaryforx
t
if
y
¥
=N(m
¥
,S
¥
)
wherem
¥
andS
¥
arefixedpointsof(2.36)and(2.37)respectively
CovarianceStationaryProcesses Let’sseewhathappenstotheprecedingfigureifwestartx
0
at
thestationarydistribution
Nowthedifferencesintheobserveddistributionsat T,T
0
andT
00
comeentirelyfromrandom
fluctuationsduetothefinitesamplesize
By
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
165
• ourchoosingx
0
N(m
¥
,S
¥
)
• thedefinitionsofm
¥
andS
¥
asfixedpointsof(2.36)and(2.37)respectively
we’veensuredthat
m
t
=m
¥
and S
t
=S
¥
forallt
Moreover,inviewof(2.44),theautocovariancefunctiontakestheformS
t+j,t
AjS
¥
,which
dependsonjbutnotont
Thismotivatesthefollowingdefinition
Aprocessfx
t
gissaidtobecovariancestationaryif
• bothm
t
andS
t
areconstantint
• S
t+j,t
dependsonthetimegapjbutnotontimet
Inoursetting,fx
t
gwillbecovariancestationaryifm
0
,S
0
,A,Cassumevaluesthatimplythatnone
ofm
t
,S
t
,S
t+j,t
dependsont
ConditionsforStationarity
Thegloballystablecase Thedifferenceequationm
t+1
=Am
t
isknowntohaveuniquefixedpoint
m
¥
=0ifalleigenvaluesofAhavemodulistrictlylessthanunity
Thatis,ifall(abs(eigvals(A)) .< 1) == true
Thedifferenceequation(2.37)alsohasauniquefixedpointinthiscase,and,moreover
m
t
!m
¥
=0 and S
t
!S
¥
as t!¥
regardlessoftheinitialconditionsm
0
andS
0
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
166
Thisisthegloballystablecase—seethese notesformoreatheoreticaltreatment
However,globalstabilityismorethanweneedforstationarysolutions,andoftenmorethanwe
want
Toillustrate,consideroursecondorderdifferenceequationexample
Herethestateisx
t
=
y
t
y
1
0
Becauseoftheconstantfirstcomponentinthestatevector,wewillneverhavem
t
!0
Howcanwefindstationarysolutionsthatrespectaconstantstatecomponent?
Processeswithaconstantstatecomponent Toinvestigatesuchaprocess,supposethatAandC
taketheform
A=
A
1
a
0
1
C=
C
1
0
where
• A
1
isan(1)(1)matrix
• aisan(1)1columnvector
Letx
t
=
x
0
1t
1
0
wherex
1t
is(1)1
Itfollowsthat
x
1,t+1
=A
1
x
1t
+a+C
1
w
t+1
Letm
1t
=
[x
1t
]andtakeexpectationsonbothsidesofthisexpressiontoget
m
1,t+1
=A
1
m
1,t
+a
(2.45)
AssumenowthatthemodulioftheeigenvaluesofA
1
areallstrictlylessthanone
Then(2.45)hasauniquestationarysolution,namely,
m
=(I A
1
)
1
a
Thestationaryvalueofm
t
itselfisthenm
¥
:=
m
0
1
0
ThestationaryvaluesofS
t
andS
t+j,t
satisfy
S
¥
=AS
¥
A
0
+CC
0
(2.46)
S
t+j,t
=A
j
S
¥
NoticethathereS
t+j,t
dependsonthetimegapjbutnotoncalendartimet
Inconclusion,if
• x
0
N(m
¥
,S
¥
)and
• themodulioftheeigenvaluesofA
1
areallstrictlylessthanunity
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
167
thenthefx
t
gprocessiscovariancestationary,withconstantstatecomponent
Note: IftheeigenvaluesofA
1
arelessthanunityinmodulus,then(a)startingfromanyinitial
value,themeanandvariance-covariancematrixbothconvergetotheirstationaryvalues;and(b)
iterationson(2.37)convergetothefixedpointofthediscreteLyapunovequationinthefirstlineof
(2.46)
Ergodicity Let’ssupposethatwe’reworkingwithacovariancestationaryprocess
Inthiscaseweknowthattheensemblemeanwillconvergetom
¥
asthesamplesizeIapproaches
infinity
Averagesovertime Ensembleaveragesacrosssimulationsareinterestingtheoretically, butin
reallifeweusuallyobserveonlyasinglerealizationfx
t
,y
t
gT
t=0
Sonowlet’stakeasinglerealizationandformthetimeseriesaverages
x¯:=
1
T
T
å
t=1
x
t
and
y¯:=
1
T
T
å
t=1
y
t
Dothesetimeseriesaveragesconvergetosomethinginterpretableintermsofourbasicstate-space
representation?
Theanswerdependsonsomethingcalledergodicity
Ergodicityisthepropertythattimeseriesandensembleaveragescoincide
Moreformally,ergodicityimpliesthattimeseriessampleaveragesconvergetotheirexpectation
underthestationarydistribution
Inparticular,
1
T
å
T
t=0
x
t
!m
¥
1
T
å
T
t=0
(x
t
¯x
T
)(x
t
x¯
T
)
0
!S
¥
1
T
å
T
t=0
(x
t+j
¯x
T
)(x
t
¯x
T
)!AjS
¥
InourlinearGaussiansetting,anycovariancestationaryprocessisalsoergodic
NoisyObservations
Insomesettingstheobservationequationy
t
=Gx
t
ismodifiedtoincludeanerrorterm
Oftenthiserrortermrepresentstheideathatthetruestatecanonlybeobservedimperfectly
Toincludeanerrortermintheobservationweintroduce
• Aniidsequenceof‘1randomvectorsv
t
N(0,I)
• Ak‘matrixH
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
168
andextendthelinearstate-spacesystemto
x
t+1
=Ax
t
+Cw
t+1
(2.47)
y
t
=Gx
t
+Hv
t
x
0
N(m
0
,S
0
)
Thesequencefv
t
gisassumedtobeindependentoffw
t
g
Theprocessfx
t
gisnotmodifiedbynoiseintheobservationequationanditsmoments,distribu-
tionsandstabilitypropertiesremainthesame
Theunconditionalmomentsofy
t
from(2.38)and(2.39)nowbecome
[y
t
]=
[Gx
t
+Hv
t
]=Gm
t
(2.48)
Thevariance-covariancematrixofy
t
iseasilyshowntobe
Var[y
t
]=Var[Gx
t
+Hv
t
]=GS
t
G
0
+HH
0
(2.49)
Thedistributionofy
t
istherefore
y
t
N(Gm
t
,GS
t
G
0
+HH
0
)
Prediction
Thetheoryofpredictionforlinearstatespacesystemsiselegantandsimple
ForecastingFormulas–ConditionalMeans Thenaturalwaytopredictvariablesistousecon-
ditionaldistributions
Forexample,theoptimalforecastofx
t+1
giveninformationknownattimetis
t
[x
t+1
]:=
[x
t+1
jx
t
,x
1
,...,x
0
]=Ax
t
Theright-handsidefollowsfromx
t+1
Ax
t
+Cw
t+1
andthefactthatw
t+1
iszeromeanand
independentofx
t
,x
1
,...,x
0
That
t
[x
t+1
]=
[x
t+1
jx
t
]isanimplicationoffx
t
ghavingtheMarkovproperty
Theone-step-aheadforecasterroris
x
t+1
t
[x
t+1
]=Cw
t+1
Thecovariancematrixoftheforecasterroris
[(x
t+1
t
[x
t+1
])(x
t+1
t
[x
t+1
])
0
]=CC
0
Moregenerally,we’dliketocomputethej-stepaheadforecasts
t
[x
t+j
]and
t
[y
t+j
]
Withabitofalgebraweobtain
x
t+j
=A
j
x
t
+A
1
Cw
t+1
+A
2
Cw
t+2
++A
0
Cw
t+j
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
169
Inviewoftheiidproperty,currentandpaststatevaluesprovidenoinformationaboutfuture
valuesoftheshock
Hence
t
[w
t+k
]=
[w
t+k
]=0
Itnowfollowsfromlinearityofexpectationsthatthej-stepaheadforecastofxis
t
[x
t+j
]=A
j
x
t
Thej-stepaheadforecastofyistherefore
t
[y
t+j
]=
t
[Gx
t+j
+Hv
t+j
]=GA
j
x
t
CovarianceofPredictionErrors Itisusefultoobtainthecovariancematrixofthevectorofj-
step-aheadpredictionerrors
x
t+j
t
[x
t+j
]=
1
å
s=0
A
s
Cw
t s+j
(2.50)
Evidently,
V
j
:=
t
[(x
t+j
t
[x
t+j
])(x
t+j
t
[x
t+j
])
0
]=
1
å
k=0
A
k
CC
0
A
k
0
(2.51)
V
j
definedin(2.51)canbecalculatedrecursivelyviaV
1
=CC
0
and
V
j
=CC
0
+AV
1
A
0
j2
(2.52)
V
j
istheconditionalcovariancematrixoftheerrorsinforecastingx
t+j
,conditionedontimetinfor-
mationx
t
Underparticularconditions,V
j
convergesto
V
¥
=CC
0
+AV
¥
A
0
(2.53)
Equation(2.53)isanexampleofadiscreteLyapunovequationinthecovariancematrixV
¥
AsufficientconditionforV
j
toconvergeisthattheeigenvaluesofAbestrictlylessthanonein
modulus.
Weakersufficientconditionsforconvergenceassociateeigenvaluesequalingorexceedingonein
moduluswithelementsofCthatequal0
ForecastsofGeometricSums Inseveralcontexts,wewanttocomputeforecastsofgeometric
sumsoffuturerandomvariablesgovernedbythelinearstate-spacesystem(2.30)
Wewantthefollowingobjects
• Forecastofageometricsumoffuturex‘s,or
t
h
å
¥
j=0
b
j
x
t+j
i
• Forecastofageometricsumoffuturey‘s,or
t
h
å
¥
j=0
b
j
y
t+j
i
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
2.7. LINEARSTATESPACEMODELS
170
Theseobjectsareimportantcomponentsofsomefamousandinterestingdynamicmodels
Forexample,
• iffy
t
gisastreamofdividends,then
h
å
¥
j=0
b
j
y
t+j
jx
t
i
isamodelofastockprice
• iffy
t
gisthemoneysupply,then
h
å
¥
j=0
b
j
y
t+j
jx
t
i
isamodelofthepricelevel
Formulas Fortunately,itiseasytousealittlematrixalgebratocomputetheseobjects
SupposethateveryeigenvalueofAhasmodulusstrictlylessthan
1
b
ItthenfollowsthatI+bA+b
2
A
2+=[
I bA]
1
Thisleadstoourformulas:
• Forecastofageometricsumoffuturex‘s
t
"
¥
å
j=0
b
j
x
t+j
#
=[I+bA+b
2
A
2
+]x
t
=[I bA]
1
x
t
• Forecastofageometricsumoffuturey‘s
t
"
¥
å
j=0
b
j
y
t+j
#
=G[I+bA+b
2
A
2
+]x
t
=G[I bA]
1
x
t
Code
Ourprecedingsimulationsandcalculationsarebasedoncodeinthefilelss.pyfromtheQuantE-
con.jlpackage
Thecodeimplementsatypeforhandlinglinearstatespacemodels(simulations,calculatingmo-
ments,etc.)
Werepeatithereforconvenience
#=
Computes quantities s related to o the Gaussian linear state space model
x_{t+1} = = A x_t + C w_{t+1}
y_t = = G x_t
The shocks {w_t} } are e iid and N(0, I)
@author : Spencer Lyon <spencer.lyon@nyu.edu>
@date : : 2014-07-28
References
----------
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Documents you may be interested
Documents you may be interested