SmoothedPG-constructor: Create an instance of the 'SmoothedPG' class.

Description Usage Arguments Details Value Examples

Description

A SmoothedPG object can be created from either

If a QuantilePG object is used for smoothing, only the weight, frequencies and levels.1 and levels.2 parameters are used; all others are ignored. In this case the default values for the levels are the levels of the QuantilePG used for smoothing. Any subset of the levels available there can be chosen.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
smoothedPG(
  object,
  frequencies = 2 * pi/lenTS(object) * 0:(lenTS(object) - 1),
  levels.1 = 0.5,
  levels.2 = levels.1,
  isRankBased = TRUE,
  type = c("clipped", "qr"),
  type.boot = c("none", "mbb"),
  method = c("br", "fn", "pfn", "fnc", "lasso", "scad"),
  parallel = FALSE,
  B = 0,
  l = 1,
  weight = kernelWeight()
)

Arguments

object

a time series (numeric, ts, or zoo object) from which to determine the smoothed periodogram; alternatively a QuantilePG object can be supplied.

frequencies

A vector containing frequencies at which to determine the smoothed periodogram.

levels.1

A vector of length K1 containing the levels x1 at which the SmoothedPG is to be determined.

levels.2

A vector of length K2 containing the levels x2.

isRankBased

If true the time series is first transformed to pseudo data [cf. FreqRep].

type

A flag to choose the type of the estimator. Can be either "clipped" or "qr". In the first case ClippedFT is used as a frequency representation, in the second case QRegEstimator is used.

type.boot

A flag to choose a method for the block bootstrap; currently two options are implemented: "none" and "mbb" which means to do a moving blocks bootstrap with B and l as specified.

method

method used for computing the quantile regression estimates. The choice is passed to qr; see the documentation of quantreg for details.

parallel

a flag to allow performing parallel computations, where possible.

B

number of bootstrap replications

l

(expected) length of blocks

weight

Object of type Weight to be used for smoothing.

Details

The parameter type.boot can be set to choose a block bootstrapping procedure. If "none" is chosen, a moving blocks bootstrap with l=length(Y) and N=length(Y) would be done. Note that in that case one would also chose B=0 which means that getPositions would never be called. If B>0 then each bootstrap replication would be the undisturbed time series.

Value

Returns an instance of SmoothedPG.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
Y <- rnorm(64)
levels.1 <- c(0.25,0.5,0.75)
weight <- kernelWeight(W=W0)

# Version 1a of the constructor -- for numerics:
sPG.ft <- smoothedPG(Y, levels.1 = levels.1, weight = weight, type="clipped")
sPG.qr <- smoothedPG(Y, levels.1 = levels.1, weight = weight, type="qr")

# Version 1b of the constructor -- for ts objects:
sPG.ft <- smoothedPG(wheatprices, levels.1 = c(0.05,0.5,0.95), weight = weight)

# Version 1c of the constructor -- for zoo objects:
sPG.ft <- smoothedPG(sp500, levels.1 = c(0.05,0.5,0.95), weight = weight)

# Version 2 of the constructor:
qPG.ft <- quantilePG(Y, levels.1 = levels.1, type="clipped")
sPG.ft <- smoothedPG(qPG.ft, weight = weight)
qPG.qr <- quantilePG(Y, levels.1 = levels.1, type="qr")
sPG.qr <- smoothedPG(qPG.qr, weight = weight)

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