qspec.ar | R Documentation |
This function computes autoregression (AR) estimate of quantile spectrum from time series or quantile series (QSER).
qspec.ar(
y,
tau,
y.qser = NULL,
p = NULL,
order.max = NULL,
freq = NULL,
method = c("none", "gamm", "sp"),
n.cores = 1,
cl = NULL
)
y |
vector or matrix of time series (if matrix, |
tau |
sequence of quantile levels in (0,1) |
y.qser |
matrix or array of pre-calculated QSER (default = |
p |
order of AR model (default = |
order.max |
maximum order for AIC if |
freq |
sequence of frequencies in [0,1) (default = |
method |
quantile smoothing method: |
n.cores |
number of cores for parallel computing of QDFT if |
cl |
pre-existing cluster for repeated parallel computing of QDFT (default = |
a list with the following elements:
spec |
matrix or array of AR quantile spectrum |
freq |
sequence of frequencies |
fit |
object of AR model |
qser |
matrix or array of quantile series if |
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)
y <- cbind(y1,y2)
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.qspec.ar <- qspec.ar(y,tau,p=1)$spec
qfa.plot(ff[sel.f],tau,Re(y.qspec.ar[1,1,sel.f,]))
y.qser <- qcser(y1,tau)
y.qspec.ar <- qspec.ar(y.qser=y.qser,p=1)$spec
qfa.plot(ff[sel.f],tau,Re(y.qspec.ar[sel.f,]))
y.qspec.arqs <- qspec.ar(y.qser=y.qser,p=1,method="sp")$spec
qfa.plot(ff[sel.f],tau,Re(y.qspec.arqs[sel.f,]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.