Home » date » 2010 » Dec » 07 »

Workshop 5

*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: Tue, 07 Dec 2010 12:54:27 +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/07/t1291726454zgxol8lmsumeuqf.htm/, Retrieved Tue, 07 Dec 2010 13:54:18 +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/07/t1291726454zgxol8lmsumeuqf.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:
LOESS
 
Dataseries X:
» Textbox « » Textfile « » CSV «
-5 -1 -2 -5 -4 -6 -2 -2 -2 -2 2 1 -8 -1 1 -1 2 2 1 -1 -2 -2 -1 -8 -4 -6 -3 -3 -7 -9 -11 -13 -11 -9 -17 -22 -25 -20 -24 -24 -22 -19 -18 -17 -11 -11 -12 -10 -15 -15 -15 -13 -8 -13 -9 -7 -4 -4 -2 0
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time6 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
1-5-3.93726719990821-3.51514883931583-2.547583960775961.06273280009179
2-11.20299893050321-0.650070640560946-2.552928289942272.20299893050321
3-2-0.856735723297-0.584991657594427-2.558272619108571.143264276703
4-5-6.2789499821861-1.19450020616385-2.52654981165005-1.27894998218609
5-4-5.701162280548870.195989284740401-2.49482700419153-1.70116228054887
6-6-8.5441232537162-1.01255591159340-2.4433208346904-2.5441232537162
7-2-1.787079913727850.178894578917117-2.391814665189270.212920086272149
8-2-1.676677414350750.00517624496459454-2.328498830613850.323322585649252
9-2-3.766276483394082.03145947943251-2.26518299603843-1.76627648339408
10-2-4.421989552235272.41954899327477-1.9975594410395-2.42198955223527
1123.722301561378942.00763432466163-1.729935886040571.72230156137894
1213.173671554099170.118567175969312-1.292238730068482.17367155409917
13-8-11.6303095865878-3.51514883931583-0.854541574096392-3.63030958658778
14-1-0.728016265323948-0.650070640560946-0.6219130941151070.271983734676052
1512.97427627172825-0.584991657594427-0.3892846141338221.97427627172825
16-1-0.35197801607873-1.19450020616385-0.4535217777574150.64802198392127
1724.321769656640610.195989284740401-0.5177589413810092.32176965664061
1825.82175342715259-1.01255591159340-0.8091975155591883.82175342715259
1912.921741510820250.178894578917117-1.100636089737371.92174151082025
20-1-0.5447701110715150.00517624496459454-1.460406133893080.455229888928485
21-2-4.211283301383722.03145947943251-1.82017617804879-2.21128330138372
22-2-4.100386723972752.41954899327477-2.31916226930203-2.10038672397275
23-1-1.189485964106372.00763432466163-2.81814836055526-0.189485964106372
24-8-12.61014093246820.118567175969312-3.50842624350109-4.61014093246822
25-4-0.286147034237247-3.51514883931583-4.198704126446933.71385296576275
26-6-6.3555284387301-0.650070640560946-4.99440092070896-0.355528438730095
27-30.375089372565418-0.584991657594427-5.790097714970993.37508937256542
28-31.93727873936771-1.19450020616385-6.742778533203864.93727873936771
29-7-6.500529933303680.195989284740401-7.695459351436720.499470066696321
30-9-7.96544799648738-1.01255591159340-9.021996091919221.03455200351262
31-11-11.83036174651540.178894578917117-10.3485328324017-0.830361746515406
32-13-14.06052155587430.00517624496459454-11.9446546890903-1.06052155587428
33-11-10.49068293365362.03145947943251-13.54077654577890.509317066346416
34-9-5.382640127819952.41954899327477-15.03690886545483.61735987218005
35-17-19.47459313953092.00763432466163-16.5330411851307-2.47459313953091
36-22-26.57550133087480.118567175969312-17.5430658450946-4.57550133087476
37-25-27.9317606556258-3.51514883931583-18.5530905050584-2.93176065562579
38-20-20.3981422741606-0.650070640560946-18.9517870852785-0.398142274160602
39-24-28.0645246769071-0.584991657594427-19.3504836654985-4.06452467690706
40-24-27.6588475612552-1.19450020616385-19.1466522325810-3.65884756125518
41-22-25.2531684850770.195989284740401-18.9428207996634-3.25316848507698
42-19-18.7589642282226-1.01255591159340-18.22847986018400.241035771777359
43-18-18.66475565821260.178894578917117-17.5141389207045-0.664755658212624
44-17-17.33360530738790.00517624496459454-16.6715709375767-0.333605307387906
45-11-8.202456524983622.03145947943251-15.82900295444892.79754347501638
46-11-9.4253653478952.41954899327477-14.99418364537981.57463465210501
47-12-11.84826998835102.00763432466163-14.15936433631070.151730011649034
48-10-6.679399596157790.118567175969312-13.43916757981153.32060040384221
49-15-13.7658803373718-3.51514883931583-12.71897082331241.23411966262821
50-15-17.2695083200234-0.650070640560946-12.0804210394156-2.26950832002344
51-15-17.9731370868867-0.584991657594427-11.4418712555188-2.97313708688673
52-13-14.1823960568049-1.19450020616385-10.6231037370313-1.18239605680489
53-8-6.391653066196740.195989284740401-9.804336218543661.60834693380326
54-13-16.0710621573151-1.01255591159340-8.91638193109154-3.07106215731506
55-9-10.15046693527770.178894578917117-8.02842764363942-1.1504669352777
56-7-6.895364015924690.00517624496459454-7.10981222903990.104635984075308
57-4-3.840262664992122.03145947943251-6.191196814440390.159737335007881
58-4-5.184771478391642.41954899327477-5.23477751488313-1.18477147839164
59-2-1.729276109335772.00763432466163-4.278358215325870.270723890664234
6003.170896354514820.118567175969312-3.289463530484133.17089635451482
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/1g9nr1291726460.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/1g9nr1291726460.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/2904c1291726460.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/2904c1291726460.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/3904c1291726460.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/3904c1291726460.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/47dbm1291726460.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291726454zgxol8lmsumeuqf/47dbm1291726460.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