makeparma: Simulation of PARMA sequence

View source: R/makeparma.R

makeparmaR Documentation

Simulation of PARMA sequence

Description

Procedures makeparma and makepar enable to construct PARMA and PAR type sequence of length n according to inputed matrices phi, theta, del. The optional parameter nprep defines the number of periods of simulated output y that will be discarded to let the start-up transients settle.

Usage

makeparma(n, phi, theta, del, nprep)
makepar(n, phi, del, nprep)

Arguments

n

length of simulated series.

phi

matrix of size T \times p containing periodic AR parameters.

theta

matrix of size T \times q containing periodic MA parameters.

del

vector of length T containing the periodic sigmas (shock weights), which are sometimes denoted also as \sigma(t) or as \theta_{0}(t).

nprep

number of periods of simulated output; for p>0 the computation of new y values depends on old ones through the autoregressive part. Starting a PARMA with the assumption that old values of y are equal to zero causes a transient in the output. This transient dies out as time goes on. So to avoid this transient problem, we compute nprep periods of simulated output to allow the transient to die out.
This parameter is optional, because by default nprep=50 (for makeparma procedure) or nprep=10 (for makepar procedure). Later we will provide a function to compute an appropriate value of nprep that depends on the PARMA parameters.

Details

A vector \xi(t) of independent N(0,1) variates is generated by the standard random number generator rnorm. This vector series is filtered by parmafil, which parameters are set by phi, theta and del, to generate the filtered series (pre-iterates and the n desired data). The last n data of the filtered series are output in the vector y.

Value

PARMA or PAR sequence returned as y.

Author(s)

Harry Hurd

See Also

parmafil

Examples

##################### simulation of PARMA(2,1)
T=12
nlen=480
p=2
 a=matrix(0,T,p)
q=1
 b=matrix(0,T,q)

a[1,1]=.8                 
a[2,1]=.3                                     
phia<-ab2phth(a) 
phi0=phia$phi         
phi0=as.matrix(phi0)       
      
b[1,1]=-.7	          
b[2,1]=-.6                  
thetab<-ab2phth(b)         
theta0=thetab$phi  
theta0=as.matrix(theta0) 

del0=matrix(1,T,1)       

PARMA21<-makeparma(nlen,phi0,theta0,del0)
parma<-PARMA21$y
plot(ts(parma))

##################### simulation of PAR(2)
T=24
nlen=1000
p=2
a=matrix(0,T,p)
a[1,1]=.5
a[2,2]=.4

phia<-ab2phth(a)
phi0=phia$phi
phi0=as.matrix(phi0)

del0=matrix(1,T,1)

PAR1<-makepar(nlen,phi0,del0)
par<-PAR1$y
plot(ts(par))

perARMA documentation built on Nov. 17, 2023, 9:06 a.m.