Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
5.2 7.9 8.7 8.9 15.3 15.4 18.1 19.7 13 12.6 6.2 3.5 3.4 0 9.5 8.9 10.4 13.2 18.9 19 16.3 10.6 5.8 3.6 2.6 5 7.3 9.2 15.7 16.8 18.4 18.1 14.6 7.8 7.6 3.8 5.6 2.2 6.8 11.8 14.9 16.7 16.7 15.9 13.6 9.2 2.8 2.5 4.8 2.8 7.8 9 12.9 16.4 21.8 17.8 13.5 10 10.4 5.5 4 6.8 5.7 9.1 13.6 15 20.9 20.4 14 13.7 7.1 0.8 2.1 1.3 3.9 10.7 11.1 16.4 17.1 17.3 12.9 10.9 5.3 0.7 -0.2 6.5 8.6 8.5 13.3 16.2 17.5 21.2 14.8 10.3 7.3 5.1 4.4 6.2 7.7 9.3 15.6 16.3 16.6 17.4 15.3 9.7 3.7 4.6 5.4 3.1 7.9 10.1 15 15.6 19.7 18.1 17.7 10.7 6.2 4.2 4 5.9 7.1 10.5 15.1 16.8 15.3 18.4 16.1 11.3 7.9 5.6 3.4 4.8 6.5 8.5 15.1 15.7 18.7 19.2 12.9 14.4 6.2 3.3 4.6 7.2 7.8 9.9 13.6 17.1 17.8 18.6 14.7 10.5 8.6 4.4 2.3 2.8 8.8 10.7 13.9 19.3 19.5 20.4 15.3 7.9 8.3 4.5 3.2 5 6.6 11.1 12.8 16.3 17.4 18.9 15.8 11.7 6.4 2.9 4.7 2.4 7.2 10.7 13.4 18.5 18.3 16.8 16.6 14.1 6.1 3.5 1.7 2.3 4.5 9.3 14.2 17.3 23 16.3 18.4 14.2 9.1 5.9 7.2 6.8 8 14.3 14.6 17.5 17.2 17.2 14.1 10.5 6.8 4.1 6.5 6.1 6.3 9.3 16.4 16.1 18 17.6 14 10.5 6.9 2.8 0.7 3.6 6.7 12.5 14.4 16.5 18.7 19.4 15.8 11.3 9.7 2.9
Seasonal period
12
12
1
2
3
4
5
6
7
8
9
10
11
12
Number of Forecasts
12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Algorithm
BFGS
L-BFGS-B
Chart options
R Code
par1 <- as.numeric(par1) nx <- length(x) x <- ts(x,frequency=par1) m <- StructTS(x,type='BSM') m$coef m$fitted m$resid mylevel <- as.numeric(m$fitted[,'level']) myslope <- as.numeric(m$fitted[,'slope']) myseas <- as.numeric(m$fitted[,'sea']) myresid <- as.numeric(m$resid) myfit <- mylevel+myseas mylagmax <- nx/2 bitmap(file='test2.png') op <- par(mfrow = c(2,2)) acf(as.numeric(x),lag.max = mylagmax,main='Observed') acf(mylevel,na.action=na.pass,lag.max = mylagmax,main='Level') acf(myseas,na.action=na.pass,lag.max = mylagmax,main='Seasonal') acf(myresid,na.action=na.pass,lag.max = mylagmax,main='Standardized Residals') par(op) dev.off() bitmap(file='test3.png') op <- par(mfrow = c(2,2)) spectrum(as.numeric(x),main='Observed') spectrum(mylevel,main='Level') spectrum(myseas,main='Seasonal') spectrum(myresid,main='Standardized Residals') par(op) dev.off() bitmap(file='test4.png') op <- par(mfrow = c(2,2)) cpgram(as.numeric(x),main='Observed') cpgram(mylevel,main='Level') cpgram(myseas,main='Seasonal') cpgram(myresid,main='Standardized Residals') par(op) dev.off() bitmap(file='test1.png') plot(as.numeric(m$resid),main='Standardized Residuals',ylab='Residuals',xlab='time',type='b') grid() dev.off() bitmap(file='test5.png') op <- par(mfrow = c(2,2)) hist(m$resid,main='Residual Histogram') plot(density(m$resid),main='Residual Kernel Density') qqnorm(m$resid,main='Residual Normal QQ Plot') qqline(m$resid) plot(m$resid^2, myfit^2,main='Sq.Resid vs. Sq.Fit',xlab='Squared residuals',ylab='Squared Fit') par(op) dev.off() load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Structural Time Series Model',6,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'t',header=TRUE) a<-table.element(a,'Observed',header=TRUE) a<-table.element(a,'Level',header=TRUE) a<-table.element(a,'Slope',header=TRUE) a<-table.element(a,'Seasonal',header=TRUE) a<-table.element(a,'Stand. Residuals',header=TRUE) a<-table.row.end(a) for (i in 1:nx) { a<-table.row.start(a) a<-table.element(a,i,header=TRUE) a<-table.element(a,x[i]) a<-table.element(a,mylevel[i]) a<-table.element(a,myslope[i]) a<-table.element(a,myseas[i]) a<-table.element(a,myresid[i]) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation