parmafil {perARMA}R Documentation

PARMA filtration

Description

Procedure parmafil filters the vector x according to matrices a, b containing PARMA model parameters. The function returns series y such that a(n,1)y(n)=b(n,1)x(n)+b(n,2)x(n1)++b(n,nb+1)x(nnb)a(n,2)y(n1)a(n,na+1)y(nna)a(n,1)*y(n) = b(n,1)*x(n) + b(n,2)*x(n-1) + \ldots + b(n,nb+1)*x(n-nb)- a(n,2)*y(n-1) - \ldots - a(n,na+1)*y(n-na).

Usage

parmafil(b, a, x)

Arguments

b

matrix of size T×(nb+1)T \times (nb+1), which elements satisfy b(n,j)=b(n+T,j)b(n,j)=b(n+T,j), usually in the literature b is called the periodic MA parameters and nbnb is denoted by qq.

a

matrix of size T×naT \times na, which elements satisfy a(n,j)=a(n+T,j)a(n,j)=a(n+T,j), usually in the literature a is called the periodic AR parameters and nana is denoted pp. If a(n,1)a(n,1) is not equal to 1 for all nn, the values of a(n,j)a(n,j) are normalized by a(n,j)=a(n,j)/a(n,1)a(n,j)=a(n,j)/a(n,1).

x

input time series.

Value

Filtered signal y.

Note

To filter using the convention ϕ(t,B)x(t)=θ(t,B)ξ(t)\phi(t,B)x(t) = \theta(t,B) \xi(t) with ϕ(t,B)=1ϕ(t,1)B...ϕ(t,p)Bp\phi(t,B)=1 - \phi(t,1)B - ... - \phi(t,p)B^p, θ(t,B)=del(t,1)+θ(t,1)B+...+θ(t,q)Bq\theta(t,B)=del(t,1) + \theta(t,1)B + ... + \theta(t,q)B^q set a=[ones(T,1),-phi], b=[theta], then x=parmafil(b,a,xi).

Author(s)

Harry Hurd

See Also

loglikec, loglikef, makeparma

Examples

b=matrix(c(1,1,0,0,.5,.5),2,3)
a=matrix(c(1,1,.5,.5),2,2)
s=sample(1:100,50, replace=TRUE)
x=matrix(s,50,1)

parmafil_out<-parmafil(a,b,x)
y=parmafil_out$y
plot(y,type="l")

[Package perARMA version 1.7 Index]