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(655362,873127,1107897,1555964,1671159,1493308,2957796,2638691,1305669,1280496,921900,867888,652586,913831,1108544,1555827,1699283,1509458,3268975,2425016,1312703,1365498,934453,775019,651142,843192,1146766,1652601,1465906,1652734,2922334,2702805,1458956,1410363,1019279,936574,708917,885295,1099663,1576220,1487870,1488635,2882530,2677026,1404398,1344370,936865,872705,628151,953712,1160384,1400618,1661511,1495347,2918786,2775677,1407026,1370199,964526,850851,683118,847224,1073256,1514326,1503734,1507712,2865698,2788128,1391596,1366378,946295,859626) > 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 -794327.45 1461368 -1.167889e+04 Feb 1 -571497.80 1458573 -1.394855e+04 Mar 1 -341497.49 1455778 -6.383872e+03 Apr 1 84223.90 1453415 1.832514e+04 May 1 122422.04 1451052 9.768539e+04 Jun 1 65235.37 1449518 -2.144535e+04 Jul 1 1509914.28 1447984 -1.026842e+02 Aug 1 1208627.85 1446921 -1.685828e+04 Sep 1 -79028.31 1445858 -6.116113e+04 Oct 1 -102317.77 1445985 -6.317158e+04 Nov 1 -504097.56 1446112 -2.011469e+04 Dec 1 -597657.00 1452180 1.336544e+04 Jan 2 -794327.45 1458247 -1.133342e+04 Feb 2 -571497.80 1463090 2.223885e+04 Mar 2 -341497.49 1467933 -1.789155e+04 Apr 2 84223.90 1468633 2.969866e+03 May 2 122422.04 1469333 1.075275e+05 Jun 2 65235.37 1466122 -2.189913e+04 Jul 2 1509914.28 1462910 2.961506e+05 Aug 2 1208627.85 1459281 -2.428933e+05 Sep 2 -79028.31 1455653 -6.392154e+04 Oct 2 -102317.77 1452145 1.567098e+04 Nov 2 -504097.56 1448637 -1.008616e+04 Dec 2 -597657.00 1447258 -7.458160e+04 Jan 3 -794327.45 1445878 -4.090370e+02 Feb 3 -571497.80 1450839 -3.614919e+04 Mar 3 -341497.49 1455800 3.246398e+04 Apr 3 84223.90 1464830 1.035471e+05 May 3 122422.04 1473860 -1.303765e+05 Jun 3 65235.37 1481404 1.060946e+05 Jul 3 1509914.28 1488948 -7.652802e+04 Aug 3 1208627.85 1491878 2.298714e+03 Sep 3 -79028.31 1494809 4.317519e+04 Oct 3 -102317.77 1492313 2.036746e+04 Nov 3 -504097.56 1489818 3.355906e+04 Dec 3 -597657.00 1484002 5.022903e+04 Jan 4 -794327.45 1478186 2.505801e+04 Feb 4 -571497.80 1471349 -1.455641e+04 Mar 4 -341497.49 1464512 -2.335149e+04 Apr 4 84223.90 1458121 3.387529e+04 May 4 122422.04 1451730 -8.628169e+04 Jun 4 65235.37 1447857 -2.445699e+04 Jul 4 1509914.28 1443984 -7.136787e+04 Aug 4 1208627.85 1444149 2.424895e+04 Sep 4 -79028.31 1444315 3.911150e+04 Oct 4 -102317.77 1446692 -4.437283e+00 Nov 4 -504097.56 1449070 -8.107045e+03 Dec 4 -597657.00 1451928 1.843423e+04 Jan 5 -794327.45 1454786 -3.230749e+04 Feb 5 -571497.80 1457629 6.758118e+04 Mar 5 -341497.49 1460471 4.141019e+04 Apr 5 84223.90 1462600 -1.462063e+05 May 5 122422.04 1464729 7.435953e+04 Jun 5 65235.37 1465533 -3.542102e+04 Jul 5 1509914.28 1466336 -5.746415e+04 Aug 5 1208627.85 1464905 1.021441e+05 Sep 5 -79028.31 1463474 2.258006e+04 Oct 5 -102317.77 1460675 1.184185e+04 Nov 5 -504097.56 1457876 1.074798e+04 Dec 5 -597657.00 1453486 -4.978072e+03 Jan 6 -794327.45 1449097 2.834889e+04 Feb 6 -571497.80 1446368 -2.764575e+04 Mar 6 -341497.49 1443639 -2.888504e+04 Apr 6 84223.90 1445497 -1.539501e+04 May 6 122422.04 1447356 -6.604374e+04 Jun 6 65235.37 1448649 -6.172709e+03 Jul 6 1509914.28 1449943 -9.415927e+04 Aug 6 1208627.85 1451911 1.275890e+05 Sep 6 -79028.31 1453879 1.674493e+04 Oct 6 -102317.77 1456704 1.199201e+04 Nov 6 -504097.56 1459528 -9.135569e+03 Dec 6 -597657.00 1462778 -5.495138e+03 > m$win s t l 721 19 13 > m$deg s t l 0 1 1 > m$jump s t l 73 2 2 > m$inner [1] 2 > m$outer [1] 0 > postscript(file="/var/wessaorg/rcomp/tmp/12uzk1355669301.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/2kb531355669301.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/36hal1355669301.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/4403y1355669301.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/55kc91355669301.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/6ccgh1355669301.tab") > > try(system("convert tmp/12uzk1355669301.ps tmp/12uzk1355669301.png",intern=TRUE)) character(0) > try(system("convert tmp/2kb531355669301.ps tmp/2kb531355669301.png",intern=TRUE)) character(0) > try(system("convert tmp/36hal1355669301.ps tmp/36hal1355669301.png",intern=TRUE)) character(0) > try(system("convert tmp/4403y1355669301.ps tmp/4403y1355669301.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.423 0.381 2.822