Displaying 1 result from an estimated 1 matches for "tp3695820p3695916".
2011 Jul 26
2
Calculate the latest Z-score of all zoo time series
Hello,
I have a population of 2000+ zoo time series (but my environment also
contains objects that are not zoo time series). I'm trying to calculate the
latest 90 days Z-Score of all zoo time series, using the following code:
LZS<-function(ser) {
temp<-window(ser,start=Sys.Date()-90)
last((temp-mean(temp))/sd(temp))
}
sapply(ls(), LZS )
The LZS function works on individual zoo time