Various functions to analyze data over a moving window of periods.
runSum(x, n = 10, cumulative = FALSE)runMin(x, n = 10, cumulative = FALSE)
runMax(x, n = 10, cumulative = FALSE)
runMean(x, n = 10, cumulative = FALSE)
runMedian(x, n = 10, non.unique = "mean", cumulative = FALSE)
runCov(x, y, n = 10, use = "all.obs", sample = TRUE, cumulative = FALSE)
runCor(x, y, n = 10, use = "all.obs", sample = TRUE, cumulative = FALSE)
runVar(x, y = NULL, n = 10, sample = TRUE, cumulative = FALSE)
runSD(x, n = 10, sample = TRUE, cumulative = FALSE)
runMAD(
x,
n = 10,
center = NULL,
stat = "median",
constant = 1.4826,
non.unique = "mean",
cumulative = FALSE
)
wilderSum(x, n = 10)
A object of the same class as x
and y
or a vector (if
try.xts
fails).
returns sums over a n-period moving window.
returns minimums over a n-period moving window.
returns maximums over a n-period moving window.
returns means over a n-period moving window.
returns medians over a n-period moving window.
returns covariances over a n-period moving window.
returns correlations over a n-period moving window.
returns variances over a n-period moving window.
returns standard deviations over a n-period moving window.
returns median/mean absolute deviations over a n-period moving window.
retuns a Welles Wilder style weighted sum over a n-period moving window.
Object coercible to xts or matrix.
Number of periods to use in the window or, if
cumulative=TRUE
, the number of observations to use before the first
result is returned. Must be between 1 and nrow(x)
, inclusive.
Logical, use from-inception calculation?
One of 'mean', 'max', or 'min'; which compute their respective statistics for the two middle values of even-sized samples.
Object coercible to xts or matrix.
Only "all.obs"
currently implemented.
Logical, sample covariance if TRUE
(denominator of
n-1
)
The values to use as the measure of central tendency, around
which to calculate deviations. The default (NULL
) uses the median.
Statistic to calculate, one of 'median' or 'mean' (e.g. median absolute deviation or mean absolute deviation, respectively.)
Scale factor applied to approximate the standard deviation.
Joshua Ulrich