| colIQRDiffs {DelayedMatrixStats} | R Documentation |
Estimation of scale based on sequential-order differences, corresponding to
the scale estimates provided by var,
sd, mad and
IQR.
colIQRDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) colMadDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) colSdDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) colVarDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) rowIQRDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) rowMadDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) rowSdDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) rowVarDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, ... ) ## S4 method for signature 'DelayedMatrix' colIQRDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' colMadDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' colSdDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' colVarDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' rowIQRDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' rowMadDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' rowSdDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... ) ## S4 method for signature 'DelayedMatrix' rowVarDiffs( x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0, force_block_processing = FALSE, ... )
x |
A NxK DelayedMatrix. |
rows |
A |
cols |
A |
na.rm |
|
diff |
The positional distance of elements for which the difference should be calculated. |
trim |
A |
... |
Additional arguments passed to specific methods. |
force_block_processing |
|
Note that n-order difference MAD estimates, just like the ordinary MAD
estimate by mad, apply a correction factor such that
the estimates are consistent with the standard deviation under Gaussian
distributions.
The interquartile range (IQR) estimates does not apply such a
correction factor. If asymptotically normal consistency is wanted, the
correction factor for IQR estimate is 1 / (2 * qnorm(3/4)), which is
half of that used for MAD estimates, which is 1 / qnorm(3/4). This
correction factor needs to be applied manually, i.e. there is no
constant argument for the IQR functions.
Returns a numeric vector of
length 1, length N, or length K.
Peter Hickey
Peter Hickey
Peter Hickey
Peter Hickey
[1] J. von Neumann et al., The mean square successive
difference. Annals of Mathematical Statistics, 1941, 12, 153-162.
For the corresponding non-differentiated estimates, see
var, sd, mad
and IQR. Internally, diff2() is used
which is a faster version of diff().
# A DelayedMatrix with a 'Matrix' seed
dm_Matrix <- DelayedArray(Matrix::Matrix(c(rep(1L, 5),
as.integer((0:4) ^ 2),
seq(-5L, -1L, 1L)),
ncol = 3))
# A DelayedMatrix with a 'SolidRleArraySeed' seed
dm_Rle <- RleArray(Rle(c(rep(1L, 5),
as.integer((0:4) ^ 2),
seq(-5L, -1L, 1L))),
dim = c(5, 3))
colIQRDiffs(dm_Matrix)
colMadDiffs(dm_Matrix)
colSdDiffs(dm_Matrix)
colVarDiffs(dm_Matrix)
# Only using rows 2-4
rowIQRDiffs(dm_Rle, rows = 2:4)
# Only using rows 2-4
rowMadDiffs(dm_Rle, rows = 2:4)
# Only using rows 2-4
rowSdDiffs(dm_Rle, rows = 2:4)
# Only using rows 2-4
rowVarDiffs(dm_Rle, rows = 2:4)