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(617,614,647,580,614,636,388,356,639,753,611,639,630,586,695,552,619,681,421,307,754,690,644,643,608,651,691,627,634,731,475,337,803,722,590,724,627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,706,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841,892,782,811,792,978,773,796,946,594,438,1023,868,791,760,779,852,1001,734,996,869,599,426,1138,1091,830,909) > 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 16.7764659 579.7245 20.49907786 Feb 1 10.3725107 581.4128 22.21466249 Mar 1 113.0594706 583.1012 -49.16066811 Apr 1 -15.6760033 584.7380 10.93804921 May 1 21.1338791 586.3747 6.49141025 Jun 1 112.7519240 587.7959 -64.54782912 Jul 1 -219.6301610 589.2171 18.41306138 Aug 1 -325.9050638 590.5925 91.31254815 Sep 1 165.0927130 591.9679 -118.06064454 Oct 1 103.1973651 593.2791 56.52352295 Nov 1 -0.2433772 594.5903 16.65308486 Dec 1 19.0702714 595.3187 24.61099245 Jan 2 16.7764659 596.0472 17.17635415 Feb 2 10.3725107 596.8631 -21.23562470 Mar 2 113.0594706 597.6790 -15.73851877 Apr 2 -15.6760033 598.6321 -30.95607448 May 2 21.1338791 599.5851 -1.71898647 Jun 2 112.7519240 600.6669 -32.41880461 Jul 2 -219.6301610 601.7487 38.88150713 Aug 2 -325.9050638 604.2121 28.69295117 Sep 2 165.0927130 606.6756 -17.76828425 Oct 2 103.1973651 609.3557 -22.55302240 Nov 2 -0.2433772 612.0357 32.20763386 Dec 2 19.0702714 614.9687 8.96101473 Jan 3 16.7764659 617.9017 -26.67815028 Feb 3 10.3725107 621.1470 19.48046928 Mar 3 113.0594706 624.3924 -46.45182638 Apr 3 -15.6760033 626.9937 15.68233403 May 3 21.1338791 629.5950 -16.72886183 Jun 3 112.7519240 632.0321 -13.78404684 Jul 3 -219.6301610 634.4693 60.16089804 Aug 3 -325.9050638 639.0151 23.88994563 Sep 3 165.0927130 643.5610 -5.65368623 Oct 3 103.1973651 648.0172 -29.21453272 Nov 3 -0.2433772 652.4734 -62.22998480 Dec 3 19.0702714 654.6131 50.31665079 Jan 4 16.7764659 656.7528 -46.52925950 Feb 4 10.3725107 658.1474 27.48012543 Mar 4 113.0594706 659.5419 52.39859513 Apr 4 -15.6760033 661.5286 31.14742549 May 4 21.1338791 663.5152 -28.64910043 Jun 4 112.7519240 663.5838 8.66431969 Jul 4 -219.6301610 663.6523 -32.02213030 Aug 4 -325.9050638 661.5176 16.38746550 Sep 4 165.0927130 659.3829 14.52438184 Oct 4 103.1973651 658.5871 -32.78451268 Nov 4 -0.2433772 657.7914 38.45198723 Dec 4 19.0702714 659.8133 -37.88357441 Jan 5 16.7764659 661.8352 16.38831807 Feb 5 10.3725107 663.1010 -35.47351495 Mar 5 113.0594706 664.3668 -15.42626320 Apr 5 -15.6760033 662.9659 -12.28987664 May 5 21.1338791 661.5650 38.30115364 Jun 5 112.7519240 660.9591 80.28901493 Jul 5 -219.6301610 660.3532 -22.72299389 Aug 5 -325.9050638 659.5058 33.39925554 Sep 5 165.0927130 658.6585 0.24882550 Oct 5 103.1973651 655.6672 -71.86461402 Nov 5 -0.2433772 652.6760 -51.43265911 Dec 5 19.0702714 648.5128 8.41692391 Jan 6 16.7764659 644.3496 78.87396105 Feb 6 10.3725107 641.2303 39.39716360 Mar 6 113.0594706 638.1111 -68.17054909 Apr 6 -15.6760033 635.7556 -26.07959113 May 6 21.1338791 633.4001 74.46601054 Jun 6 112.7519240 630.9978 -12.74971875 Jul 6 -219.6301610 628.5955 -22.96531816 Aug 6 -325.9050638 626.7287 30.17638058 Sep 6 165.0927130 624.8619 -83.95460014 Oct 6 103.1973651 624.5788 -12.77617179 Nov 6 -0.2433772 624.2957 32.94765098 Dec 6 19.0702714 624.3044 9.62537631 Jan 7 16.7764659 624.3130 0.91055575 Feb 7 10.3725107 626.9360 5.69152646 Mar 7 113.0594706 629.5589 -24.61841806 Apr 7 -15.6760033 633.5073 36.16873584 May 7 21.1338791 637.4556 -26.58946654 Jun 7 112.7519240 639.6852 -21.43713318 Jul 7 -219.6301610 641.9148 -30.28466992 Aug 7 -325.9050638 643.0276 26.87741778 Sep 7 165.0927130 644.1405 -17.23317398 Oct 7 103.1973651 646.7392 102.06342254 Nov 7 -0.2433772 649.3380 -0.09458651 Dec 7 19.0702714 655.4615 -45.53180868 Jan 8 16.7764659 661.5851 6.63842326 Feb 8 10.3725107 668.2647 -61.63723226 Mar 8 113.0594706 674.9443 -73.00380300 Apr 8 -15.6760033 682.0728 48.60317673 May 8 21.1338791 689.2013 -81.33519983 Jun 8 112.7519240 700.1437 103.10433432 Jul 8 -219.6301610 711.0862 39.54399835 Aug 8 -325.9050638 724.8035 -41.89845568 Sep 8 165.0927130 738.5209 13.38641082 Oct 8 103.1973651 749.1177 -24.31510375 Nov 8 -0.2433772 759.7146 -51.47122390 Dec 8 19.0702714 764.7789 74.15086733 Jan 9 16.7764659 769.8431 -11.61958732 Feb 9 10.3725107 772.6536 1.97391200 Mar 9 113.0594706 775.4640 117.47649609 Apr 9 -15.6760033 778.6245 26.05153079 May 9 21.1338791 781.7849 -68.91879079 Jun 9 112.7519240 783.1342 10.11386892 Jul 9 -219.6301610 784.4835 -32.85334149 Aug 9 -325.9050638 785.0420 -72.13693282 Sep 9 165.0927130 785.6005 40.30679638 Oct 9 103.1973651 787.5336 -49.73094818 Nov 9 -0.2433772 789.4667 102.77670169 Dec 9 19.0702714 793.5882 -30.65846333 Jan 10 16.7764659 797.7097 -3.48617423 Feb 10 10.3725107 800.5859 -18.95837039 Mar 10 113.0594706 803.4620 61.47851823 Apr 10 -15.6760033 803.3307 -14.65470951 May 10 21.1338791 803.1994 -28.33329352 Jun 10 112.7519240 801.1106 32.13743076 Jul 10 -219.6301610 799.0219 14.60828493 Aug 10 -325.9050638 798.8188 -34.91376215 Sep 10 165.0927130 798.6158 59.29151132 Oct 10 103.1973651 801.0060 -36.20340673 Nov 10 -0.2433772 803.3963 -12.15293035 Dec 10 19.0702714 805.9855 -65.05581019 Jan 11 16.7764659 808.5748 -46.35123592 Feb 11 10.3725107 813.1364 28.49105926 Mar 11 113.0594706 817.6981 70.24243922 Apr 11 -15.6760033 827.5359 -77.85992694 May 11 21.1338791 837.3738 137.49235062 Jun 11 112.7519240 846.5136 -90.26550692 Jul 11 -219.6301610 855.6534 -37.02323458 Aug 11 -325.9050638 864.5250 -112.61992937 Sep 11 165.0927130 873.3966 99.51069639 Oct 11 103.1973651 882.5076 105.29500848 Nov 11 -0.2433772 891.6187 -61.37528500 Dec 11 19.0702714 900.8917 -10.96198231 > m$win s t l 1321 19 13 > m$deg s t l 0 1 1 > m$jump s t l 133 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/fisher/rcomp/tmp/1jlm31352577991.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/2hotz1352577991.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/3tbpz1352577991.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/4ohj31352577991.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/5i0ey1352577991.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/69k3x1352577991.tab") > > try(system("convert tmp/1jlm31352577991.ps tmp/1jlm31352577991.png",intern=TRUE)) character(0) > try(system("convert tmp/2hotz1352577991.ps tmp/2hotz1352577991.png",intern=TRUE)) character(0) > try(system("convert tmp/3tbpz1352577991.ps tmp/3tbpz1352577991.png",intern=TRUE)) character(0) > try(system("convert tmp/4ohj31352577991.ps tmp/4ohj31352577991.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.833 0.504 3.316