Time Series Analysis With R
(1)线性分析(部分)
series<-scan("cpu_raw_hour.csv")
#smooth raw
seriesSMA8<-SMA(series,n=8)#smooth the series with a interval of 8
ts_seriesSMA8<-ts(seriesSMA8,frequency=1)
plot.ts(ts_seriesSMA8)
#log raw
seriesLOG<-log(series)
ts_seriesLOG<-ts(seriesLOG,frequency=1)
plot.ts(ts_seriesLOG)
#smooth log
seriesSMALOG<-SMA(seriesLOG,n=20)
ts_seriesSMALOG<-ts(seriesSMALOG)
(2)非线性简单分析
plot(c(max(series),min(series)),c(max(series),min(series)),cex=0)
i=1
while(i<length(series)){
points(c(series[i]),c(series[i+1]),cex=0.1,col="red")
i=i+1
}