padMatrix(X, by.row = TRUE, type = "reflect", pad.direction = "both", replaceLinearTrend = FALSE)
by.row=TRUE
, the matrix contains observations in the rows and each column represents a different data series (padding data by column). If by.row=FALSE
, the matrix contains observations in the columns and each row represents a different data series (padding data by row).
"reflect"
, "periodic"
, or "mean"
. The "reflect"
option repeats values proceeding the end/beginning of the series (ex: 12345 --> 12345432
). The "periodic"
option repeats the series in order (ex: 12345 --> 12345123
). The "mean"
option repeats the series mean (ex: 12345 --> 12345333
).
"both"
, "front"
, or "rear"
. The "both"
option pads data on both sides of the series (ex: 12345 --> 31234533
). The "front"
option pads data on the beginning of the series (ex: 12345 --> 33312345
). The "rear"
option pads data on the end of the series (ex: 12345 --> 12345333
).
TRUE
, the estimated linear trend is replaced in the returned data. If FALSE
, the estimated trend is not replaced in the returned data. See Details for more information.
xPad
will not exactly match the original data between these indices, since the linear trend has been estimated (and possibly replaced).X
.If the data supplied is of length, $t$, the padded data returned will be of length $T=2^{ceiling(log(t, base=2))}$.
The data length $T=2^J$ for a positive integer, $J$, requirement is associated with the discrete wavelet transform. Although methodology exists in the wavelet literature which allows for data series of any length, this methodology does not align with the theory behind WiSE bootstrap.
The replaceLinearTrend
option allows the user to control whether linear trend appears in the padded data. The linear trend (by data index) is estimated using least squares for each data series. This trend is removed before padding the data. The estimated trend may or may not be replaced to the padded data. The linear trend consists of the data intercept and slope (by index).
padVector
, wavethresh-package
someData <- matrix(seq(1,5^2)+rnorm(25), nrow=7)
padMatrix(someData)
padMatrix(someData, type="mean", pad.direction="rear")
padMatrix(someData, type="periodic", pad.direction="front")
Run the code above in your browser using DataLab