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(236.422 + ,250.580 + ,279.515 + ,264.417 + ,283.706 + ,281.288 + ,271.146 + ,283.944 + ,269.155 + ,270.899 + ,276.507 + ,319.957 + ,250.746 + ,247.772 + ,280.449 + ,274.925 + ,296.013 + ,287.881 + ,279.098 + ,294.763 + ,261.924 + ,291.596 + ,287.537 + ,326.201 + ,255.598 + ,253.086 + ,285.261 + ,284.747 + ,300.402 + ,288.854 + ,295.433 + ,307.256 + ,273.189 + ,287.540 + ,290.705 + ,337.006 + ,268.335 + ,259.060 + ,293.703 + ,294.262 + ,312.404 + ,301.014 + ,309.942 + ,317.079 + ,293.912 + ,304.060 + ,301.299 + ,357.634 + ,281.493 + ,282.478 + ,319.111 + ,315.223 + ,328.445 + ,321.081 + ,328.040 + ,326.362 + ,313.566 + ,319.768 + ,324.315 + ,387.243 + ,293.308 + ,295.109 + ,339.190 + ,335.678 + ,345.401 + ,351.002 + ,351.889 + ,355.773 + ,333.363 + ,336.214 + ,343.910 + ,405.788 + ,318.682 + ,314.189 + ,362.141 + ,351.811 + ,373.727 + ,366.795 + ,362.393 + ,376.006 + ,346.423 + ,349.007 + ,357.224 + ,418.473 + ,329.169 + ,323.456 + ,374.439 + ,358.806 + ,391.816 + ,376.944 + ,372.665 + ,388.357 + ,354.241 + ,368.982 + ,378.233 + ,426.699 + ,343.241 + ,344.577 + ,373.623 + ,369.688 + ,398.816 + ,379.387 + ,384.666 + ,383.879 + ,351.578 + ,350.920 + ,336.629 + ,385.504 + ,311.330 + ,300.545 + ,329.718 + ,331.023 + ,348.944 + ,345.650 + ,349.260 + ,354.597 + ,325.769 + ,339.734 + ,340.543 + ,401.585 + ,315.998 + ,312.327 + ,362.217 + ,358.067 + ,367.321 + ,360.372 + ,363.830 + ,364.525 + ,347.945 + ,357.404 + ,368.182 + ,429.343) > par8 = 'FALSE' > par7 = '1' > par6 = '' > par5 = '1' > par4 = '' > par3 = '0' > par2 = 'periodic' > par1 = '12' > main = 'Seasonal Decomposition by Loess' > 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 -32.279461 272.8946 -4.19315735 Feb 1 -34.928653 273.1330 12.37567752 Mar 1 2.179523 273.3713 3.96414314 Apr 1 -3.999040 273.6886 -5.27252275 May 1 14.283125 274.0058 -4.58291655 Jun 1 5.801663 274.3476 1.13872706 Jul 1 5.940295 274.6894 -9.48372378 Aug 1 12.986933 274.9874 -4.03030974 Sep 1 -13.207796 275.2853 7.07746989 Oct 1 -4.430308 275.8799 -0.55062778 Nov 1 -2.570909 276.4745 2.60336334 Dec 1 50.224630 277.2091 -7.47676847 Jan 2 -32.279461 277.9437 5.08173000 Feb 2 -34.928653 278.4762 4.22441988 Mar 2 2.179523 279.0087 -0.73925949 Apr 2 -3.999040 279.6239 -0.69986555 May 2 14.283125 280.2391 1.49080047 Jun 2 5.801663 280.9088 1.17056171 Jul 2 5.940295 281.5785 -8.42077151 Aug 2 12.986933 282.1303 -0.35426143 Sep 2 -13.207796 282.6822 -7.55038575 Oct 2 -4.430308 283.2735 12.75284167 Nov 2 -2.570909 283.8648 6.24315787 Dec 2 50.224630 284.5245 -8.54812700 Jan 3 -32.279461 285.1842 2.69321842 Feb 3 -34.928653 285.8230 2.19162721 Mar 3 2.179523 286.4618 -3.38033324 Apr 3 -3.999040 286.9389 1.80712605 May 3 14.283125 287.4160 -1.29714259 Jun 3 5.801663 288.0365 -4.98412371 Jul 3 5.940295 288.6569 0.83580071 Aug 3 12.986933 289.4287 4.84041042 Sep 3 -13.207796 290.2004 -3.80361427 Oct 3 -4.430308 291.0584 0.91186946 Nov 3 -2.570909 291.9165 1.35944197 Dec 3 50.224630 292.8831 -6.10174639 Jan 4 -32.279461 293.8498 6.76469554 Feb 4 -34.928653 295.0128 -1.02414548 Mar 4 2.179523 296.1758 -4.65235574 Apr 4 -3.999040 297.4963 0.76470938 May 4 14.283125 298.8168 -0.69595343 Jun 4 5.801663 300.2539 -5.04152705 Jul 4 5.940295 301.6909 2.31080487 Aug 4 12.986933 303.3824 0.70970222 Sep 4 -13.207796 305.0738 2.04596517 Oct 4 -4.430308 306.8511 1.63922289 Nov 4 -2.570909 308.6283 -4.75843060 Dec 4 50.224630 310.1499 -2.74049344 Jan 5 -32.279461 311.6714 2.10107401 Feb 5 -34.928653 313.0211 4.38559226 Mar 5 2.179523 314.3707 2.56074127 Apr 5 -3.999040 315.8681 3.35390153 May 5 14.283125 317.3655 -3.20366613 Jun 5 5.801663 318.9364 -3.65707981 Jul 5 5.940295 320.5073 1.59241206 Aug 5 12.986933 322.0123 -8.63718651 Sep 5 -13.207796 323.5172 3.25658051 Oct 5 -4.430308 325.2202 -1.02185336 Nov 5 -2.570909 326.9231 -0.03719846 Dec 5 50.224630 328.9402 8.07813880 Jan 6 -32.279461 330.9574 -5.36989365 Feb 6 -34.928653 332.9291 -2.89145819 Mar 6 2.179523 334.9009 2.10960803 Apr 6 -3.999040 336.6219 3.05515854 May 6 14.283125 338.3429 -7.22501888 Jun 6 5.801663 340.0201 5.18020063 Jul 6 5.940295 341.6974 4.25132568 Aug 6 12.986933 343.4435 -0.65740854 Sep 6 -13.207796 345.1896 1.38122283 Oct 6 -4.430308 346.8644 -6.22008749 Nov 6 -2.570909 348.5392 -2.05830901 Dec 6 50.224630 350.0962 5.46715599 Jan 7 -32.279461 351.6532 -0.69174873 Feb 7 -34.928653 353.0245 -3.90688380 Mar 7 2.179523 354.3959 5.56561189 Apr 7 -3.999040 355.5477 0.26238577 May 7 14.283125 356.6994 2.74443172 Jun 7 5.801663 357.6148 3.37851953 Jul 7 5.940295 358.5302 -2.07748712 Aug 7 12.986933 359.3315 3.68757014 Sep 7 -13.207796 360.1328 -0.50200700 Oct 7 -4.430308 361.0107 -7.57337886 Nov 7 -2.570909 361.8886 -2.09366194 Dec 7 50.224630 362.9204 5.32797026 Jan 8 -32.279461 363.9522 -2.50376726 Feb 8 -34.928653 365.0699 -6.68522969 Mar 8 2.179523 366.1875 6.07193863 Apr 8 -3.999040 367.4238 -4.61879789 May 8 14.283125 368.6601 8.87273767 Jun 8 5.801663 369.8825 1.25979237 Jul 8 5.940295 371.1050 -4.38024738 Aug 8 12.986933 372.0779 3.29218173 Sep 8 -13.207796 373.0508 -5.60202356 Oct 8 -4.430308 373.7149 -0.30254605 Nov 8 -2.570909 374.3789 6.42502024 Dec 8 50.224630 374.8815 1.59291145 Jan 9 -32.279461 375.3840 0.13643295 Feb 9 -34.928653 375.3447 4.16091312 Mar 9 2.179523 375.3055 -3.86197595 Apr 9 -3.999040 373.8098 -0.12276780 May 9 14.283125 372.3142 12.21871243 Jun 9 5.801663 369.4054 4.17990077 Jul 9 5.940295 366.4967 12.22899464 Aug 9 12.986933 362.8006 8.09151271 Sep 9 -13.207796 359.1044 5.68139637 Oct 9 -4.430308 355.1481 0.20222792 Nov 9 -2.570909 351.1918 -11.99185174 Dec 9 50.224630 347.7132 -12.43378350 Jan 10 -32.279461 344.2345 -0.62508498 Feb 10 -34.928653 342.0307 -6.55702904 Mar 10 2.179523 339.8268 -12.28834234 Apr 10 -3.999040 339.2122 -4.19017519 May 10 14.283125 338.5976 -3.93673597 Jun 10 5.801663 339.2848 0.56355957 Jul 10 5.940295 339.9719 3.34776065 Aug 10 12.986933 341.4343 0.17571992 Sep 10 -13.207796 342.8968 -3.91995522 Oct 10 -4.430308 344.7107 -0.54640070 Nov 10 -2.570909 346.5247 -3.41075739 Dec 10 50.224630 348.0852 3.27519548 Jan 11 -32.279461 349.6457 -1.36822137 Feb 11 -34.928653 351.0295 -3.77385072 Mar 11 2.179523 352.4133 7.62415069 Apr 11 -3.999040 354.1527 7.91336587 May 11 14.283125 355.8920 -2.85414688 Jun 11 5.801663 357.8624 -3.29202604 Jul 11 5.940295 359.8327 -1.94299965 Aug 11 12.986933 361.7673 -10.22921607 Sep 11 -13.207796 363.7019 -2.54906690 Oct 11 -4.430308 365.6349 -3.80060468 Nov 11 -2.570909 367.5680 3.18494632 Dec 11 50.224630 369.5494 9.56899290 > 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/1aktk1352555897.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/2idc81352555897.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/3dzfd1352555897.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/495ao1352555897.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/5ee2h1352555897.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/6kne21352555897.tab") > > try(system("convert tmp/1aktk1352555897.ps tmp/1aktk1352555897.png",intern=TRUE)) character(0) > try(system("convert tmp/2idc81352555897.ps tmp/2idc81352555897.png",intern=TRUE)) character(0) > try(system("convert tmp/3dzfd1352555897.ps tmp/3dzfd1352555897.png",intern=TRUE)) character(0) > try(system("convert tmp/495ao1352555897.ps tmp/495ao1352555897.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.826 0.470 3.286