Skip to content
Prev 248862 / 398506 Next

How to do a moving window on standard deviation

I'd rather do this without getting into zoo objects at the moment. OK, how
about with a simple loop ? Why doesn't this work ?

attach(xyz)
j <- for(i in 4: length(Close)) sd(Close[i]:Close[(i-3)])