Description Usage Arguments Value Examples
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.
1 2 3 4 5 6 7 8 9 10 11 |
Y |
A |
frequencies |
A vector containing frequencies at which to determine the
|
levels |
A vector of length |
isRankBased |
If true the time series is first transformed to pseudo
data [cf. |
B |
number of bootstrap replications |
l |
(expected) length of blocks |
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. |
Returns an instance of QRegEstimator
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(snowfall)
Y <- rnorm(100) # Try 2000 and parallel computation will in fact be faster.
# Compute without using snowfall capabilities
system.time(
qRegEst1 <- qRegEstimator(Y, levels=seq(0.25,0.75,0.25), method="fn", parallel=FALSE)
)
# Set up snowfall
sfInit(parallel=TRUE, cpus=2, type="SOCK")
sfLibrary(quantreg)
sfExportAll()
# Compare how much faster the computation is when done in parallel
system.time(
qRegEst2 <- qRegEstimator(Y, levels=seq(0.25,0.75,0.25), method="fn", parallel=TRUE)
)
sfStop()
# Compare results
V1 <- getValues(qRegEst1)
V2 <- getValues(qRegEst2)
sum(abs(V1-V2)) # Returns: [1] 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.