[R] How to obtain the series of residuals from fracdiff

Adrian Trapletti adrian.trapletti at lmttrading.com
Thu Jan 10 10:36:21 CET 2002


> Date: Wed, 9 Jan 2002 07:57:31 +0000
> From: Susana Barbosa <susanabarbosa at novalis.fc.up.pt>
> Subject: [R] How to obtain the series of residuals from fracdiff
>
> Hi
>
> I'm using fracdiff package to estimate the parameters of a
> fractionally-differenced ARIMA (p,d,q) model, and it works fine, but I wanted
> to have also the filtered series and the series of residuals.
> I understand these are calculated in the subroutine fdfilt, in the program
> fdcore.f, but I can't manage to get them out.
>
> Any suggestion would be much appreciated
>
> Thanks
>
> Susana Barbosa

Hi Susana

For fractional differencing you can use, e.g., something like

fracdiff <- function (x, d, N = 100)
{
  n <- 0:N
  w <- gamma(-d+n)/(gamma(-d)*gamma(n+1))
  y <- filter(x, w, sides=1)
  return (y)
}

Adrian


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list