Home » date » 2009 » Dec » 07 »

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: Mon, 07 Dec 2009 15:45:54 -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/07/t1260226006nw8iui5ip0hxw09.htm/, Retrieved Mon, 07 Dec 2009 23:46:51 +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/07/t1260226006nw8iui5ip0hxw09.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:
Decomposition by Loess
 
Dataseries X:
» Textbox « » Textfile « » CSV «
220206 220115 218444 214912 210705 209673 237041 242081 241878 242621 238545 240337 244752 244576 241572 240541 236089 236997 264579 270349 269645 267037 258113 262813 267413 267366 264777 258863 254844 254868 277267 285351 286602 283042 276687 277915 277128 277103 275037 270150 267140 264993 287259 291186 292300 288186 281477 282656 280190 280408 276836 275216 274352 271311 289802 290726 292300 278506 269826 265861 269034 264176 255198 253353 246057 235372 258556 260993 254663 250643 243422 247105 248541 245039 237080 237085 225554 226839 247934 248333 246969 245098 246263 255765 264319 268347 273046 273963 267430 271993 292710 295881 293299 288576
 
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
Seasonal941095
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
1220206222139.3617716942191.20667631383216081.4315519921933.36177169447
2220115221141.118750762869.893614638668218218.9876346001026.11875076176
3218444219568.752050452-3037.2957676599220356.5437172071124.75205045243
4214912213272.741670005-5955.90431884818222507.162648843-1639.25832999524
5210705208627.353523921-11875.1351044000224657.781580479-2077.64647607942
6209673206423.503035089-13869.4003033098226791.897268221-3249.49696491141
7237041236866.2760544028289.7109896351228926.012955963-174.723945598205
8242081241981.15434569211142.3402486411231038.505405666-99.8456543075445
9241878241234.5316102659370.47053436565233150.997855370-643.468389735441
10242621245823.5530953024100.9752814866235317.4716232113202.55309530202
11238545241116.445825852-1510.39121690493237483.9453910532571.44582585199
12240337240740.076238392283.526112060651239650.397649547403.07623839227
13244752245495.9434156452191.20667631383241816.849908041743.943415644928
14244576244304.627053904869.893614638668243977.479331458-271.372946096235
15241572240043.187012786-3037.2957676599246138.108754874-1528.81298721404
16240541238841.864752649-5955.90431884818248196.039566199-1699.13524735058
17236089233799.164726876-11875.1351044000250253.970377524-2289.83527312367
18236997235654.485714459-13869.4003033098252208.914588851-1342.51428554137
19264579266704.4302101868289.7109896351254163.8588001792125.43021018611
20270349273492.80859081111142.3402486411256062.8511605483143.80859081139
21269645271957.6859447189370.47053436565257961.8435209162312.68594471813
22267037270348.4236856814100.9752814866259624.6010328323311.42368568148
23258113256449.032672157-1510.39121690493261287.358544748-1663.96732784272
24262813262736.053032199283.526112060651262606.420855741-76.9469678014284
25267413268709.3101569522191.20667631383263925.4831667341296.31015695224
26267366268723.509181615869.893614638668265138.5972037461357.50918161491
27264777266239.584526901-3037.2957676599266351.7112407591462.58452690096
28258863255999.362516145-5955.90431884818267682.541802704-2863.63748385548
29254844252549.762739752-11875.1351044000269013.372364648-2294.23726024840
30254868253339.582135454-13869.4003033098270265.818167856-1528.41786454635
31277267274726.0250393018289.7109896351271518.263971064-2540.97496069915
32285351287006.89716773811142.3402486411272552.7625836211655.89716773771
33286602290246.2682694569370.47053436565273587.2611961783644.26826945611
34283042287470.7268708834100.9752814866274512.297847634428.72687088343
35276687279447.056717823-1510.39121690493275437.3344990822760.0567178232
36277915279370.411270416283.526112060651276176.0626175231455.41127041646
37277128275150.0025877222191.20667631383276914.790735964-1977.99741227785
38277103275919.267932690869.893614638668277416.838452671-1183.73206730967
39275037275192.409598282-3037.2957676599277918.886169378155.409598281898
40270150267888.981861511-5955.90431884818278366.922457337-2261.01813848934
41267140267340.176359103-11875.1351044000278814.958745297200.176359103061
42264993264591.386467872-13869.4003033098279264.013835438-401.613532127871
43287259286515.2200847868289.7109896351279713.068925578-743.779915213585
44291186291170.38472154911142.3402486411280059.27502981-15.6152784511214
45292300294824.0483315939370.47053436565280405.4811340422524.04833159281
46288186291535.8328475474100.9752814866280735.1918709673349.83284754661
47281477283399.488609013-1510.39121690493281064.9026078921922.48860901286
48282656283666.749455714283.526112060651281361.7244322251010.74945571402
49280190276530.2470671282191.20667631383281658.546256559-3659.75293287239
50280408278258.575972374869.893614638668281687.530412988-2149.42402762617
51276836274992.781198243-3037.2957676599281716.514569416-1843.21880175656
52275216275136.022952009-5955.90431884818281251.881366840-79.9770479913568
53274352279791.886940137-11875.1351044000280787.2481642635439.88694013742
54271311276667.925553243-13869.4003033098279823.4747500675356.9255532432
55289802292454.5876744948289.7109896351278859.7013358712652.58767449425
56290726292978.76848957311142.3402486411277330.8912617862252.76848957269
57292300299427.4482779339370.47053436565275802.0811877027127.44827793259
58278506279266.7443978494100.9752814866273644.280320665760.744397848903
59269826269675.911763278-1510.39121690493271486.479453627-150.088236722338
60265861262589.549254871283.526112060651268848.924633069-3271.45074512943
61269034269665.4235111762191.20667631383266211.369812510631.423511175846
62264176263972.477460978869.893614638668263509.628924383-203.522539021971
63255198252625.407731404-3037.2957676599260807.888036256-2572.59226859643
64253353254275.785358376-5955.90431884818258386.118960472922.785358376248
65246057248024.785219712-11875.1351044000255964.3498846881967.78521971244
66235372230564.608926460-13869.4003033098254048.791376850-4807.39107353968
67258556256689.0561413538289.7109896351252133.232869012-1866.94385864664
68260993260293.20035308111142.3402486411250550.459398278-699.799646918953
69254663250987.843538099370.47053436565248967.685927544-3675.15646190979
70250643249547.6526346944100.9752814866247637.372083819-1095.34736530599
71243422242047.332976810-1510.39121690493246307.058240095-1374.66702318969
72247105248678.472671898283.526112060651245248.0012160411573.47267189820
73248541250701.8491316982191.20667631383244188.9441919882160.84913169846
74245039245847.746373508869.893614638668243360.360011854808.746373507602
75237080234665.51993594-3037.2957676599242531.775831720-2414.48006405987
76237085237995.34924079-5955.90431884818242130.555078058910.34924078986
77225554221253.800780003-11875.1351044000241729.334324397-4300.19921999692
78226839225261.183643550-13869.4003033098242286.216659759-1577.81635644956
79247934244735.1900152438289.7109896351242843.098995122-3198.80998475698
80248333240741.84801987911142.3402486411244781.81173148-7591.15198012133
81246969237847.0049977969370.47053436565246720.524467839-9121.9950022042
82245098236169.2371811424100.9752814866249925.787537372-8928.76281885823
83246263240905.34061-1510.39121690493253131.050606905-5357.65938999978
84255765254139.886223203283.526112060651257106.587664737-1625.11377679720
85264319265364.6686011182191.20667631383261082.1247225681045.66860111777
86268347271022.067466503869.893614638668264802.0389188582675.06746650289
87273046280607.342652511-3037.2957676599268521.9531151497561.34265251138
88273963281783.664476132-5955.90431884818272098.2398427167820.66447613225
89267430271060.608534117-11875.1351044000275674.5265702833630.60853411665
90271993278642.794515026-13869.4003033098279212.6057882836649.79451502638
91292710294379.6040040818289.7109896351282750.6850062841669.60400408134
92295881294454.69664389211142.3402486411286164.963107467-1426.30335610779
93293299287648.2882569849370.47053436565289579.24120865-5650.7117430155
94288576280190.5561442134100.9752814866292860.468574301-8385.44385578745
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/1gveu1260225950.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/1gveu1260225950.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/281r51260225950.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/281r51260225950.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/32l8u1260225950.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/32l8u1260225950.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/431r91260225950.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/07/t1260226006nw8iui5ip0hxw09/431r91260225950.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