Learn R Programming

quantable (version 0.3.6)

runrobscale: running robust scaling of arefw

Description

running robust scaling of arefw

Usage

runrobscale(arefw, k = 101, scale = TRUE)

Arguments

arefw

- data array to scale

k

- windows

scale

- should also scaling be applied

Value

list with scaled data runmed used to center the data and runmad the running MAD used for scaling

Examples

Run this code
# NOT RUN {
res = c(rnorm(1000,0,1),rnorm(2000,4,3))
res2 = runrobscale(res)
par(mfrow=c(2,1))
plot(res,type="p",pch="x",col=1,cex=0.3)
lines(res2$runmed,col=3)

y = runFun( res2$scaled, k=51, func=mad )
#hist(y)
y2 = runFun(res2$scaled,k=51,func=median)
plot(res2$scaled,pch="*")
lines(y2,col=2,lwd=3)
lines(y2+y,col=3,lwd=3)
lines(y2-y,col=3,lwd=3)

# }

Run the code above in your browser using DataLab