Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
0.0589999409995141 -1.41417450501306 -18.3846475755861 4.24266776527226 -9.89940750475467 -1.41416601970523 -4.94968147844429 8.48527118362683 5.65684722004823 2.12135156036077 -12.7278137906086 -1.41417238368611 -5.65678640867546 5.71546709301464 11.430917448217 4.0824915417843 -5.71542749248443 -4.89893277693375 5.30722585896545 -8.98140023237252 -0.816480018948223 -3.67419274460486 2.44950292718234 -7.34841447478369 -12.2473676641251 13.5676795115537 -7.50550178552387 -10.1035605510469 4.61879420118808 -12.9903024874634 3.7527758629083 -14.1450008210891 -2.30938107887528 -11.2582591729112 -4.33008822361948 1.29908651985677e-05 16.454417696876 7.82621147962468 4.02491438422167 -8.72060773063855 -0.894411455568734 -0.223594253653449 -6.93176357788012 -2.01244265593132 -7.1553761680782 0.223617958497356 8.27342503551901 15.2051986751483 2.90688653528183 -12.7801213366766 -3.10373653589491 -7.1203466912372 -3.46888342810694 -8.3983624583384 2.55603701106735 0.182580385499283 10.5892565952768 15.7013138196074 6.75522353446613 5.11206123957597 8.76352852127385
Seasonal period
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