asp.net pdf viewer : Change font size fillable pdf Library software component asp.net winforms html mvc jl-quant-econ37-part883

3.8. COVARIANCESTATIONARYPROCESSES
371
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Change font size fillable pdf - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
adjust pdf size preview; pdf compress
Change font size fillable 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
adjust size of pdf file; pdf change font size
3.8. COVARIANCESTATIONARYPROCESSES
372
Hencetheproductisalwayslargeandpositive,andhencethesumoftheproductsontheright-
handsideof(3.95)islarge
Theseideasareillustratedinthenextfigure,whichhaskonthehorizontalaxis(clicktoenlarge)
Ontheotherhand,ifweevaluatef(w)atw=p/3,thenthecyclesarenotmatched,thesequence
g(k)cos(wk)containsbothpositiveandnegativeterms,andhencethesumofthesetermsismuch
smaller
Insummary,thespectraldensityislargeatfrequencieswwheretheautocovariancefunctionex-
hibitscycles
InvertingtheTransformation Wehavejustseenthatthespectraldensityisusefulinthesense
that itprovidesafrequency-basedperspectiveontheautocovariancestructureofacovariance
stationaryprocess
Anotherreasonthatthespectraldensityisusefulisthatitcanbe“inverted”torecovertheauto-
covariancefunctionviatheinverseFouriertransform
Inparticular,forallk2Z,wehave
g(k)=
1
2p
Z
p
p
f(w)e
iwk
dw
(3.96)
Thisisconvenientinsituationswherethespectraldensityiseasiertocalculateandmanipulate
thantheautocovariancefunction
(Forexample,theexpression(3.94)fortheARMAspectraldensityismucheasiertoworkwith
thantheexpressionfortheARMAautocovariance)
MathematicalTheory Thissectionislooselybasedon[Sar87],p.249-253,andincludedforthose
who
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Field Edit Library: insert, delete, update pdf form field
professional PDF form creator supports to create fillable PDF form in to add text field to specified PDF file position Support to change font size in PDF form.
pdf change font size in textbox; change font size in pdf file
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
An advanced .NET control to change ODT, ODS, ODP forms to fillable PDF RasterEdge. Imaging.Font.dll. zoomValue, The magnification of the original PDF page size.
acrobat compress pdf; change font size in pdf form field
3.8. COVARIANCESTATIONARYPROCESSES
373
• wouldlikeabitmoreinsightintospectraldensities
• andhaveatleastsomebackgroundinHilbertspacetheory
Othersshouldfeelfreetoskiptothenextsection—noneofthismaterialisnecessarytoprogress
tocomputation
RecallthateveryseparableHilbertspaceHhasacountableorthonormalbasisfh
k
g
Thenicethingaboutsuchabasisisthatevery2Hsatisfies
=
å
k
a
k
h
k
where a
k
:=hf,h
k
i
(3.97)
whereh,idenotestheinnerproductinH
Thus, fcanberepresentedtoanydegreeofprecisionbylinearlycombiningbasisvectors
Thescalarsequencea=fa
k
giscalledtheFouriercoefficientsoff,andsatisfies
å
k
ja
k
j<¥
Inotherwords,aisin
2
,thesetofsquaresummablesequences
ConsideranoperatorTthatmapsa2‘
2
intoitsexpansion
å
k
a
k
h
k
2H
TheFouriercoefficientsofTaarejusta=fa
k
g,asyoucanverifybyconfirmingthathTa,h
k
i=a
k
UsingelementaryresultsfromHilbertspacetheory,itcanbeshownthat
• Tisone-to-one—ifaandbaredistinctin
2
,thensoaretheirexpansionsinH
• Tisonto—iff2Hthenitspreimagein
2
isthesequenceagivenbya
k
=hf,h
k
i
• Tisalinearisometry—inparticularha,bi=hTa,Tbi
Summarizingtheseresults,wesaythatanyseparableHilbertspaceisisometricallyisomorphicto
2
Inessence,thissaysthateachseparableHilbertspaceweconsiderisjustadifferentwayoflooking
atthefundamentalspace
2
Withthisinmind,let’sspecializetoasettingwhere
• g2‘
2
istheautocovariancefunctionofacovariancestationaryprocess,andfisthespectral
density
• H=L
2
,whereL
2
isthesetofsquaresummablefunctionsontheintervalp,p],withinner
producthg,hi=
R
p
p
g(w)h(w)dw
• fh
k
g=theorthonormalbasisforL
2
givenbythesetoftrigonometricfunctions
h
k
(w)=
e
iwk
p
2p
k2Zw2[ p,p]
UsingthedefinitionofTfromaboveandthefactthat fiseven,wenowhave
Tg=
å
k2Z
g(k)
e
iwk
p
2p
=
1
p
2p
f(w)
(3.98)
Inotherwords,apartfromascalarmultiple,thespectraldensityisjustantransformationofg2‘
2
underacertainlinearisometry—adifferentwaytoviewg
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Text Box Edit Library: add, delete, update PDF text box in
Able to create a fillable and editable text box to PDF document in C#.NET class. Support to change font color in PDF text box. Ability to change text size in PDF
change font size pdf comment box; adjust pdf size
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
Change Word hyperlink to PDF hyperlink and bookmark. RasterEdge.Imaging.Font.dll. zoomValue, The magnification of the original PDF page size. 0.1f
can a pdf file be compressed; adjusting page size in pdf
3.8. COVARIANCESTATIONARYPROCESSES
374
Inparticular,itisanexpansionoftheautocovariancefunctionwithrespecttothetrigonometric
basisfunctionsinL
2
Asdiscussedabove,theFouriercoefficientsofTgaregivenbythesequenceg,and,inparticular,
g(k)=hTg,h
k
i
Transformingthisinnerproductintoitsintegralexpressionandusing(3.98)gives(3.96),justifying
ourearlierexpressionfortheinversetransform
Implementation
MostcodeforworkingwithcovariancestationarymodelsdealswithARMAmodels
JuliacodeforstudyingARMAmodelscanbefoundintheDSP.jlpackage
Sincethiscodedoesn’tquitecoverourneeds—particularlyvis-a-visspectralanalysis—we’ve
puttogetherthemodulearma.jl,whichispartofQuantEcon.jlpackage.
ThemoduleprovidesfunctionsformappingARMA(p,q)modelsintotheir
1. impulseresponsefunction
2. simulatedtimeseries
3. autocovariancefunction
4. spectraldensity
Inadditionaltoindividualplotsoftheseentities,weprovidefunctionalitytogenerate2x2plots
containingallthisinformation
Inotherwords,wewanttoreplicatetheplotsonpages68–69of[LS12]
Here’sanexamplecorrespondingtothemodelX
t
=0.5X
1
+e
t
0.8e
2
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
Convert multiple pages PowerPoint to fillable and editable PDF documents. RasterEdge.Imaging.Font.dll. zoomValue, The magnification of the original PDF page
reader compress pdf; adjust pdf page size
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Create fillable and editable PDF documents from Excel in both .NET RasterEdge.Imaging. Font.dll. zoomValue, The magnification of the original PDF page size.
change file size of pdf; reader pdf reduce file size
3.8. COVARIANCESTATIONARYPROCESSES
375
Code Forinterest’ssake,‘‘arma.jl‘‘isprintedbelow
#=
@authors: John Stachurski
Date: Thu Aug 21 11:09:30 EST 2014
Provides functions for working with and visualizing scalar ARMA processes.
Ported from Python n module e quantecon.arma, which h was written n by y Doc-Jin Jang,
Jerry Choi, , Thomas s Sargent and John Stachurski
References
----------
http://quant-econ.net/jl/arma.html
=#
"""
Represents a scalar ARMA(p, q) process
If phi and theta are scalars, then the model is
understood to o be
X_t = phi X_{t-1} + epsilon_t + theta a epsilon_{t-1}
where epsilon_t is a white noise process s with h standard
deviation sigma.
If phi and theta are arrays or sequences,
then the interpretation is the ARMA(p, q) model
X_t = phi_1 1 X_{t-1} } + ... + phi_p X_{t-p} +
epsilon_t + + theta_1 1 epsilon_{t-1} + ... . +
theta_q epsilon_{t-q}
where
* phi = (phi_1, phi_2,..., phi_p)
* theta = (theta_1, theta_2,..., theta_q)
* sigma is a scalar, the standard deviation of the white noise
##### Fields
- phi::Vector : : AR R parameters phi_1, ..., , phi_p
- theta::Vector  : : MA parameters theta_1, ..., theta_q
- p::Integer : : Number r of AR coefficients
- q::Integer : : Number r of MA coefficients
- sigma::Real : : Standard d deviation of white noise
- ma_poly::Vector : MA polynomial --- filtering representatoin
- ar_poly::Vector : AR polynomial --- filtering representation
##### Examples
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.8. COVARIANCESTATIONARYPROCESSES
376
julia
using QuantEcon
phi = 0.5
theta = [0.0, , -0.8]
sigma = 1.0
lp = ARMA(phi, , theta, , sigma)
require(joinpath(Pkg.dir("QuantEcon"), "examples", , "arma_plots.jl"))
quad_plot(lp)

"""
type ARMA
phi::Vector
# AR parameters phi_1, ..., phi_p
theta::Vector
# MA parameters theta_1, , ..., , theta_q
p::Integer
# Number of AR coefficients
q::Integer
# Number of MA coefficients
sigma::Real
# Variance of white noise
ma_poly::Vector # MA polynomial --- filtering representatoin
ar_poly::Vector # AR polynomial --- filtering representation
end
# constructors s to o coerce phi/theta to vectors
ARMA(phi::Real, theta::Real=0.0, sigma::Real=1.0ARMA([phi;], , [theta;], , sigma)
ARMA(phi::Real, theta::Vector=[0.0], sigma::Real=1.0ARMA([phi;], theta, sigma)
ARMA(phi::Vector, theta::Real=0.0, sigma::Real=1.0ARMA(phi, [theta;], sigma)
function ARMA(phi::AbstractVector, theta::AbstractVector=[0.0], sigma::Real=1.0)
# == Record d dimensions s == #
length(phi)
length(theta)
# == Build d filtering g representation of polynomials == #
ma_poly [1.0; theta]
ar_poly [1.0-phi]
return ARMA(phi, theta, p, q, sigma, , ma_poly, , ar_poly)
end
"""
Compute the spectral density function.
The spectral density is the discrete time Fourier transform of the
autocovariance function. In particular,
f(w) = sum_k gamma(k) exp(-ikw)
where gamma is s the e autocovariance function and the sum is over
the set of all l integers.
##### Arguments
- arma::ARMA: Instance of ARMA type
- ;two_pi::Bool(true): Compute the spectral l density y function over [0, pi] if
false and [0, 2 pi] otherwise.
- ;res(1200) : If res is a scalar then the spectral density is computed at
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.8. COVARIANCESTATIONARYPROCESSES
377
res frequencies evenly spaced around the unit circle, but if res is an array
then the function computes the response e at t the frequencies given by the array
##### Returns
- w::Vector{Float64}: The normalized frequencies at which h was computed, in
radians/sample
- spect::Vector{Float64} : The frequency response
"""
function spectral_density(arma::ARMA; res=1200, two_pi::Bool=true)
# Compute the spectral density associated with ARMA process arma
wmax two_pi 2pi pi
linspace(0, wmax, res)
tf TFFilter(reverse(arma.ma_poly), , reverse(arma.ar_poly))
freqz(tf, w)
spect arma.sigma^abs(h).^2
return w, spect
end
"""
Compute the autocovariance function from m the e ARMA parameters
over the integers range(num_autocov) using the spectral density
and the inverse Fourier transform.
##### Arguments
- arma::ARMA: Instance of ARMA type
- ;num_autocov::Integer(16) : The number of autocovariances to calculate
"""
function autocovariance(arma::ARMA; num_autocov::Integer=16)
# Compute the autocovariance function n associated d with ARMA process arma
# Computation is via the spectral density and inverse FFT
(w, spect) spectral_density(arma)
acov real(Base.ifft(spect))
# num_autocov should be <= len(acov) ) / / 2
return acov[1:num_autocov]
end
"""
Get the impulse response corresponding to our model.
##### Arguments
- arma::ARMA: Instance of ARMA type
- ;impulse_length::Integer(30): Length of horizon for calucluating impulse
reponse. Must t be e at least as long as the p fields s of f arma
##### Returns
- psi::Vector{Float64}: psi[j] is the response at lag j of the impulse
response. We take psi[1] as unity.
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.8. COVARIANCESTATIONARYPROCESSES
378
"""
function impulse_response(arma::ARMA; impulse_length=30)
# Compute the impulse response function associated with ARMA process arma
err_msg "Impulse length must be greater than number of AR coefficients"
@assert impulse_length >= arma.p err_msg
# == Pad theta with zeros at the end == #
theta [arma.theta; zeros(impulse_length arma.q)]
psi_zero 1.0
psi Array(Float64, impulse_length)
for 1:impulse_length
psi[j] theta[j]
for 1:min(j, arma.p)
psi[j] += arma.phi[i] (j-psi[j-i] : psi_zero)
end
end
return [psi_zero; psi[1:end-1]]
end
"""
Compute a simulated sample path assuming g Gaussian n shocks.
##### Arguments
- arma::ARMA: Instance of ARMA type
- ;ts_length::Integer(90): Length of simulation
- ;impulse_length::Integer(30): Horizon for calculating impulse response
(see also docstring for impulse_response)
##### Returns
- X::Vector{Float64}: Simulation of the ARMA A model l arma
"""
function simulation(arma::ARMA; ts_length=90, impulse_length=30)
# Simulate e the e ARMA process arma assuing Gaussian shocks
impulse_length
ts_length
psi impulse_response(arma, impulse_length=impulse_length)
epsilon arma.sigma randn(T J)
Array(Float64, T)
for t=1:T
X[t] dot(epsilon[t:J+t-1], psi)
end
return X
end
Here’sanexampleofusage
julia> using QuantEcon
julia> using QuantEcon
julia> phi 0.5;
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.8. COVARIANCESTATIONARYPROCESSES
379
julia> theta [0-0.8];
julia> lp ARMA(phi, theta);
julia> QuantEcon.quad_plot(lp)
Explanation Thecall
lp ARMA(phi, , theta, , sigma)
createsaninstancelpthatrepresentstheARMA(p,q)model
X
t
=f
1
X
1
+...+f
p
X
t p
+e
t
+q
1
e
1
+...+q
q
e
t q
Ifphiandthetaarearraysorsequences,thentheinterpretationwillbe
• phiholdsthevectorofparameters(f
1
,f
2
,...,f
p
)
• thetaholdsthevectorofparameters(q
1
,q
2
,...,q
q
)
Theparametersigmaisalwaysascalar,thestandarddeviationofthewhitenoise
Wealsopermitphiandthetatobescalars,inwhichcasethemodelwillbeinterpretedas
X
t
=fX
1
+e
t
+qe
1
ThetwonumericalpackagesmostusefulforworkingwithARMAmodelsareDSP.jlandthefft
routineinJulia
ComputingtheAutocovarianceFunction Asdiscussedabove,forARMAprocessesthespectral
densityhasasimplerepresentationthatisrelativelyeasytocalculate
Giventhisfact,theeasiestwaytoobtaintheautocovariancefunctionistorecoveritfromthe
spectraldensityviatheinverseFouriertransform
HereweuseJulia’sFouriertransformroutinefft,whichwrapsastandardC-basedpackagecalled
FFTW
Alookat thefft documentationshowsthattheinversetransformiffttakes s agivensequence
A
0
,A
1
,...,A
1
andreturnsthesequencea
0
,a
1
,...,a
1
definedby
a
k
=
1
n
1
å
t=0
A
t
e
ik2pt/n
Thus,ifwesetA
t
=f(w
t
),wherefisthespectraldensityandw
t
:=2pt/n,then
a
k
=
1
n
1
å
t=0
f(w
t
)e
iw
t
k
=
1
2p
2p
n
1
å
t=0
f(w
t
)e
iw
t
k
,
w
t
:=2pt/n
Fornsufficientlylarge,wethenhave
a
k
1
2p
Z
2p
0
f(w)e
iwk
dw=
1
2p
Z
p
p
f(w)e
iwk
dw
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.9. ESTIMATIONOFSPECTRA
380
(Youcancheckthelastequality)
Inviewof(3.96)wehavenowshownthat,fornsufficientlylarge,a
k
g(k)—whichisexactly
whatwewanttocompute
3.9 EstimationofSpectra
Contents
• EstimationofSpectra
– Overview
– Periodograms
– Smoothing
– Exercises
– Solutions
Overview
In a previous lecture we coveredsome fundamental properties ofcovariance stationary linear
stochasticprocesses
Oneobjectiveforthatlecturewastointroducespectraldensities—astandardandveryuseful
techniqueforanalyzingsuchprocesses
Inthislectureweturntotheproblemofestimatingspectraldensitiesandotherrelatedquantities
fromdata
Estimatesofthespectraldensityarecomputedusingwhatisknownasaperiodogram—which
inturniscomputedviathefamousfastFouriertransform
Oncethebasictechniquehasbeenexplained,wewillapplyittotheanalysisofseveralkeymacroe-
conomictimeseries
Forsupplementaryreading,see[Sar87]or[CC08].
Periodograms
Recallthatthespectraldensity fofacovariancestationaryprocesswithautocorrelationfunction
gcanbewrittenas
f(w)=g(0)+2
å
k1
g(k)cos(wk),
w2R
Nowconsidertheproblemofestimatingthespectraldensityofagiventimeseries,whengis
unknown
Inparticular,letX
0
,...,X
1
benconsecutiveobservationsofasingletimeseriesthatisassumed
tobecovariancestationary
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Documents you may be interested
Documents you may be interested