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

About this list Date view Thread view Subject view Author view Attachment view

From: Adrian Trapletti (adrian.trapletti@lmttrading.com)
Date: Thu 10 Jan 2002 - 20:36:21 EST


Message-id: <3C3D6095.5EB01FAA@lmttrading.com>


> Date: Wed, 9 Jan 2002 07:57:31 +0000
> From: Susana Barbosa <susanabarbosa@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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Wed 16 Oct 2002 - 11:56:53 EST