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 14:17:02 -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/t1259788667lwh0pzdv1bxpzmf.htm/, Retrieved Wed, 02 Dec 2009 22:17:52 +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/t1259788667lwh0pzdv1bxpzmf.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 «
0.0314796223103059 -3.00870920563557 -2.07677512619799 -1.25010391965540 0.817975239137125 0.0252076485413113 0.554937772830776 0.230027371950115 2.35672227418686 1.41350455171120 2.73311719024401 1.31551925971717 -2.70076272244080 -0.721411049152714 -0.149388576811997 -0.118199629770334 -0.676562489695275 1.79699928690761 1.79845572032988 0.245100010770855 1.80710848932636 -1.75934771184948 -0.0186697168761931 0.189651523600062 -1.84149562719087 -1.07019530156943 -0.507291477584104 0.866365633831705 -1.76077926699189 -0.580719393339347 -0.435702079860853 -0.994868534845203 1.63136048315789 -1.1949403709466 -1.00525975426991 1.32302234837564 -0.628357549594746 0.632048410440518 -2.16903155809288 2.53779364144266 -0.632933703679292 -1.41749196342200 -0.455343045381255 0.812255211942954 0.627897309219833 0.650904313655623 -1.29800419154382 0.74391671726854 -1.50461634127457 -1.42734677658523 0.263353807408564 - etc...
 
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
Seasonal601061
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
10.03147962231030591.87321254936343-1.19588792169410-0.614365383048721.84173292705313
2-3.00870920563557-4.55079684931365-0.988963661933574-0.477657900023914-1.54208764367808
3-2.07677512619799-3.01222666298964-0.800373172407236-0.340950416999108-0.935451536791646
4-1.2501039196554-2.724091117584130.445741960882114-0.22185868260878-1.47398719792873
50.8179752391371251.991244563012-0.252527136519296-0.1027669482184521.17326932387487
60.0252076485413113-0.3756340862885010.427857223294647-0.00180783992352354-0.400841734829812
70.5549377728307761.22002149116338-0.2092972138732280.09915126837140530.665083718332599
80.2300273719501150.353947551489241-0.0958653164249690.2019725088359580.123920179539126
92.356722274186863.145590816765751.263059982307450.3047937493005110.788868542578895
101.41350455171122.289562516437750.1497165303078000.3877300566768520.876057964726548
112.733117190244014.703279708160120.2922883082747030.4706663640531921.97016251791611
121.315519259717171.181848764406660.9642495872624340.484940167765245-0.133670495310508
13-2.7007627224408-4.7048514946648-1.195887921694100.499213971477297-2.004088772224
14-0.721411049152714-0.92733387350979-0.9889636619335740.473475437137936-0.205922824357076
15-0.1493885768119970.0538591159846669-0.8003731724072360.4477369027985750.203247692796664
16-0.118199629770334-1.035858018229080.4457419608821140.353716797806298-0.917658388458746
17-0.676562489695275-1.36029453568527-0.2525271365192960.25969669281402-0.683732045989999
181.796999286907612.990628020531070.4278572232946470.1755133299895061.19362873362346
191.798455720329883.71487868736800-0.2092972138732280.09132996716499261.91642296703812
200.2451000107708550.524671650072147-0.0958653164249690.06139368789453230.279571639301292
211.807108489326362.319699587721191.263059982307450.03145740862407190.512591098394835
22-1.75934771184948-3.637041160114120.149716530307800-0.0313707938926448-1.87769344826464
23-0.0186697168761931-0.2354287456177270.292288308274703-0.0941989964093614-0.216759028741534
240.189651523600062-0.3810100429309190.964249587262434-0.203936497131391-0.570661566530981
25-1.84149562719087-2.17342933483422-1.19588792169410-0.313673997853420-0.331933707643352
26-1.07019530156943-0.761158836295816-0.988963661933574-0.3902681049094700.309036465273614
27-0.5072914775841040.252652429204548-0.800373172407236-0.4668622119655200.759943906788652
280.8663656338317051.764388707776140.445741960882114-0.4773994009948470.898023073944438
29-1.76077926699189-2.78109480744031-0.252527136519296-0.487936590024174-1.02031554044842
30-0.580719393339347-1.124269541969940.427857223294647-0.465026468003397-0.543550148630596
31-0.435702079860853-0.219990599865857-0.209297213873228-0.442116345982620.215711479994996
32-0.994868534845203-1.50108925075388-0.095865316424969-0.392782502511560-0.506220715908674
331.631360483157892.343109643048831.26305998230745-0.3434486590404990.711749159890936
34-1.1949403709466-2.262626762304380.149716530307800-0.276970509896624-1.06768639135778
35-1.00525975426991-2.092315456061770.292288308274703-0.210492360752749-1.08705570179186
361.323022348375641.843641892603880.964249587262434-0.1618467831150370.520619544228244
37-0.6283575495947460.0523740279819322-1.19588792169410-0.1132012054773260.680731577576678
380.6320484104405182.33065109086444-0.988963661933574-0.07759060804982631.69860268042392
39-2.16903155809288-3.49570993315620-0.800373172407236-0.0419800106223271-1.32667837506332
402.537793641442664.662249883849550.445741960882114-0.03240456184634072.12445624240689
41-0.632933703679292-0.990511157768934-0.252527136519296-0.0228291130703542-0.357577454089642
42-1.417491963422-3.192688867491360.427857223294647-0.0701522826472916-1.77519690406936
43-0.455343045381255-0.583913424665053-0.209297213873228-0.117475452224229-0.128570379283798
440.8122552119429541.89430600393893-0.095865316424969-0.1739302636280491.08205079199597
450.6278973092198330.2231197111640811.26305998230745-0.230385075031869-0.404777598055752
460.6509043136556231.375644879433070.149716530307800-0.2235527824296290.724740565777451
47-1.29800419154382-2.671576201534950.292288308274703-0.216720489827389-1.37357200999113
480.743916717268540.736921558276490.964249587262434-0.213337711001844-0.00699515899204942
49-1.50461634127457-1.60338982867874-1.19588792169410-0.2099549321763-0.098773487404171
50-1.42734677658523-1.59783698839723-0.988963661933574-0.26789290283966-0.170490211811996
510.2633538074085641.65291166072738-0.800373172407236-0.325830873503021.38955785331882
52-0.430830854870631-0.975163641901500.445741960882114-0.332240028721877-0.544332787030868
530.3795760925180081.35032850549605-0.252527136519296-0.3386491839407340.970752412978038
541.703093534001463.303005844937430.427857223294647-0.324676000229161.59991231093597
55-3.12314448117342-5.72628893195603-0.209297213873228-0.310702816517586-2.60314445078261
56-1.32526207118689-2.24798052385366-0.095865316424969-0.306678302095155-0.922718452666766
57-0.60032490743804-2.161056009510811.26305998230745-0.302653787672723-1.56073110207277
581.236071376046662.623580083838090.149716530307800-0.301153862052571.38750870779143
590.7380070759053761.483379779968470.292288308274703-0.2996539364324160.74537270406309
600.8991008962895851.126790829573590.964249587262434-0.2928386242568570.227689933284008
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259788667lwh0pzdv1bxpzmf/1z44h1259788618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259788667lwh0pzdv1bxpzmf/1z44h1259788618.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259788667lwh0pzdv1bxpzmf/31or51259788618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259788667lwh0pzdv1bxpzmf/31or51259788618.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259788667lwh0pzdv1bxpzmf/453r81259788618.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259788667lwh0pzdv1bxpzmf/453r81259788618.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