Choices of centering or detrending and scaling are important preprocessings for multiway analysis.
Multcent(dat,bi=c(1,2),by=3,
centre=mean,
centrebyBA=c(TRUE,FALSE),scalebyBA=c(TRUE,FALSE))
IterMV(n=10,dat,Mm=c(1,3),Vm=c(2,3),
fFUN=mean,usetren=FALSE,
tren=function(x)smooth.spline(as.vector(x),df=5)$y,
rsd=TRUE)
Detren(dat,Mm=c(1,3),rsd=TRUE,
tren=function(x)smooth.spline(as.vector(x),df=5)$y )
Susan1D(y,x=NULL,sigmak=NULL,sigmat=NULL,
ker=list(function(u)return(exp(-0.5*u**2))))
array
vector defining the "centering, bicentering or multi-centering" one wants
to operate crossed with by
number or vector defining the entries used "with" in the other operations
function used as FUN
in applying
"multi-centering"
a bolean vector for "centering" with centre
Before and After
according to by
idem as centrebyBA, for scaling operation
number of iterations between "centering" and scaling
margins to performs Detren
or fFUN
on
margins to scale
function to use as FUN
if usetren
is
FALSE
logical, to use Detren
function to use in Detren
logical passed into Detren
(only) to detrend or not
vector (length n
)
vector of same length, if NULL
it is 1:n
parameter related to kernel bandwidth with y
values (default is 1/2*range
parameter related to kernel bandwidth with x
values (default value is 8*n^{-1/5}
, with a minimum number of
neigbours set as one apart)
a list of two kernels list("t"=function "k"=function
)
for each weightings (if only one given it is used for
both)
Didier G. Leibovici
Multcent
performs in order "centering" by by
;
"multicentering" for every bi
with by
; then scale
(standard deviation) to one by by
.
IterMV
performs an iterative "detrending" and scaling
according to te margins defined (see Leibovici(2000) and references
in it).
Detren
detrends (or smooths if rsd
is FALSE
)
the data accoding to th margins given.
Susan1D
performs a non-linear kernel smoothing of y
against x
(both reordered in the function according to orders
of x
) with an usual kernel (t
) as for kernel
regression and a kernel (t
) for the values of y
(the
product of the kernels constitutes the non-linear weightings. This
function is adapted from SUSAN algorithm (see references).
Smith S.M. and J.M. Brady (1997) SUSAN - a new approach to low level image processing. International Journal of Computer Vision, 23(1):45-78, May 1997.