Home » date » 2010 » Dec » 20 »

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, 20 Dec 2010 22:16:12 +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/Dec/20/t12928832744xy06y5a0ps8pdk.htm/, Retrieved Mon, 20 Dec 2010 23:14:34 +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/Dec/20/t12928832744xy06y5a0ps8pdk.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 «
1038.00 934.00 988.00 870.00 854.00 834.00 872.00 954.00 870.00 1238.00 1082.00 1053.00 934.00 787.00 1081.00 908.00 995.00 825.00 822.00 856.00 887.00 1094.00 990.00 936.00 1097.00 918.00 926.00 907.00 899.00 971.00 1087.00 1000.00 1071.00 1190.00 1116.00 1070.00 1314.00 1068.00 1185.00 1215.00 1145.00 1251.00 1363.00 1368.00 1535.00 1853.00 1866.00 2023.00 1373.00 1968.00 1424.00 1160.00 1243.00 1375.00 1539.00 1773.00 1906.00 2076.00 2004.00
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
110381049.9018104447418.58227827673801007.5159112785211.9018104447370
2934877.840663829668-9.75089599791843999.91023216825-56.1593361703322
39881019.77908573299-36.0836387909675992.30455305797631.7790857329915
4870911.808447115832-157.069828518108985.26138140227541.8084471158325
5854883.837906887489-154.056116634063978.21820974657429.8379068874891
6834837.292577730278-141.418452767651972.1258750373733.29257773027814
7872845.347237442496-67.3807777706665966.03354032817-26.6527625575043
8954971.828934207828-24.5655726533436960.73663844551617.8289342078281
9870756.31049232188528.2497711152548955.43973656286-113.689507678115
1012381268.67207264956253.050264480702954.27766286973830.6720726495604
1110821048.03358014752162.850830675867953.115589176615-33.9664198524825
1210531021.26444323776127.592263689576957.143293072666-31.7355567622428
13934888.24672475454418.5822782767380961.170996968718-45.7532752454558
14787623.035852420883-9.75089599791843960.715043577036-163.964147579117
1510811237.82454860561-36.0836387909675960.259090185354156.824548605613
169081018.23938155767-157.069828518108954.830446960433110.239381557675
179951194.65431289855-154.056116634063949.401803735511199.654312898552
18825847.123955080673-141.418452767651944.29449768697822.1239550806731
19822772.193586132223-67.3807777706665939.187191638444-49.8064138677772
20856801.500603494358-24.5655726533436935.064969158985-54.4993965056418
21887814.80748220521828.2497711152548930.942746679527-72.192517794782
2210941005.26738986077253.050264480702929.682345658524-88.7326101392257
23990888.727224686612162.850830675867928.42194463752-101.272775313388
24936805.402279608208127.592263689576939.005456702215-130.597720391792
2510971225.8287529563518.5822782767380949.58896876691128.828752956353
26918877.948590627105-9.75089599791843967.802305370813-40.0514093728949
27926902.06799681625-36.0836387909675986.015641974717-23.9320031837497
28907971.273482781034-157.069828518108999.79634573707464.2734827810339
29899938.479067134633-154.0561166340631013.5770494994339.4790671346329
309711059.30603971967-141.4184527676511024.1124130479888.306039719672
3110871206.73300117414-67.38077777066651034.64777659653119.733001174140
321000977.434121083515-24.56557265334361047.13145156983-22.5658789164847
3310711054.1351023416228.24977111525481059.61512654313-16.8648976583847
3411901048.51422206814253.0502644807021078.43551345116-141.485777931865
351116971.893268964936162.8508306758671097.25590035920-144.106731035064
361070889.361052063019127.5922636895761123.04668424740-180.638947936981
3713141460.5802535876518.58227827673801148.83746813561146.580253587649
381068959.543816839044-9.750895997918431186.20707915887-108.456183160956
3911851182.50694860883-36.08363879096751223.57669018214-2.49305139116905
4012151312.49714760927-157.0698285181081274.5726809088497.4971476092699
4111451118.48744499852-154.0561166340631325.56867163554-26.5125550014759
4212511265.13963890486-141.4184527676511378.2788138627914.1396389048568
4313631362.39182168062-67.38077777066651430.98895609005-0.60817831938175
4413681289.67662688255-24.56557265334361470.88894577079-78.32337311745
4515351530.9612934332128.24977111525481510.78893545154-4.03870656679396
4618531922.71292352979253.0502644807021530.2368119895169.7129235297889
4718662019.46448079665162.8508306758671549.68468852748153.464480796653
4820232358.58153840987127.5922636895761559.82619790056335.581538409866
4913731157.4500144496318.58227827673801569.96770727364-215.549985550374
5019682359.3522486222-9.750895997918431586.39864737572391.352248622199
5114241281.25405131316-36.08363879096751602.82958747780-142.745948686836
521160853.257764849069-157.0698285181081623.81206366904-306.742235150931
531243995.261576773788-154.0561166340631644.79453986028-247.738423226212
5413751227.52152900045-141.4184527676511663.8969237672-147.478470999548
5515391462.38147009654-67.38077777066651682.99930767412-76.6185299034555
5617731866.70231895615-24.56557265334361703.8632536972093.7023189561473
5719062059.0230291644728.24977111525481724.72719972027153.023029164474
5820762149.81619918698253.0502644807021749.1335363323273.8161991869765
5920042071.60929637976162.8508306758671773.5398729443767.6092963797598
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/1q1nx1292883368.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/1q1nx1292883368.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/2q1nx1292883368.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/2q1nx1292883368.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/3q1nx1292883368.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/3q1nx1292883368.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/41bm01292883368.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t12928832744xy06y5a0ps8pdk/41bm01292883368.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