Home » date » 2009 » Dec » 04 »

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: Fri, 04 Dec 2009 14:19:18 -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/04/t125996162856qql0l39tosa89.htm/, Retrieved Fri, 04 Dec 2009 22:20:33 +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/04/t125996162856qql0l39tosa89.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 «
1.4 1 -0.8 -2.9 -0.7 -0.7 1.5 3 3.2 3.1 3.9 1 1.3 0.8 1.2 2.9 3.9 4.5 4.5 3.3 2 1.5 1 2.1 3 4 5.1 4.5 4.2 3.3 2.7 1.8 1.4 0.5 -0.4 0.8 0.7 1.9 2 1.1 0.9 0.4 0.7 2.1 2.8 3.9 3.5 2 2 1.5 2.5 3.1 2.7 2.8 2.5 3 3.2 2.8 2.4 2 1.8 1.1 -1.5 -3.7
 
Output produced by software:


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


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
11.43.12603629919863-0.0062422588886947-0.3197940403099321.72603629919863
212.086557350774680.00591255538706756-0.09246990616174461.08655735077468
3-0.8-1.43625604670859-0.2985981812778530.134854227986443-0.63625604670859
4-2.9-5.30062053099167-0.8554139042003380.356034435192003-2.40062053099166
5-0.7-2.085543400212480.1083287578149140.577214642397563-1.38554340021248
6-0.7-2.13194629029434-0.04376195429088380.775708244585221-1.43194629029434
71.51.761651121544240.2641470316828810.974201846772880.26165112154424
834.279481010997960.5496490869160321.170869902086011.27948101099796
93.24.57731053383390.4551515087669551.367537957399141.37731053383390
103.14.245452507678730.2949921755819961.659555316739281.14545250767873
113.95.83359483735830.01483248656227721.951572676079421.93359483735831
1210.273475194677400-0.488996896113262.21552170143586-0.7265248053226
131.30.126771532096391-0.00624225888869472.47947072679230-1.17322846790361
140.8-0.9787695594372190.005912555387067562.57285700405015-1.77876955943722
151.20.0323548999698546-0.2985981812778532.666243281308-1.16764510003015
162.94.02051691199172-0.8554139042003382.634896992208621.12051691199172
173.95.088120539075850.1083287578149142.603550703109231.18812053907585
184.56.42351488213942-0.04376195429088382.620247072151461.92351488213942
194.56.098909527123430.2641470316828812.636943441193691.59890952712343
203.33.294953929324950.5496490869160322.75539698375902-0.00504607067505347
2120.670997964908690.4551515087669552.87385052632435-1.32900203509131
221.5-0.2699757872640940.2949921755819962.9749836116821-1.76997578726409
231-1.090949183602120.01483248656227723.07611669703984-2.09094918360212
242.11.58341773334659-0.488996896113263.10557916276667-0.516582266653407
2532.8712006303952-0.00624225888869473.13504162849349-0.128799369604799
2644.877113709914630.005912555387067563.116973734698300.877113709914628
275.17.39969234037474-0.2985981812778533.098905840903122.29969234037474
284.56.85446637078304-0.8554139042003383.000947533417292.35446637078304
294.25.388682016253610.1083287578149142.902989225931471.18868201625361
303.33.95929058672703-0.04376195429088382.684471367563850.659290586727034
312.72.669899459120890.2641470316828812.46595350919623-0.0301005408791064
321.80.861184252528120.5496490869160322.18916666055585-0.93881574747188
331.40.4324686793175760.4551515087669551.91237981191547-0.967531320682424
340.5-0.9618242666302320.2949921755819961.66683209104824-1.46182426663023
35-0.4-2.236116856743280.01483248656227721.42128437018100-1.83611685674328
360.80.81154130884303-0.488996896113261.277455587270230.0115413088430294
370.70.272615454529238-0.00624225888869471.13362680435946-0.427384545470762
381.92.64318616032440.005912555387067561.150901284288530.743186160324398
3923.13042241706024-0.2985981812778531.168175764217611.13042241706024
401.11.72482651258413-0.8554139042003381.330587391616200.624826512584134
410.90.1986722231702890.1083287578149141.49299901901480-0.701327776829711
420.4-0.801735937213794-0.04376195429088381.64549789150468-1.20173593721379
430.7-0.662143795677440.2641470316828811.79799676399456-1.36214379567744
442.11.757167851812730.5496490869160321.89318306127124-0.342832148187275
452.83.156479132685120.4551515087669551.988369358547930.356479132685118
463.95.38500592072510.2949921755819962.120001903692911.48500592072510
473.54.733533064599840.01483248656227722.251634448837891.23353306459984
4822.09078606254041-0.488996896113262.398210833572850.090786062540412
4921.46145504058089-0.00624225888869472.54478721830781-0.538544959419115
501.50.3931758339883660.005912555387067562.60091161062457-1.10682416601163
512.52.64156217833653-0.2985981812778532.657036002941320.141562178336530
523.14.41807734023935-0.8554139042003382.637336563960981.31807734023935
532.72.674034117204440.1083287578149142.61763712498065-0.02596588279556
542.83.05980038233924-0.04376195429088382.583961571951640.259800382339240
552.52.185566949394480.2641470316828812.55028601892264-0.314433050605523
5633.152504229760210.5496490869160322.297846683323760.152504229760212
573.23.899441143508180.4551515087669552.045407347724870.699441143508175
582.83.580733374097010.2949921755819961.724274450320990.78073337409701
592.43.382025960520600.01483248656227721.403141552917120.982025960520605
6023.41891028194955-0.488996896113261.070086614163711.41891028194955
611.82.86921058347838-0.00624225888869470.737031675410311.06921058347838
621.11.809833542123290.005912555387067560.384253902489640.709833542123293
63-1.5-2.73287794829112-0.2985981812778530.0314761295689689-1.23287794829112
64-3.7-6.19891755895518-0.855413904200338-0.34566853684448-2.49891755895518
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/109r41259961556.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/109r41259961556.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/2vo0w1259961556.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/2vo0w1259961556.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/3bjem1259961556.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/3bjem1259961556.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/47kfd1259961556.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t125996162856qql0l39tosa89/47kfd1259961556.ps (open in new window)


 
Parameters (Session):
par1 = multiplicative ; par2 = 12 ;
 
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