SmoothedPG-constructor | R Documentation |
SmoothedPG
class.A SmoothedPG
object can be created from either
a numeric
, a ts
, or a zoo
object
a QuantilePG
object.
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.
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()
)
object |
a time series ( |
frequencies |
A vector containing frequencies at which to determine the smoothed periodogram. |
levels.1 |
A vector of length |
levels.2 |
A vector of length |
isRankBased |
If true the time series is first transformed to pseudo
data [cf. |
type |
A flag to choose the type of the estimator. Can be either
|
type.boot |
A flag to choose a method for the block bootstrap; currently
two options are implemented: |
method |
method used for computing the quantile regression estimates.
The choice is passed to |
parallel |
a flag to allow performing parallel computations, where possible. |
B |
number of bootstrap replications |
l |
(expected) length of blocks |
weight |
Object of type |
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.
Returns an instance of SmoothedPG
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.