R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(563278,571477,583775,598714,581744,530455,527676,536352,545732,558685,561649,540735,538712,547612,563280,581302,572273,518654,520579,530577,540324,547970,555654,551174,548604,563668,586111,604378,600991,544686,537034,551531,563250,574761,580112,575093,557560,564478,580523,596594,586570,536214,523597,536535,536322,532638,528222,516141,501866,506174,517945,533590,528379,477580,469357,490243,492622,507561,516922,514258,509846,527070,541657,564591,555362,498662,511038,525919,531673,548854,560576,557274,565742,587625,619916,625809,619567,572942,572775,574205,579799,590072,593408,597141,595404,612117,628232,628884,620735,569028,567456,573100,584428,589379,590865,595454,594167,611324,612613,610763,593530,542722,536662,543599,555332,560854,562325,554788,547344,565464,577992,579714,569323,506971,500857,509127,509933,517009,519164,512238,509239) > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '12' > main = 'Seasonal Decomposition by Loess' > par8 <- 'FALSE' > par7 <- '1' > par6 <- '' > par5 <- '1' > par4 <- '' > par3 <- '0' > par2 <- 'periodic' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par1 <- as.numeric(par1) #seasonal period > if (par2 != 'periodic') par2 <- as.numeric(par2) #s.window > par3 <- as.numeric(par3) #s.degree > if (par4 == '') par4 <- NULL else par4 <- as.numeric(par4)#t.window > par5 <- as.numeric(par5)#t.degree > if (par6 != '') par6 <- as.numeric(par6)#l.window > par7 <- as.numeric(par7)#l.degree > if (par8 == 'FALSE') par8 <- FALSE else par9 <- TRUE #robust > nx <- length(x) > x <- ts(x,frequency=par1) > if (par6 != '') { + m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.window=par6, l.degree=par7, robust=par8) + } else { + m <- stl(x,s.window=par2, s.degree=par3, t.window=par4, t.degre=par5, l.degree=par7, robust=par8) + } > m$time.series seasonal trend remainder Jan 1 -5834.688 565984.1 3128.6022 Feb 1 7693.642 564534.2 -750.8177 Mar 1 23637.349 563084.3 -2946.6135 Apr 1 35323.346 561599.6 1791.0678 May 1 26193.342 560114.9 -4564.2505 Jun 1 -26494.263 558570.0 -1620.7512 Jul 1 -29214.170 557025.1 -134.9508 Aug 1 -18444.241 555451.1 -654.8821 Sep 1 -11267.316 553877.1 3122.1902 Oct 1 -1962.525 552445.3 8202.2694 Nov 1 2616.867 551013.4 8018.7478 Dec 1 -2247.347 549924.0 -6941.6050 Jan 2 -5834.688 548834.5 -4287.8301 Feb 2 7693.642 548077.2 -8158.7938 Mar 2 23637.349 547319.8 -7677.1333 Apr 2 35323.346 547065.1 -1086.4522 May 2 26193.342 546810.4 -730.7708 Jun 2 -26494.263 547387.3 -2238.9987 Jul 2 -29214.170 547964.1 1829.0745 Aug 2 -18444.241 549274.6 -253.3813 Sep 2 -11267.316 550585.1 1006.1665 Oct 2 -1962.525 552406.8 -2474.2933 Nov 2 2616.867 554228.5 -1191.3538 Dec 2 -2247.347 556226.4 -2805.0831 Jan 3 -5834.688 558224.4 -3785.6847 Feb 3 7693.642 560221.4 -4247.0840 Mar 3 23637.349 562218.5 255.1407 Apr 3 35323.346 564272.3 4782.3196 May 3 26193.342 566326.2 8471.4987 Jun 3 -26494.263 567913.6 3266.6609 Jul 3 -29214.170 569501.0 -3252.8759 Aug 3 -18444.241 569834.9 140.3583 Sep 3 -11267.316 570168.7 4348.5962 Oct 3 -1962.525 569460.5 7263.0058 Nov 3 2616.867 568752.3 8742.8147 Dec 3 -2247.347 567574.0 9766.3023 Jan 4 -5834.688 566395.8 -3001.0824 Feb 4 7693.642 564574.8 -7790.4573 Mar 4 23637.349 562753.9 -5868.2082 Apr 4 35323.346 559697.1 1573.5866 May 4 26193.342 556640.3 3736.3816 Jun 4 -26494.263 552486.2 10222.0987 Jul 4 -29214.170 548332.1 4479.1169 Aug 4 -18444.241 543296.5 11682.7682 Sep 4 -11267.316 538260.9 9328.4233 Oct 4 -1962.525 532717.5 1883.0075 Nov 4 2616.867 527174.1 -1569.0091 Dec 4 -2247.347 521973.3 -3584.9613 Jan 5 -5834.688 516772.5 -9071.7857 Feb 5 7693.642 512848.5 -14368.1220 Mar 5 23637.349 508924.5 -14616.8343 Apr 5 35323.346 506952.1 -8685.4934 May 5 26193.342 504979.8 -2794.1521 Jun 5 -26494.263 505086.2 -1011.9025 Jul 5 -29214.170 505192.5 -6621.3519 Aug 5 -18444.241 506717.4 1969.8000 Sep 5 -11267.316 508242.4 -4353.0444 Oct 5 -1962.525 510414.7 -891.1487 Nov 5 2616.867 512587.0 1718.1463 Dec 5 -2247.347 515106.8 1398.5638 Jan 6 -5834.688 517626.6 -1945.8910 Feb 6 7693.642 520611.8 -1235.4668 Mar 6 23637.349 523597.1 -5577.4185 Apr 6 35323.346 527011.0 2256.6870 May 6 26193.342 530424.9 -1256.2072 Jun 6 -26494.263 534461.2 -9304.9408 Jul 6 -29214.170 538497.5 1754.6267 Aug 6 -18444.241 543538.7 824.4939 Sep 6 -11267.316 548580.0 -5639.6352 Oct 6 -1962.525 554247.5 -3430.9511 Nov 6 2616.867 559915.0 -1955.8678 Dec 6 -2247.347 565547.8 -6026.4958 Jan 7 -5834.688 571180.7 396.0040 Feb 7 7693.642 575962.0 3969.3104 Mar 7 23637.349 580743.4 15535.2408 Apr 7 35323.346 584348.7 6136.9145 May 7 26193.342 587954.1 5419.5884 Jun 7 -26494.263 590427.0 9009.2203 Jul 7 -29214.170 592900.0 9089.1533 Aug 7 -18444.241 594350.6 -1701.3201 Sep 7 -11267.316 595801.1 -4734.7898 Oct 7 -1962.525 596303.4 -4268.8338 Nov 7 2616.867 596805.6 -6014.4786 Dec 7 -2247.347 596864.7 2523.6688 Jan 8 -5834.688 596923.7 4314.9438 Feb 8 7693.642 596918.7 7504.7027 Mar 8 23637.349 596913.6 7681.0856 Apr 8 35323.346 596758.7 -3198.0197 May 8 26193.342 596603.8 -2062.1246 Jun 8 -26494.263 596236.8 -714.5596 Jul 8 -29214.170 595869.9 800.3065 Aug 8 -18444.241 595352.6 -3808.3820 Sep 8 -11267.316 594835.4 859.9332 Oct 8 -1962.525 593666.5 -2324.9638 Nov 8 2616.867 592497.6 -4249.4616 Dec 8 -2247.347 590433.8 7267.5612 Jan 9 -5834.688 588370.0 11631.7117 Feb 9 7693.642 585763.9 17866.4561 Mar 9 23637.349 583157.8 5817.8247 Apr 9 35323.346 580197.7 -4758.0876 May 9 26193.342 577237.7 -9900.9996 Jun 9 -26494.263 573861.4 -4645.0907 Jul 9 -29214.170 570485.1 -4608.8808 Aug 9 -18444.241 567317.9 -5274.6090 Sep 9 -11267.316 564150.6 2448.6665 Oct 9 -1962.525 561630.0 1186.5248 Nov 9 2616.867 559109.4 598.7824 Dec 9 -2247.347 556504.0 531.3815 Jan 10 -5834.688 553898.6 -719.8917 Feb 10 7693.642 550686.4 7083.9751 Mar 10 23637.349 547474.2 6880.4659 Apr 10 35323.346 543750.5 640.1330 May 10 26193.342 540026.9 3102.8004 Jun 10 -26494.263 536299.7 -2834.4479 Jul 10 -29214.170 532572.6 -2501.3952 Aug 10 -18444.241 528812.7 -1241.4194 Sep 10 -11267.316 525052.8 -3852.4400 Oct 10 -1962.525 521259.0 -2287.5038 Nov 10 2616.867 517465.3 -918.1684 Dec 10 -2247.347 513684.0 801.3866 Jan 11 -5834.688 509902.6 5171.0693 > m$win s t l 1211 19 13 > m$deg s t l 0 1 1 > m$jump s t l 122 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/fisher/rcomp/tmp/1a0t01355676814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m,main=main) > dev.off() null device 1 > mylagmax <- nx/2 > postscript(file="/var/fisher/rcomp/tmp/2ir7u1355676814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow = c(2,2)) > acf(as.numeric(x),lag.max = mylagmax,main='Observed') > acf(as.numeric(m$time.series[,'trend']),na.action=na.pass,lag.max = mylagmax,main='Trend') > acf(as.numeric(m$time.series[,'seasonal']),na.action=na.pass,lag.max = mylagmax,main='Seasonal') > acf(as.numeric(m$time.series[,'remainder']),na.action=na.pass,lag.max = mylagmax,main='Remainder') > par(op) > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/333pi1355676814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow = c(2,2)) > spectrum(as.numeric(x),main='Observed') > spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend') > spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal') > spectrum(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder') > par(op) > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/43xo91355676814.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow = c(2,2)) > cpgram(as.numeric(x),main='Observed') > cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'trend']),'trend']),main='Trend') > cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'seasonal']),'seasonal']),main='Seasonal') > cpgram(as.numeric(m$time.series[!is.na(m$time.series[,'remainder']),'remainder']),main='Remainder') > par(op) > dev.off() null device 1 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Seasonal Decomposition by Loess - Parameters',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Component',header=TRUE) > a<-table.element(a,'Window',header=TRUE) > a<-table.element(a,'Degree',header=TRUE) > a<-table.element(a,'Jump',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Seasonal',header=TRUE) > a<-table.element(a,m$win['s']) > a<-table.element(a,m$deg['s']) > a<-table.element(a,m$jump['s']) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Trend',header=TRUE) > a<-table.element(a,m$win['t']) > a<-table.element(a,m$deg['t']) > a<-table.element(a,m$jump['t']) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Low-pass',header=TRUE) > a<-table.element(a,m$win['l']) > a<-table.element(a,m$deg['l']) > a<-table.element(a,m$jump['l']) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/5cwbb1355676814.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Seasonal Decomposition by Loess - Time Series Components',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,'Fitted',header=TRUE) > a<-table.element(a,'Seasonal',header=TRUE) > a<-table.element(a,'Trend',header=TRUE) > a<-table.element(a,'Remainder',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,x[i]+m$time.series[i,'remainder']) + a<-table.element(a,m$time.series[i,'seasonal']) + a<-table.element(a,m$time.series[i,'trend']) + a<-table.element(a,m$time.series[i,'remainder']) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/6iyy31355676814.tab") > > try(system("convert tmp/1a0t01355676814.ps tmp/1a0t01355676814.png",intern=TRUE)) character(0) > try(system("convert tmp/2ir7u1355676814.ps tmp/2ir7u1355676814.png",intern=TRUE)) character(0) > try(system("convert tmp/333pi1355676814.ps tmp/333pi1355676814.png",intern=TRUE)) character(0) > try(system("convert tmp/43xo91355676814.ps tmp/43xo91355676814.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.809 0.715 3.516