Description
Usage
Arguments
Value
Author(s)
internal function
 (x, y, k, dimx,
endrule=("NA", "trim", "keep", "constant", "func"),
align = ("center", "left", "right"), Func, )

x 
numeric vector of length n

k 
width of moving window; must be an integer between one and n.

dimx 
original dimension of x (usually dim(x) ) used to choose
dimentions of the output.

endrule 
character string indicating how the values at the beginning
and the end, of the data, should be treated. Only first and last k2
values at both ends are affected, where k2 is the halfbandwidth
k2 = k %/% 2 .

"mad"  applies the mad function to
smaller and smaller sections of the array. Equivalent to:
for(i in 1:k2) out[i]=mad(x[1:(i+k2)]) .

"trim"  trim the ends; output array length is equal to
length(x)2*k2 (out = out[(k2+1):(nk2)]) . This option mimics
output of apply (embed(x,k),1,FUN) and other
related functions.

"keep"  fill the ends with numbers from x vector
(out[1:k2] = x[1:k2]) . This option makes more sense in case of
smoothing functions, kept here for consistency.

"constant"  fill the ends with first and last calculated
value in output array (out[1:k2] = out[k2+1])

"NA"  fill the ends with NA's (out[1:k2] = NA)

"func"  same as "mad" option except that implemented
in R for testing purposes. Avoid since it can be very slow for large windows.

y 
numeric vector of length n, which is partially filled output of
one of the run functions. Function EndRule will fill the
remaining beginning and end sections using method chosen by endrule
argument.

align 
specifies whether result should be centered (default),
leftaligned or rightaligned.

Func 
Function name that EndRule will use in case of
endrule="func" .

... 
Additional parameters to Func that EndRule will
use in case of endrule="func" .

Returns a numeric vector of the same length as x
. Only in case of
endrule="trim"
.the output will be shorter.
Jarek Tuszynski (SAIC) jaroslaw.w.tuszynski@saic.com
caTools documentation built on March 28, 2021, 9:07 a.m.