qspec.sqrlw {qfa}R Documentation

Spline-Quantile-Regression-Lag-Window (SQRLW) Estimator of Quantile Spectrum

Description

This function computes spline-quantile-regression-lag-window (SQRLW) estimate of quantile spectrum/cross-spectrum from time series or spline quantile discrete Fourier transform (SQDFT).

Usage

qspec.sqrlw(
  y,
  tau,
  y.sqdft = NULL,
  M = NULL,
  c0 = 0.02,
  d = 4,
  weighted = FALSE,
  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.sqdft

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

M

bandwidth parameter of lag window (default = NULL: quantile periodogram)

c0

penalty parameter for SQDFT

d

subsampling rate of quantile levels for SQDFT (default = 1)

weighted

if TRUE, SQR penalty function is weighted (default = FALSE)

n.cores

number of cores for parallel computing of SQDFT (default = 1)

cl

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

Value

A list with the following elements:

spec

matrix or array of quantile spectrum/cross-spectrum

lw

lag-window sequence

sqdft

matrix or array of spline quantile discrete Fourier transform if y.sqdft = 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.qper.sqrlw <- qspec.sqrlw(cbind(y1,y2),tau,M=5,c0=0.02,d=4)$spec
qfa.plot(ff[sel.f],tau,Re(y.qper.sqrlw[1,1,sel.f,]))

[Package qfa version 2.1 Index]