Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
101.5 100.7 110.6 96.8 100 104.8 86.8 92 100.2 106.6 102.1 93.7 97.6 96.9 105.6 102.8 101.7 104.2 92.7 91.9 106.5 112.3 102.8 96.5 101 98.9 105.1 103 99 104.3 94.6 90.4 108.9 111.4 100.8 102.5 98.2 98.7 113.3 104.6 99.3 111.8 97.3 97.7 115.6 111.9 107 107.1 100.6 99.2 108.4 103 99.8 115 90.8 95.9 114.4 108.2 112.6 109.1 105 105 118.5 103.7 112.5 116.6 96.6 101.9 116.5 119.3 115.4 108.5 111.5 108.8 121.8 109.6 112.2 119.6 104.1 105.3 115 124.1 116.8 107.5 115.6 116.2 116.3 119 111.9 118.6 106.9 103.2 118.6 118.7 102.8 100.6 94.9 94.5 102.9 95.3 92.5 102.7 91.5 89.5 104.2 105.2 99 95.5 90.5 96.1 113 101.9 101.4 113.6 96.6 97.8 114.9 112.5 108.4 107 103.5 107.5 122.3
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
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation