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(3464,2582,3015,2629,1881,2654,2518,1612,1631,1980,2320,988,3395,3017,3631,2570,2403,2465,1711,1541,1751,2103,1410,823,3471,2207,2483,2334,2273,2247,1667,1692,1779,2000,1934,851,3314,3178,3360,2787,2474,2563,2528,1649,1902,2141,1471,1178,3038,2633,2636,2708,2252,2579,2321,1490,2076,2333,1566,961,3683,2904,3097,3269,2491,2692,2293,1994,2069,2540,2091,1109,4761,3051,3737,3505,2837,3419,2658,2133,2276,2403,1975,996,4505,3890,4352,3288,3314,2830,2414,2049,1981,2527,1813,926,4277,3301,3773,3175,3045,2933,2544,2324,2229,2844,2175,1055) > 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 1344.52855 2052.612 66.859046 Feb 1 541.62184 2088.509 -48.130553 Mar 1 901.60377 2124.405 -11.008791 Apr 1 471.46820 2158.790 -1.258447 May 1 99.55451 2193.175 -411.729978 Jun 1 251.83216 2225.630 176.537616 Jul 1 -167.00130 2258.085 426.916327 Aug 1 -636.38595 2290.527 -42.141142 Sep 1 -507.99260 2322.969 -183.976601 Oct 1 -162.81861 2346.652 -203.833634 Nov 1 -627.97800 2370.335 577.642716 Dec 1 -1508.43279 2364.633 131.799433 Jan 2 1344.52855 2358.931 -308.459972 Feb 2 541.62184 2338.862 136.516216 Mar 2 901.60377 2318.792 410.603766 Apr 2 471.46820 2297.363 -198.831174 May 2 99.55451 2275.933 27.512011 Jun 2 251.83216 2247.303 -34.135280 Jul 2 -167.00130 2218.673 -340.671453 Aug 2 -636.38595 2179.516 -2.130429 Sep 2 -507.99260 2140.360 118.632605 Oct 2 -162.81861 2103.447 162.371817 Nov 2 -627.97800 2066.534 -28.555589 Dec 2 -1508.43279 2047.270 284.163157 Jan 3 1344.52855 2028.006 98.465780 Feb 3 541.62184 2022.941 -357.563275 Mar 3 901.60377 2017.877 -436.480969 Apr 3 471.46820 2026.388 -163.856264 May 3 99.55451 2034.899 138.546566 Jun 3 251.83216 2062.455 -67.287052 Jul 3 -167.00130 2090.011 -256.009554 Aug 3 -636.38595 2135.856 192.529516 Sep 3 -507.99260 2181.702 105.290596 Oct 3 -162.81861 2225.964 -63.145147 Nov 3 -627.97800 2270.226 291.752493 Dec 3 -1508.43279 2302.312 57.121108 Jan 4 1344.52855 2334.398 -364.926398 Feb 4 541.62184 2353.565 282.812697 Mar 4 901.60377 2372.733 85.663155 Apr 4 471.46820 2376.416 -60.883837 May 4 99.55451 2380.098 -5.652704 Jun 4 251.83216 2369.302 -58.134533 Jul 4 -167.00130 2358.507 336.494756 Aug 4 -636.38595 2329.937 -44.550754 Sep 4 -507.99260 2301.367 108.625747 Oct 4 -162.81861 2268.934 34.884595 Nov 4 -627.97800 2236.501 -137.523174 Dec 4 -1508.43279 2217.494 468.939118 Jan 5 1344.52855 2198.486 -505.014712 Feb 5 541.62184 2194.925 -103.547140 Mar 5 901.60377 2191.364 -456.968205 Apr 5 471.46820 2203.369 33.162382 May 5 99.55451 2215.374 -62.928907 Jun 5 251.83216 2239.485 87.683238 Jul 5 -167.00130 2263.595 224.406500 Aug 5 -636.38595 2294.918 -168.532317 Sep 5 -507.99260 2326.242 257.750876 Oct 5 -162.81861 2352.163 143.655708 Nov 5 -627.97800 2378.084 -184.106078 Dec 5 -1508.43279 2393.216 76.217211 Jan 6 1344.52855 2408.347 -69.875622 Feb 6 541.62184 2423.350 -60.972331 Mar 6 901.60377 2438.354 -242.957677 Apr 6 471.46820 2461.255 336.276583 May 6 99.55451 2484.157 -92.711032 Jun 6 251.83216 2522.360 -82.191713 Jul 6 -167.00130 2560.563 -100.561276 Aug 6 -636.38595 2601.946 28.440276 Sep 6 -507.99260 2643.329 -66.336162 Oct 6 -162.81861 2682.379 20.439786 Nov 6 -627.97800 2721.429 -2.450882 Dec 6 -1508.43279 2757.811 -140.377725 Jan 7 1344.52855 2794.192 622.279310 Feb 7 541.62184 2816.619 -307.240787 Mar 7 901.60377 2839.046 -3.649523 Apr 7 471.46820 2837.500 196.031890 May 7 99.55451 2835.954 -98.508573 Jun 7 251.83216 2829.368 337.800172 Jul 7 -167.00130 2822.781 2.220035 Aug 7 -636.38595 2836.074 -66.687918 Sep 7 -507.99260 2849.366 -65.373861 Oct 7 -162.81861 2868.919 -303.100585 Nov 7 -627.97800 2888.472 -285.493927 Dec 7 -1508.43279 2891.064 -386.630743 Jan 8 1344.52855 2893.655 266.816318 Feb 8 541.62184 2887.290 461.088135 Mar 8 901.60377 2880.925 569.471314 Apr 8 471.46820 2866.469 -49.937658 May 8 99.55451 2852.014 362.431494 Jun 8 251.83216 2821.498 -243.330624 Jul 8 -167.00130 2790.983 -209.981625 Aug 8 -636.38595 2752.995 -67.608567 Sep 8 -507.99260 2715.006 -226.013500 Oct 8 -162.81861 2697.852 -8.033588 Nov 8 -627.97800 2680.698 -239.720293 Dec 8 -1508.43279 2687.517 -253.084611 Jan 9 1344.52855 2694.337 238.134948 Feb 9 541.62184 2715.354 44.024121 Mar 9 901.60377 2736.372 135.024657 Apr 9 471.46820 2751.091 -47.559181 May 9 99.55451 2765.810 179.635106 Jun 9 251.83216 2774.572 -93.403884 Jul 9 -167.00130 2783.333 -72.331756 Aug 9 -636.38595 2790.162 170.223946 Sep 9 -507.99260 2796.991 -59.998342 Oct 9 -162.81861 2802.372 204.446470 Nov 9 -627.97800 2807.753 -4.775336 Dec 9 -1508.43279 2811.732 -248.299474 > m$win s t l 1081 19 13 > m$deg s t l 0 1 1 > m$jump s t l 109 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/fisher/rcomp/tmp/1ihty1355413952.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/2kt1m1355413952.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/3a3nn1355413952.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/4dxru1355413952.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/5lit21355413952.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/6fomf1355413952.tab") > > try(system("convert tmp/1ihty1355413952.ps tmp/1ihty1355413952.png",intern=TRUE)) character(0) > try(system("convert tmp/2kt1m1355413952.ps tmp/2kt1m1355413952.png",intern=TRUE)) character(0) > try(system("convert tmp/3a3nn1355413952.ps tmp/3a3nn1355413952.png",intern=TRUE)) character(0) > try(system("convert tmp/4dxru1355413952.ps tmp/4dxru1355413952.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.633 0.645 3.265