[R-SIG-Finance] contradiction between rugarch package and fracdiff package
alexios ghalanos
alexios at 4dscape.com
Thu Jun 21 03:01:23 CEST 2012
Please follow the guidelines and provide a reproducible example. The way
to do that is to put some thought in the question and read the
documentation in both packages i.e. they both offer simulation functions
from which you can test for yourself the results using either
fracdiff.sim or arfimasim.
1. Simulate a large number of scenarios (e.g. 1000 (n.points) x 500
independent 'scenarios').
2. Fit with arfimasim and whatever other function you want.
3. Look at the distribution of the fitted parameters.
4. Consider that one is ML based (rugarch) which is where that
"additional paramater sigma" comes from .
5. Consider what happens when n.points is small (100 vs 1000) by
simulating and fitting small 'scenarios'...but this is an issue already
covered in the literature and the difficulty in getting a good estimate
of the fractional parameter with small datasets.
- Finally, the correct spec to use in order to compare in your example
would have been to set armaOrder=c(0,0), since you defined the fdGPH and
fdSperio without ar and ma terms.
e.g.
# reproducible example (by setting the seed)!
set.seed(100)
# simulator:
memory.long <- fracdiff.sim(1500, d = 0.3)
spec = arfimaspec(mean.model = list(armaOrder=c(0,0), include.mean =
F, arfima = T,external.regressors=NULL), distribution.model = "norm")
coef(arfimafit(spec, memory.long$series))["arfima"]
fdGPH(memory.long$series, bandw.exp = 0.5)$d
fdSperio(memory.long$series, bandw.exp = 0.5, beta = 0.9)$d
###########################
# d=parameter (TRUE = 0.3)
# rugarch fdGPH fdSperio
0.2658 0.3833562 0.2811597
###########################
-Alexios
On 20/06/2012 23:56, Chao Xiong wrote:
> Hi, I am new in using rugarch. It is fabulous. But I need some help on
> fitting the ARFIMA model.
>
> using rugarch
>
> spec = arfimaspec(mean.model = list(armaOrder=c(1,1), include.mean =
> F, arfima = T,
> external.regressors=NULL)
> , distribution.model = "norm")
>
> res = arfimafit(spec, dat$daysp^2*10000);
>
> in fracdiff package, there are two functions (Sperio Estimate and
> Geweke and Porter-Hudak Estimator) providing an estimate of d, or
> "arfima" in rugarch
>
> fdGPH(dat$daysp^2*10000, bandw.exp = 0.5)
> fdSperio(dat$daysp^2*10000, bandw.exp = 0.5, beta = 0.9)
>
> in this particular data set, it will give a value of 0.37. However,
> using rugarch package, the value is -0.03. Is it becuase rugarch will
> estimate an additional parameter sigma? I highly doubt that. You can
> also try any other data set.
>
> I don't know which one is correct. In addition, the speed for using
> rugarch is much slower.
>
> Thanks.
>
More information about the R-SIG-Finance
mailing list