Home » date » 2009 » Dec » 02 »

Decomposition by Loess

*The author of this computation has been verified*
R Software Module: /rwasp_decomposeloess.wasp (opens new window with default values)
Title produced by software: Decomposition by Loess
Date of computation: Wed, 02 Dec 2009 09:04:22 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g.htm/, Retrieved Wed, 02 Dec 2009 17:06:16 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g.htm/},
    year = {2009},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2009},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
108.5 112.3 116.6 115.5 120.1 132.9 128.1 129.3 132.5 131 124.9 120.8 122 122.1 127.4 135.2 137.3 135 136 138.4 134.7 138.4 133.9 133.6 141.2 151.8 155.4 156.6 161.6 160.7 156 159.5 168.7 169.9 169.9 185.9 190.8 195.8 211.9 227.1 251.3 256.7 251.9 251.2 270.3 267.2 243 229.9 187.2 178.2 175.2 192.4 187 184 194.1 212.7 217.5 200.5 205.9 196.5 206.3
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Seasonal Decomposition by Loess - Parameters
ComponentWindowDegreeJump
Seasonal611062
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
1108.5106.616586346720-9.32257333987597119.705986993156-1.88341365327980
2112.3116.362409333090-12.0994301058028120.3370207727134.06240933308976
3116.6120.487825661189-8.25588021345877120.9680545522703.88782566118854
4115.5111.108329569382-1.75485956626950121.646529996888-4.39167043061819
5120.1115.0888279160432.78616664245226122.325005441505-5.01117208395743
6132.9138.8472634115943.89856155029769123.0541750381095.94726341159357
7128.1130.4456995914491.97095577383823123.7833446347122.34569959144946
8129.3127.9236823047956.11190501533617124.564412679869-1.37631769520512
9132.5127.88165895893211.7728603160425125.345480725026-4.61834104106811
10131128.2634434993317.40939689610321126.327159604565-2.73655650066864
11124.9121.9852364131320.505925102762294127.308838484105-2.91476358686751
12120.8116.316481573231-3.02301281743951128.306531244209-4.48351842676941
13122124.018349335563-9.32257333987597129.3042240043132.01834933556339
14122.1126.274546987444-12.0994301058028130.0248831183594.17454698744385
15127.4132.310337981054-8.25588021345877130.7455422324054.91033798105352
16135.2140.824672739864-1.75485956626950131.3301868264065.6246727398636
17137.3139.8990019371412.78616664245226131.9148314204072.59900193714122
18135133.3429132955893.89856155029769132.758525154113-1.65708670441066
19136136.4268253383421.97095577383823133.6022188878190.426825338342383
20138.4135.4381194416756.11190501533617135.249975542989-2.96188055832468
21134.7120.72940748580011.7728603160425136.897732198158-13.9705925142001
22138.4130.2254171832787.40939689610321139.165185920619-8.17458281672205
23133.9125.8614352541580.505925102762294141.43263964308-8.0385647458424
24133.6126.334863262397-3.02301281743951143.888149555042-7.26513673760272
25141.2145.378913872872-9.32257333987597146.3436594670044.17891387287165
26151.8166.911031480142-12.0994301058028148.78839862566115.1110314801419
27155.4167.822742429141-8.25588021345877151.23313778431812.4227424291412
28156.6161.162993049967-1.75485956626950153.7918665163034.56299304996679
29161.6164.0632381092602.78616664245226156.3505952482882.46323810925983
30160.7158.1416909681123.89856155029769159.359747481590-2.55830903188809
31156147.6601445112691.97095577383823162.368899714893-8.33985548873108
32159.5146.4183948856756.11190501533617166.469700098989-13.0816051143255
33168.7155.05663920087211.7728603160425170.570500483086-13.6433607991283
34169.9155.6651951480027.40939689610321176.725407955895-14.2348048519979
35169.9156.4137594685340.505925102762294182.880315428704-13.4862405314659
36185.9183.916334052449-3.02301281743951190.906678764991-1.98366594755123
37190.8191.989531238598-9.32257333987597198.9330421012781.18953123859808
38195.8196.201181516706-12.0994301058028207.4982485890970.40118151670552
39211.9215.992425136542-8.25588021345877216.0634550769174.09242513654212
40227.1232.588615277625-1.75485956626950223.3662442886455.48861527762472
41251.3269.1447998571752.78616664245226230.66903350037317.8447998571748
42256.7275.1841225763143.89856155029769234.31731587338818.4841225763140
43251.9263.8634459797581.97095577383823237.96559824640411.9634459797580
44251.2259.2940941579856.11190501533617236.9940008266798.09409415798478
45270.3292.80473627700311.7728603160425236.02240340695422.5047362770031
46267.2295.3070612356527.40939689610321231.68354186824428.1070612356525
47243258.1493945677040.505925102762294227.34468032953415.1493945677035
48229.9241.248536010105-3.02301281743951221.57447680733511.348536010105
49187.2167.918300054741-9.32257333987597215.804273285135-19.2816999452589
50178.2157.979843834267-12.0994301058028210.519586271536-20.2201561657334
51175.2153.420980955521-8.25588021345877205.234899257937-21.7790190444786
52192.4183.929943580764-1.75485956626950202.624915985505-8.47005641923579
53187171.1989006444752.78616664245226200.014932713073-15.8010993555255
54184164.5188835742733.89856155029769199.582554875430-19.4811164257274
55194.1187.0788671883761.97095577383823199.150177037786-7.02113281162448
56212.7220.1527962794486.11190501533617199.1352987052167.45279627944805
57217.5224.10671931131211.7728603160425199.1204203726456.60671931131219
58200.5194.0423738782967.40939689610321199.548229225601-6.45762612170449
59205.9211.3180368186800.505925102762294199.9760380785575.41803681868041
60196.5195.247234653588-3.02301281743951200.775778163851-1.25276534641199
61206.3220.347055090730-9.32257333987597201.57551824914614.0470550907303
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/1dg681259769860.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/1dg681259769860.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/2jjwn1259769860.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/2jjwn1259769860.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/3q8k21259769860.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/3q8k21259769860.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/4zqas1259769860.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259769971eb7k23km36aso4g/4zqas1259769860.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 0 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
R code (references can be found in the software module):
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
m$win
m$deg
m$jump
m$inner
m$outer
bitmap(file='test1.png')
plot(m,main=main)
dev.off()
mylagmax <- nx/2
bitmap(file='test2.png')
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()
bitmap(file='test3.png')
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()
bitmap(file='test4.png')
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()
load(file='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='mytable.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='mytable1.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by