R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(26.663 + ,23.598 + ,26.931 + ,24.740 + ,25.806 + ,24.364 + ,24.477 + ,23.901 + ,23.175 + ,23.227 + ,21.672 + ,21.870 + ,21.439 + ,21.089 + ,23.709 + ,21.669 + ,21.752 + ,20.761 + ,23.479 + ,23.824 + ,23.105 + ,23.110 + ,21.759 + ,22.073 + ,21.937 + ,20.035 + ,23.590 + ,21.672 + ,22.222 + ,22.123 + ,23.950 + ,23.504 + ,22.238 + ,23.142 + ,21.059 + ,21.573 + ,21.548 + ,20.000 + ,22.424 + ,20.615 + ,21.761 + ,22.874 + ,24.104 + ,23.748 + ,23.262 + ,22.907 + ,21.519 + ,22.025 + ,22.604 + ,20.894 + ,24.677 + ,23.673 + ,25.320 + ,23.583 + ,24.671 + ,24.454 + ,24.122 + ,24.252 + ,22.084 + ,22.991 + ,23.287 + ,23.049 + ,25.076 + ,24.037 + ,24.430 + ,24.667 + ,26.451 + ,25.618 + ,25.014 + ,25.110 + ,22.964 + ,23.981 + ,23.798 + ,22.270 + ,24.775 + ,22.646 + ,23.988 + ,24.737 + ,26.276 + ,25.816 + ,25.210 + ,25.199 + ,23.162 + ,24.707 + ,24.364 + ,22.644 + ,25.565 + ,24.062 + ,25.431 + ,24.635 + ,27.009 + ,26.606 + ,26.268 + ,26.462 + ,25.246 + ,25.180 + ,24.657 + ,23.304 + ,26.982 + ,26.199 + ,27.210 + ,26.122 + ,26.706 + ,26.878 + ,26.152 + ,26.379 + ,24.712 + ,25.688 + ,24.990 + ,24.239 + ,26.721 + ,23.475 + ,24.767 + ,26.219 + ,28.361 + ,28.599 + ,27.914 + ,27.784 + ,25.693 + ,26.881 + ,26.217 + ,24.218 + ,27.914 + ,26.975 + ,28.527 + ,27.139 + ,28.982 + ,28.169 + ,28.056 + ,29.136 + ,26.291 + ,26.987 + ,26.589 + ,24.848 + ,27.543 + ,26.896 + ,28.878 + ,27.390 + ,28.065 + ,28.141 + ,29.048 + ,28.484 + ,26.634 + ,27.735 + ,27.132 + ,24.924 + ,28.963 + ,26.589 + ,27.931 + ,28.009 + ,29.229 + ,28.759 + ,28.405 + ,27.945 + ,25.912 + ,26.619 + ,26.076 + ,25.286 + ,27.660 + ,25.951 + ,26.398 + ,25.565 + ,28.865 + ,30.000 + ,29.261 + ,29.012 + ,26.992 + ,27.897) > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '12' > main = 'Seasonal Decomposition by Loess' > #'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 -0.6434274 26.53282 0.7736051527 Feb 1 -2.1371410 26.11345 -0.3783113276 Mar 1 0.8716451 25.69408 0.3652725397 Apr 1 -0.8054689 25.29487 0.2505942245 May 1 0.2712028 24.89567 0.6391302125 Jun 1 -0.1817308 24.51802 0.0277121005 Jul 1 1.4131922 24.14037 -1.0765626353 Aug 1 1.2202346 23.77470 -1.0939302553 Sep 1 0.7287774 23.40902 -0.9627982002 Oct 1 0.7814986 23.10814 -0.6626395368 Nov 1 -1.1207089 22.80726 -0.0145520992 Dec 1 -0.3980735 22.62753 -0.3594580681 Jan 2 -0.6434274 22.44780 -0.3653745927 Feb 2 -2.1371410 22.37464 0.8515005042 Mar 2 0.8716451 22.30148 0.5358759486 Apr 2 -0.8054689 22.28716 0.1873104341 May 2 0.2712028 22.27284 -0.7920407771 Jun 2 -0.1817308 22.27073 -1.3280029842 Jul 2 1.4131922 22.26863 -0.2028218152 Aug 2 1.2202346 22.27383 0.3299339394 Sep 2 0.7287774 22.27903 0.0971893690 Oct 2 0.7814986 22.30820 0.0202993396 Nov 2 -1.1207089 22.33737 0.5423380843 Dec 2 -0.3980735 22.37609 0.0949817886 Jan 3 -0.6434274 22.41481 0.1656149373 Feb 3 -2.1371410 22.40449 -0.2323473633 Mar 3 0.8716451 22.39416 0.3241906836 Apr 3 -0.8054689 22.35651 0.1209593295 May 3 0.2712028 22.31885 -0.3680577212 Jun 3 -0.1817308 22.27861 0.0261192918 Jul 3 1.4131922 22.23837 0.2984396808 Aug 3 1.2202346 22.19521 0.0885578292 Sep 3 0.7287774 22.15205 -0.6428243473 Oct 3 0.7814986 22.10374 0.2567584251 Nov 3 -1.1207089 22.05544 0.1242699717 Dec 3 -0.3980735 22.04743 -0.0763573057 Jan 4 -0.6434274 22.03942 0.1520048611 Feb 4 -2.1371410 22.06738 0.0697646106 Mar 4 0.8716451 22.09533 -0.5429752923 Apr 4 -0.8054689 22.13503 -0.7145633928 May 4 0.2712028 22.17473 -0.6849371900 Jun 4 -0.1817308 22.23387 0.8218611318 Jul 4 1.4131922 22.29300 0.3978028296 Aug 4 1.2202346 22.41318 0.1145834076 Sep 4 0.7287774 22.53336 -0.0001363394 Oct 4 0.7814986 22.71256 -0.5870592822 Nov 4 -1.1207089 22.89176 -0.2520534509 Dec 4 -0.3980735 23.04366 -0.6205822455 Jan 5 -0.6434274 23.19555 0.0518784042 Feb 5 -2.1371410 23.30071 -0.2695682382 Mar 5 0.8716451 23.40587 0.3994854669 Apr 5 -0.8054689 23.48424 0.9942239193 May 5 0.2712028 23.56262 1.4861766750 Jun 5 -0.1817308 23.61892 0.1458076661 Jul 5 1.4131922 23.67523 -0.4174179668 Aug 5 1.2202346 23.71849 -0.4847289806 Sep 5 0.7287774 23.76176 -0.3685403193 Oct 5 0.7814986 23.80247 -0.3319711435 Nov 5 -1.1207089 23.84318 -0.6384731935 Dec 5 -0.3980735 23.92544 -0.5363700611 Jan 6 -0.6434274 24.00770 -0.0772774843 Feb 6 -2.1371410 24.12090 1.0652398107 Mar 6 0.8716451 24.23410 -0.0297425467 Apr 6 -0.8054689 24.31810 0.5243668637 May 6 0.2712028 24.40211 -0.2433094225 Jun 6 -0.1817308 24.43821 0.4105241409 Jul 6 1.4131922 24.47431 0.5635010802 Aug 6 1.2202346 24.45223 -0.0544692109 Sep 6 0.7287774 24.43016 -0.1449398270 Oct 6 0.7814986 24.37555 -0.0470484721 Nov 6 -1.1207089 24.32094 -0.2362283431 Dec 6 -0.3980735 24.28819 0.0908868683 Jan 7 -0.6434274 24.25544 0.1859915241 Feb 7 -2.1371410 24.25937 0.1477666339 Mar 7 0.8716451 24.26331 -0.3599579088 Apr 7 -0.8054689 24.28771 -0.8362438832 May 7 0.2712028 24.31211 -0.5953155542 Jun 7 -0.1817308 24.35503 0.5636977853 Jul 7 1.4131922 24.39795 0.4648545008 Aug 7 1.2202346 24.46433 0.1314395887 Sep 7 0.7287774 24.53070 -0.0494756483 Oct 7 0.7814986 24.60384 -0.1863411919 Nov 7 -1.1207089 24.67699 -0.3942779613 Dec 7 -0.3980735 24.73498 0.3700968172 Jan 8 -0.6434274 24.79297 0.2144610400 Feb 8 -2.1371410 24.86344 -0.0823037354 Mar 8 0.8716451 24.93392 -0.2405681631 Apr 8 -0.8054689 25.03205 -0.1645786926 May 8 0.2712028 25.13017 0.0296250812 Jun 8 -0.1817308 25.21731 -0.4005779366 Jul 8 1.4131922 25.30445 0.2913624216 Aug 8 1.2202346 25.39100 -0.0052327952 Sep 8 0.7287774 25.47755 0.0616716631 Oct 8 0.7814986 25.59435 0.0861491584 Nov 8 -1.1207089 25.71115 0.6555554279 Dec 8 -0.3980735 25.80430 -0.2262290788 Jan 9 -0.6434274 25.89745 -0.5970241411 Feb 9 -2.1371410 25.92557 -0.4844274707 Mar 9 0.8716451 25.95369 0.1566695473 Apr 9 -0.8054689 25.94971 1.0547576429 May 9 0.2712028 25.94574 0.9930600419 Jun 9 -0.1817308 25.94682 0.3569076000 Jul 9 1.4131922 25.94791 -0.6551014659 Aug 9 1.2202346 25.92560 -0.2678360471 Sep 9 0.7287774 25.90329 -0.4800709533 Oct 9 0.7814986 25.81810 -0.2206002274 Nov 9 -1.1207089 25.73291 0.0997992727 Dec 9 -0.3980735 25.70969 0.3763865763 Jan 10 -0.6434274 25.68646 -0.0530366758 Feb 10 -2.1371410 25.77587 0.6002696353 Mar 10 0.8716451 25.86528 -0.0159237059 Apr 10 -0.8054689 25.98661 -1.7061362925 May 10 0.2712028 26.10793 -1.6121345758 Jun 10 -0.1817308 26.22087 0.1798620374 Jul 10 1.4131922 26.33381 0.6140020266 Aug 10 1.2202346 26.46345 0.9153195771 Sep 10 0.7287774 26.59309 0.5921368026 Oct 10 0.7814986 26.75765 0.2448554678 Nov 10 -1.1207089 26.92221 -0.1084970928 Dec 10 -0.3980735 27.03666 0.2424158877 Jan 11 -0.6434274 27.15111 -0.2906816875 Feb 11 -2.1371410 27.19562 -0.8404772049 Mar 11 0.8716451 27.24013 -0.1977723747 Apr 11 -0.8054689 27.29005 0.4904163504 May 11 0.2712028 27.33998 0.9158193787 Jun 11 -0.1817308 27.38747 -0.0667370615 Jul 11 1.4131922 27.43496 0.1338498743 Aug 11 1.2202346 27.44391 -0.4951421696 Sep 11 0.7287774 27.45286 -0.1256345384 Oct 11 0.7814986 27.44633 0.9081729960 Nov 11 -1.1207089 27.43980 -0.0280906955 Dec 11 -0.3980735 27.43412 -0.0490454212 Jan 12 -0.6434274 27.42844 -0.1960107026 Feb 12 -2.1371410 27.42871 -0.4435669128 Mar 12 0.8716451 27.42898 -0.7576227753 Apr 12 -0.8054689 27.44191 0.2595563645 May 12 0.2712028 27.45485 1.1519498075 Jun 12 -0.1817308 27.49835 0.0733852665 Jul 12 1.4131922 27.54184 -0.8900358985 Aug 12 1.2202346 27.58025 -0.6594852114 Sep 12 0.7287774 27.61866 0.7005651509 Oct 12 0.7814986 27.63532 0.0671819406 Nov 12 -1.1207089 27.65198 0.1027275046 Dec 12 -0.3980735 27.67418 0.4588943046 Jan 13 -0.6434274 27.69638 0.0790505489 Feb 13 -2.1371410 27.71336 -0.6522143981 Mar 13 0.8716451 27.73033 0.3610210024 Apr 13 -0.8054689 27.69485 -0.3003814447 May 13 0.2712028 27.65937 0.0004304115 Jun 13 -0.1817308 27.60067 0.5900648104 Jul 13 1.4131922 27.54197 0.2738425853 Aug 13 1.2202346 27.47765 0.0611164408 Sep 13 0.7287774 27.41333 0.2628899713 Oct 13 0.7814986 27.31663 -0.1531247520 Nov 13 -1.1207089 27.21992 -0.1872107012 Dec 13 -0.3980735 27.12426 -0.1071867977 Jan 14 -0.6434274 27.02860 -0.3091734497 Feb 14 -2.1371410 27.02886 0.3942802614 Mar 14 0.8716451 27.02912 -0.2407656799 Apr 14 -0.8054689 27.16552 -0.4090557007 May 14 0.2712028 27.30193 -1.1751314181 Jun 14 -0.1817308 27.42748 -1.6807445871 Jul 14 1.4131922 27.55302 -0.1012143799 Aug 14 1.2202346 27.69044 1.0893300811 Sep 14 0.7287774 27.82785 0.7043742172 Oct 14 0.7814986 27.98289 0.2476133726 Nov 14 -1.1207089 28.13793 -0.0252186977 Dec 14 -0.3980735 28.30323 -0.0081593443 > m$win s t l 1681 19 13 > m$deg s t l 0 1 1 > m$jump s t l 169 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/wessaorg/rcomp/tmp/1bcy41322918321.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/wessaorg/rcomp/tmp/27qcf1322918321.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/wessaorg/rcomp/tmp/3eaaq1322918321.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/wessaorg/rcomp/tmp/4rz6f1322918321.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/58c2y1322918321.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/wessaorg/rcomp/tmp/6nr511322918321.tab") > > try(system("convert tmp/1bcy41322918321.ps tmp/1bcy41322918321.png",intern=TRUE)) character(0) > try(system("convert tmp/27qcf1322918321.ps tmp/27qcf1322918321.png",intern=TRUE)) character(0) > try(system("convert tmp/3eaaq1322918321.ps tmp/3eaaq1322918321.png",intern=TRUE)) character(0) > try(system("convert tmp/4rz6f1322918321.ps tmp/4rz6f1322918321.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.993 0.260 2.317