Page 1 of 1

generate arfima models !!!!

Posted: Mon Jan 05, 2009 11:40 pm
by hnida
hI
My question how to generate a process arfima?
arfima(p,d,q) where 0.5<d<0.5 and l=lags
(1-L)^d*x(t)=arma(p,q)
My problem is in the left term, i don't know how to programm it.
Can someone helop me please!

Re: generate arfima models !!!!

Posted: Thu Mar 11, 2010 5:20 pm
by tmb
I know this is a really old topic, but I'm also trying to simulate arfima processes with various values for d, and I'm having a fair bit of difficulty figuring out how to do it.

The AR and MA parts are very easy to generate, but I'm not quite sure how to code the (1-L)^d portion. Basically, (1-L)^d expands to the following form:

[(L^k)*Gamma(k-d)/[Gamma(-d)*Gamma(k+1)]], summed up over k.

I attempted to create a series of gamma, 1 through k, which I could then sum up to give me the lag operator.

!f = 0.1
series gam
for !r = 1 to 100
!g1 = @gamma(!r - !f)
!g2 = @gamma(-!f)
!g3 = @gamma(!r + 1)
gam(!r) = !g1 / (!g2 * !g3)
next

The problem is !g2. The gamma function in Eviews, @gamma(x), requires x to be a positive number. However, since d is a positive number, @gamma(-!f) produces an error when the program is run.

Does anyone know a possible solution to this problem? I found a RATS program that also simulates an ARFIMA model, but they source an "Xgamma procedure", which I can't find any information about. None of the links I found to the Xgamma program worked.

Thanks in advance for the help!