Learn R Programming

qfa (version 4.0)

tsqr.fit: Trigonometric Spline Quantile Regression (TSQR) of Time Series

Description

This function computes trigonometric spline quantile regression (TSQR) for univariate time series at a single frequency.

Usage

tsqr.fit(
  y,
  f0,
  tau,
  spar = 1,
  d = 1,
  weighted = FALSE,
  mthreads = TRUE,
  prepared = TRUE,
  ztol = 1e-05
)

Value

object of sqr.fit() (coefficients in $coef)

Arguments

y

time series

f0

frequency in [0,1)

tau

sequence of quantile levels in (0,1)

spar

smoothing parameter

d

subsampling rate of quantile levels (default = 1)

weighted

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

mthreads

if FALSE, set RhpcBLASctl::blas_set_num_threads(1) (default = TRUE)

prepared

if TRUE, intercept is removed and coef of cosine is doubled when f0 = 0.5

ztol

zero tolerance parameter used to determine the effective dimensionality of the fit

Examples

Run this code
y <- stats::arima.sim(list(order=c(1,0,0), ar=0.5), n=64)
tau <- seq(0.1,0.9,0.05)
fit <- tqr.fit(y,f0=0.1,tau=tau)
fit.sqr <- tsqr.fit(y,f0=0.1,tau=tau,spar=1,d=4)
plot(tau,fit$coef[1,],type='p',xlab='QUANTILE LEVEL',ylab='TQR COEF')
lines(tau,fit.sqr$coef[1,],type='l')

Run the code above in your browser using DataLab