qspec.ar {qfa}R Documentation

Autoregression (AR) Estimator of Quantile Spectrum

Description

This function computes autoregression (AR) estimate of quantile spectrum/cross-spectrum from time series or quantile series (QSER).

Usage

qspec.ar(
  y,
  tau,
  y.qser = NULL,
  p = NULL,
  order.max = NULL,
  freq = NULL,
  n.cores = 1,
  cl = NULL
)

Arguments

y

vector or matrix of time series (if matrix, nrow(y) = length of time series)

tau

sequence of quantile levels in (0,1)

y.qser

matrix or array of pre-calculated QSER (default = NULL: compute from y and tau); if y.qser is supplied, y and tau can be left unspecified

p

order of AR model (default = NULL: automatically selected by AIC)

order.max

maximum order for AIC if p = NULL (default = NULL: determined by stats::ar())

freq

sequence of frequencies in [0,1) (default = NULL: all Fourier frequencies)

n.cores

number of cores for parallel computing of QDFT if y.qser = NULL (default = 1)

cl

pre-existing cluster for repeated parallel computing of QDFT (default = NULL)

Value

a list with the following elements:

spec

matrix or array of AR quantile spectrum/cross-spectrum

freq

sequence of frequencies

fit

object of AR model

qser

matrix or array of quantile series if y.qser = NULL

Examples

y1 <- stats::arima.sim(list(order=c(1,0,0), ar=0.5), n=64)
y2 <- stats::arima.sim(list(order=c(1,0,0), ar=-0.5), n=64)
tau <- seq(0.1,0.9,0.05)
n <- length(y1)
ff <- c(0:(n-1))/n
sel.f <- which(ff > 0 & ff < 0.5)
y.ar <- qspec.ar(cbind(y1,y2),tau,p=1)
qfa.plot(ff[sel.f],tau,Re(y.ar$spec[1,1,sel.f,]))

[Package qfa version 2.1 Index]