Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
4581945 3874038 4086290 4364364 3793586 4533914 4823043 3981535 4746356 5284534 4264830 3924674 3734753 3762290 3609739 3877594 3636415 3578195 3604342 3459513 3366571 3371277 3724848 3350830 3305159 3390736 3349758 3253655 3734250 3455433 2966726 2993716 3009320 3169713 3170061 3368934 3292638 3337344 3208306 3359130 3223078 3437159 3400156 3657576 3765613 3481921 3604800 3981340 3734078 4018173 3887417 3919880 4014466 4197758 3896531 3964742 4201847 4050512 3997402 4314479 4925744 5130631 4444855 3967319 3931250 4235952 4169219 3779064 3558810 3699466 3650693 3525633 3470276 3859094 3661155 3356365 3344440 3338684 3404294 3289319 3469252 3571850 3639914 3091730 3078149 3188115 3246082 3486992 3378187 3282306 3288345 3325749 3352262 3531954 3722622 3809365 3750617 3615286 3696556 4123959 4136163 3933392 4035576 4551202 4032195 3970893 4489016 5426127 4578224 4126390 4892100 4128697 4408721 4199465 4074767 4161758 3891319 4470302 4283111 3845962 3911471 3798478 3644313 3784029 3647134 3994662 3607836 3566008 3511412 3258665 3486573 3369443 3465544 3905224 3733881 3220642 3225812 3354461 3352261 3450652
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