Home » date » 2009 » Dec » 03 »

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: Thu, 03 Dec 2009 06:27:56 -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/03/t12598469191hohhih9qclgnki.htm/, Retrieved Thu, 03 Dec 2009 14:28:45 +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/03/t12598469191hohhih9qclgnki.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:
JSSHWWS9P8
 
Dataseries X:
» Textbox « » Textfile « » CSV «
11.1 10.9 10 9.2 9.2 9.5 9.6 9.5 9.1 8.9 9 10.1 10.3 10.2 9.6 9.2 9.3 9.4 9.4 9.2 9 9 9 9.8 10 9.8 9.3 9 9 9.1 9.1 9.1 9.2 8.8 8.3 8.4 8.1 7.7 7.9 7.9 8 7.9 7.6 7.1 6.8 6.5 6.9 8.2 8.7 8.3 7.9 7.5 7.8 8.3 8.4 8.2 7.7 7.2 7.3 8.1
 
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
Seasonal601061
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
111.111.49124459290110.7245834280744319.984171979024510.391244592901057
210.911.37699428665340.4987639680642679.924241745282330.476994286653403
31010.04274386277430.09294462568558249.864311511540150.0427438627742696
49.28.84154750338496-0.2526699420005279.81112243861556-0.358452496615037
59.28.7603513792587-0.1182847449496829.75793336569098-0.439648620741297
69.59.203978984754740.0888385703396979.70718244490556-0.296021015245259
79.69.447606498759590.09596197712026589.65643152412015-0.152393501240415
89.59.46811270729899-0.07567271635475829.60756000905577-0.0318872927010148
99.18.94861870671568-0.3073072007070749.5586884939914-0.151381293284324
108.98.81753033943586-0.560625949845119.54309561040925-0.0824696605641417
1198.9864421420683-0.5139448688954039.5275027268271-0.0135578579317031
1210.110.35066526937410.3274128551483199.521921875477630.250665269374053
1310.310.35907554779740.7245834280744319.516341024128150.0590755477974216
1410.210.39968441967470.4987639680642679.501551612261020.199684419674716
159.69.620293173920530.09294462568558249.486762200393890.0202931739205319
169.29.1798535332355-0.2526699420005279.47281640876502-0.0201464667644942
179.39.25941412781353-0.1182847449496829.45887061713615-0.0405858721864707
189.49.26987397070960.0888385703396979.4412874589507-0.1301260292904
199.49.280333722114480.09596197712026589.42370430076526-0.119666277885521
209.29.07200354455857-0.07567271635475829.40366917179618-0.127996455441425
2198.92367315787997-0.3073072007070749.3836340428271-0.0763268421200323
2299.19598933027585-0.560625949845119.364636619569260.19598933027585
2399.16830567258399-0.5139448688954039.345639196311420.168305672583987
249.89.948058195334630.3274128551483199.324528949517050.148058195334629
25109.971997869202880.7245834280744319.30341870272269-0.0280021307971214
269.89.81678626630820.4987639680642679.284449765627540.0167862663081966
279.39.241574545782030.09294462568558249.26548082853238-0.0584254542179661
2899.01890920521249-0.2526699420005279.233760736788040.0189092052124877
2998.91624409990599-0.1182847449496829.2020406450437-0.0837559000940118
309.18.994882101386150.0888385703396979.11627932827416-0.105117898613853
319.19.073520011375110.09596197712026589.03051801150462-0.0264799886248888
329.19.37641259527792-0.07567271635475828.899260121076840.276412595277916
339.29.93930497005801-0.3073072007070748.768002230649060.739304970058013
348.89.52136262258848-0.560625949845118.639263327256640.721362622588476
358.38.6034204450312-0.5139448688954038.510524423864210.303420445031195
368.48.09201058852150.3274128551483198.38057655633018-0.307989411478502
378.17.224787883129410.7245834280744318.25062868879616-0.87521211687059
387.76.805846722658550.4987639680642678.09538930927718-0.894153277341448
397.97.766905444556210.09294462568558247.9401499297582-0.133094555443786
407.98.2447042142546-0.2526699420005277.807965727745920.344704214254609
4188.44250321921605-0.1182847449496827.675781525733630.442503219216049
427.98.07986582697180.0888385703396977.63129560268850.179865826971799
437.67.517228343236360.09596197712026587.58680967964338-0.0827716567636418
447.16.68591094964692-0.07567271635475827.58976176670784-0.414089050353083
456.86.31459334693477-0.3073072007070747.59271385377231-0.485406653065234
466.55.96354072518522-0.560625949845117.59708522465989-0.536459274814781
476.96.71248827334793-0.5139448688954037.60145659554747-0.187511726652071
488.28.430372910199480.3274128551483197.64221423465220.230372910199481
498.78.992444698168640.7245834280744317.682971873756920.292444698168644
508.38.343344646934130.4987639680642677.75789138500160.0433446469341323
517.97.874244478068140.09294462568558247.83281089624628-0.0257555219318615
527.57.39000338229118-0.2526699420005277.86266655970934-0.109996617708816
537.87.82576252177727-0.1182847449496827.89252222317240.0257625217772732
548.38.597092828643080.0888385703396977.914068601017220.297092828643083
558.48.76842304401770.09596197712026587.935614978862030.3684230440177
568.28.520766857479-0.07567271635475827.954905858875760.320766857478998
577.77.73311046181759-0.3073072007070747.974196738889480.0331104618175910
587.26.97215588303982-0.560625949845117.9884700668053-0.227844116960184
597.37.1112014741743-0.5139448688954038.0027433947211-0.188798525825701
608.17.86057212876780.3274128551483198.01201501608388-0.239427871232195
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/12p391259846874.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/12p391259846874.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/2xat61259846874.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/2xat61259846874.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/3lifn1259846874.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/3lifn1259846874.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/4jh7m1259846874.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/03/t12598469191hohhih9qclgnki/4jh7m1259846874.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