Home » date » 2010 » Nov » 29 »

Workshop 8, 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, 29 Nov 2010 11:05:10 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4.htm/, Retrieved Mon, 29 Nov 2010 12:04:55 +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/2010/Nov/29/t1291028661htewjxvxa6k1ny4.htm/},
    year = {2010},
}
@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 = {2010},
    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 «
9 911 8 915 9 452 9 112 8 472 8 230 8 384 8 625 8 221 8 649 8 625 10 443 10 357 8 586 8 892 8 329 8 101 7 922 8 120 7 838 7 735 8 406 8 209 9 451 10 041 9 411 10 405 8 467 8 464 8 102 7 627 7 513 7 510 8 291 8 064 9 383 9 706 8 579 9 474 8 318 8 213 8 059 9 111 7 708 7 680 8 014 8 007 8 718 9 486 9 113 9 025 8 476 7 952 7 759 7 835 7 600 7 651 8 319 8 812 8 630
 
Output produced by software:


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


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
199119790.270724149761301.081663948868730.64761190139-120.729275850241
289158745.71596199845325.9477135250888758.33632447647-169.284038001553
394529258.9607148132859.0142481352498786.02503705154-193.039285186793
491129461.3152314919-45.63988696778058808.32465547588349.315231491901
584728454.46898931641-341.0932632166288830.62427390022-17.5310106835877
682308171.82859601071-559.0637421467768847.23514613606-58.1714039892868
783848254.18819917618-350.034217548098863.84601837191-129.811800823822
886259083.60890931956-708.3008976942648874.69198837471458.608909319557
982218361.829293493-805.36725187058885.5379583775140.829293492998
1086498661.7318985968-227.6857532151118863.9538546183112.7318985968013
1186258626.43476131369-218.8045121728088842.369750859121.43476131369061
121044311322.9564450633769.945580574628793.09797436208879.956445063295
131035710669.09213818611301.081663948868743.82619786505312.092138186094
1485868151.85467039325.9477135250888694.19761608491-434.145329609999
1588928280.41671755998859.0142481352498644.56903430477-611.583282440022
1683298105.51845040613-45.63988696778058598.12143656165-223.481549593866
1781017991.4194243981-341.0932632166288551.67383881852-109.580575601894
1879227871.46905929234-559.0637421467768531.59468285444-50.5309407076602
1981208078.51869065774-350.034217548098511.51552689035-41.4813093422581
2078387837.45367127504-708.3008976942648546.84722641923-0.546328724964042
2177357693.18832592239-805.36725187058582.1789259481-41.8116740776077
2284068406.940554586-227.6857532151118632.74519862910.940554586009966
2382097953.49304086272-218.8045121728088683.3114713101-255.506959137285
2494519434.1785662299769.945580574628697.87585319548-16.8214337701011
251004110068.47810097031301.081663948868712.4402350808727.4781009702747
2694119798.97172911141325.9477135250888697.0805573635387.971729111412
271040511269.2648722186859.0142481352498681.72087964613864.264872218622
2884678324.08599071113-45.63988696778058655.55389625665-142.914009288867
2984648639.70635034946-341.0932632166288629.38691286717175.706350349461
3081028170.89136242293-559.0637421467768592.1723797238468.8913624229317
3176277049.07637096757-350.034217548098554.95784658052-577.923629032434
3275137226.49508486926-708.3008976942648507.805812825-286.504915130738
3375107364.71347280102-805.36725187058460.65377906948-145.286527198979
3482918373.72407362088-227.6857532151118435.9616795942382.7240736208769
3580647935.53493205382-218.8045121728088411.26958011899-128.465067946179
3693839562.07315003704769.945580574628433.98126938834179.073150037038
3797069654.225377393451301.081663948868456.6929586577-51.7746226065501
3885798341.34636740338325.9477135250888490.70591907154-237.653632596624
3994749564.26687237937859.0142481352498524.7188794853890.2668723793704
4083188152.37547368875-45.63988696778058529.26441327903-165.624526311251
4182138233.28331614394-341.0932632166288533.8099470726820.2833161439448
4280598159.78888277817-559.0637421467768517.27485936861100.788882778168
43911110071.2944458836-350.034217548098500.73977166453960.29444588356
4477087638.73403248608-708.3008976942648485.56686520819-69.2659675139239
4576807694.97329311866-805.36725187058470.3939587518514.9732931186554
4680147807.40183347222-227.6857532151118448.28391974289-206.598166527776
4780077806.63063143888-218.8045121728088426.17388073393-200.369368561120
4887188274.18308670424769.945580574628391.87133272114-443.816913295763
4994869313.349551342791301.081663948868357.56878470836-172.650448657213
5091139561.3568256425325.9477135250888338.6954608324448.356825642508
5190258871.1636149083859.0142481352498319.82213695645-153.836385091703
5284768659.1867926295-45.63988696778058338.45309433829183.186792629496
5379527888.00921149651-341.0932632166288357.08405172012-63.9907885034881
5477597708.56419692598-559.0637421467768368.4995452208-50.4358030740241
5578357640.1191788266-350.034217548098379.91503872148-194.880821173395
5676007518.67488538143-708.3008976942648389.62601231283-81.3251146185703
5776517708.03026596632-805.36725187058399.3369859041857.0302659663193
5883198456.0155584209-227.6857532151118409.67019479422137.015558420895
5988129422.80110848855-218.8045121728088420.00340368425610.801108488555
6086308059.10906577428769.945580574628430.9453536511-570.890934225723
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/1l3dv1291028702.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/1l3dv1291028702.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/2l3dv1291028702.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/2l3dv1291028702.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/3euug1291028702.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/3euug1291028702.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/4euug1291028702.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/29/t1291028661htewjxvxa6k1ny4/4euug1291028702.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