getPointwiseCIs-LagEstimator: Get pointwise confidence intervals for the quantile spectral...

Description Usage Arguments Details Value Examples

Description

Returns a list of two arrays lowerCIs and upperCIs that contain the upper and lower limits for a level 1-alpha confidence interval of the copula spectral density kernel. Each array is of dimension [J,K1,K2], where J=length(frequencies), K1=length(levels.1), and K2=length(levels.2)). At position (j,k1,k2) the real (imaginary) part of the returned values are the bounds of the confidence interval for the the real (imaginary) part of the quantile spectrum, which corresponds to frequencies[j], levels.1[k1] and levels.2[k2] closest to the Fourier frequencies, levels.1 and levels.2 available in object; closest.pos is used to determine what closest to means.

Usage

1
2
3
4
5
6
7
8
9
## S4 method for signature 'LagEstimator'
getPointwiseCIs(
  object,
  frequencies = 2 * pi * (0:(length(object@Y) - 1))/length(object@Y),
  levels.1 = getLevels(object, 1),
  levels.2 = getLevels(object, 2),
  alpha = 0.1,
  type = c("naive.sd", "boot.sd", "boot.full")
)

Arguments

object

LagEstimator of which to get the confidence intervals

frequencies

a vector of frequencies for which to get the result

levels.1

the first vector of levels for which to get the result

levels.2

the second vector of levels for which to get the result

alpha

the level of the confidence interval; must be from (0,1)

type

a flag indicating which type of confidence interval should be returned; can only take one values at the moment.

Details

Currently, only one type of confidence interval is available:

Value

Returns a named list of two arrays lowerCIS and upperCIs containing the lower and upper bounds for the confidence intervals.

Examples

1
2
3
4
5
6
7
8
9
lagEst <- lagEstimator(rnorm(2^10), levels.1=0.5)
CI.upper <- Re(getPointwiseCIs(lagEst)$upperCIs[,1,1])
CI.lower <- Re(getPointwiseCIs(lagEst)$lowerCIs[,1,1])
freq = 2*pi*(0:1023)/1024
plot(x = freq, y = rep(0.25/(2*pi),1024),
   ylim=c(min(CI.lower), max(CI.upper)),
   type="l", col="red") # true spectrum
lines(x = freq, y = CI.upper)
lines(x = freq, y = CI.lower)

Example output

Loading required package: stats4

quantspec documentation built on July 15, 2020, 1:07 a.m.