Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
19.25 11.6 15.15 10.95 15.2 12.6 13.2 9.95 19.9 8.1 12.9 14.85 14.05 10.95 7.65 12.65 11.35 14.5 13.6 14.9 16.1 12.4 18.1 18.25 12.15 17.35 12.6 7.6 13.4 14.1 19.9 18.1 11.85 16.65 15.6 15.25 16.1 15.4 13.35 15.4 16.1 16.2 7.7 11.15 13.15 14.75 15.85 15.4 14.1 18.2 16.15 11.2 18.4 17.65 18.45 9.9 16.6 17.6 17.65 18.4 12.6 19.3 11.2 14.6 18.45 4.5 19.1 13.4 4.35 12.75 15.6 11.85 10.95 15.25 11.9 18.55 11.95 15.1 15.6 15.1 17.85 19.05 16.65 12.4 12.6 13.35 16.1 18.25 12.35 14.85 13.85 14.6 7.85 16 13.9 18.95 11.4 14.6 15.25 12.45 19.1 14.6 12.7 13.2 17.75 16.35 18.4 12.85 15.35 17.75 13.1 15.7 15.95 14.7 15.65 13.35 14.75 14.6 15.9 19.1 14.9 12.2 7.85 12.35 19.2 8.6 11.75 9.85 16.85 10.35 14.9 10.6 15.35 9.6 11.9 14.75 14.8 16.35 16.85 15.2 17.35 18.15 13.6 13.6 15 16.85 17.1 17.1 13.35 17.75 18.9 13.6 13.95 15.65 14.35 14.75 11.7 14.35 19.1 16.6 9.5 16.25 17.6 17.1 16.1 17.75 13.6 15.6 12.65 13.6 11.7
Seasonal period
7
12
1
2
3
4
5
6
7
8
9
10
11
12
Number of Forecasts
6
12
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Algorithm
TRUE
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
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation