Simulating a general ARFIMA model

Questions and discussions on Time Series Analysis
Post Reply
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Simulating a general ARFIMA model

Post by TomDoan »

The following demonstrates simulation of a general ARFIMA(p,d,q) model. The procedure ARFSIM only does an ARFIMA(0,d,0), that is, it works from a basis of white noise rather than a more general ARMA process.

This uses DLM with TYPE=SIMULATE to do a full sample simulation of the underlying ARMA(p,q) process. That's then subjected to fractional "undifferencing" by using DIFFERENCE with a negative value for FRAC. Since the fractional difference/integration operators have infinitely long lag lengths, you should discard a rather long set of initial observations (here 500 out of the 1000 simulated). This uses @AGFRACTD on the final 500 simulated points to check that it's producing a series with a desired properties.

Code: Select all

all 1000
*
* Generate an ARMA process with the desired properties
*
equation(ar=2,ma=1,noconstant,coeffs=||1.3,-.6,.4||) arma21 y
@armadlm(a=a,f=f) arma21
dlm(type=simulate,a=a,f=f,sw=1.0,presample=ergodic) 1 1000 xstates
set ysim = xstates(t)(1)
*
* Use DIFF with FRACT=-d where d is the desired level of fractional
* differencing.
*
diff(fract=-.7) ysim / fysim
*
* Discard a fairly long initial segment
*
@agfractd fysim 501 1000


Last bumped by TomDoan on Fri Dec 23, 2022 10:40 am.
Post Reply