Learn R Programming

qfa (version 4.0)

qspec2qcoh: Quantile Coherence Spectrum

Description

This function computes quantile coherence spectrum (QCOH) from quantile spectrum of multiple time series.

Usage

qspec2qcoh(qspec, k = 1, kk = 2)

Value

matrix of quantile coherence evaluated at Fourier frequencies in (0,0.5)

Arguments

qspec

array of quantile spectrum

k

index of first series (default = 1)

kk

index of second series (default = 2)

Examples

Run this code
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.qacf <- qacf(cbind(y1,y2),tau)
y.qper.lw <- qspec.lw(y.qacf=y.qacf,M=5)$spec
y.qcoh <- qspec2qcoh(y.qper.lw,k=1,kk=2)
qfa.plot(ff[sel.f],tau,y.qcoh)

Run the code above in your browser using DataLab