Home » date » 2009 » Dec » 04 »

Workshop 9

*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 05:08:33 -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/t1259928568ssqsbtoafks21cv.htm/, Retrieved Fri, 04 Dec 2009 13:09: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/t1259928568ssqsbtoafks21cv.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 «
130 136.7 138.1 139.5 140.4 144.6 151.4 147.9 141.5 143.8 143.6 150.5 150.1 154.9 162.1 176.7 186.6 194.8 196.3 228.8 267.2 237.2 254.7 258.2 257.9 269.6 266.9 269.6 253.9 258.6 274.2 301.5 304.5 285.1 287.7 265.5 264.1 276.1 258.9 239.1 250.1 276.8 297.6 295.4 283 275.8 279.7 254.6 234.6 176.9 148.1 122.7 124.9 121.6 128.4 144.5 151.8 167.1 173.8 203.7 199.8
 
Output produced by software:


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


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
1130109.4144273569526.02685985459014144.558712788458-20.5855726430478
2136.7135.140139694063-6.27184026099176144.531700566929-1.55986030593678
3138.1145.843332110333-14.1480204557324144.5046883453997.74333211033297
4139.5154.571973445527-20.1942005000934144.62222705456615.0719734455271
5140.4155.340622855522-19.2803886192554144.73976576373314.9406228555222
6144.6156.252202857982-12.2718611693765145.21965831139511.6522028579816
7151.4160.163784876028-3.06333573508466145.6995508590578.76378487602798
8147.9138.45512326217510.9157211484992146.429155589325-9.44487673782459
9141.5119.00646531868816.8347743617181147.158760319594-22.4935346813123
10143.8129.2285080397399.6627377275261148.708754232735-14.5714919602609
11143.6120.55053523329216.3907166208327150.258748145875-23.0494647667081
12150.5130.5548893560715.3988661361994155.046244507731-19.94511064393
13150.1134.3393992758246.02685985459014159.833740869586-15.7606007241760
14154.9148.769235997266-6.27184026099176167.302604263726-6.13076400273422
15162.1163.576552797866-14.1480204557324174.7714676578661.47655279786622
16176.7189.760895894151-20.1942005000934183.83330460594213.0608958941509
17186.6199.585247065237-19.2803886192554192.89514155401912.9852470652366
18194.8199.942149651617-12.2718611693765201.9297115177605.14214965161690
19196.3184.699054253584-3.06333573508466210.964281481501-11.6009457464158
20228.8227.28961962146210.9157211484992219.394659230039-1.51038037853812
21267.2289.74018865970416.8347743617181227.82503697857722.5401886597045
22237.2229.4061815554819.6627377275261235.331080716992-7.79381844451856
23254.7250.17215892376016.3907166208327242.837124455408-4.52784107624026
24258.2251.82269726306615.3988661361994249.178436600735-6.37730273693415
25257.9254.2533913993486.02685985459014255.519748746062-3.64660860065214
26269.6284.718236218106-6.27184026099176260.75360404288615.1182362181058
27266.9281.960561116022-14.1480204557324265.9874593397115.0605611160223
28269.6289.878788713588-20.1942005000934269.51541178650620.2787887135877
29253.9254.037024385954-19.2803886192554273.0433642333010.137024385954021
30258.6255.103212150484-12.2718611693765274.368649018892-3.49678784951584
31274.2275.769401930601-3.06333573508466275.6939338044831.56940193060126
32301.5316.82542862784910.9157211484992275.25885022365215.3254286278493
33304.5317.34145899546216.8347743617181274.82376664282012.8414589954623
34285.1286.5947240570339.6627377275261273.9425382154411.49472405703278
35287.7285.94797359110516.3907166208327273.061309788063-1.75202640889529
36265.5242.57931781456215.3988661361994273.021816049238-22.9206821854376
37264.1249.1908178349966.02685985459014272.982322310414-14.9091821650038
38276.1285.312486673218-6.27184026099176273.1593535877749.21248667321805
39258.9258.611635590598-14.1480204557324273.336384865134-0.288364409401481
40239.1225.162789496661-20.1942005000934273.231411003432-13.9372105033385
41250.1246.353951477525-19.2803886192554273.12643714173-3.74604852247478
42276.8294.487511162009-12.2718611693765271.38435000736717.6875111620092
43297.6328.62107286208-3.06333573508466269.64226287300431.0210728620803
44295.4316.06795356004410.9157211484992263.81632529145720.6679535600435
45283291.17483792837216.8347743617181257.990387709918.17483792837169
46275.8294.2164797653389.6627377275261247.72078250713618.416479765338
47279.7305.55810607480616.3907166208327237.45117730436225.8581060748058
48254.6269.47725087217415.3988661361994224.32388299162714.8772508721738
49234.6251.9765514665186.02685985459014211.19658867889217.3765514665179
50176.9162.047529894875-6.27184026099176198.024310366117-14.8524701051248
51148.1125.495988402391-14.1480204557324184.852032053341-22.6040115976089
52122.788.6917949880213-20.1942005000934176.902405512072-34.0082050119787
53124.9100.127609648452-19.2803886192554168.952778970803-24.7723903515476
54121.689.5536760072704-12.2718611693765165.918185162106-32.0463239927296
55128.496.9797443816753-3.06333573508466162.883591353409-31.4202556183247
56144.5117.67989538213210.9157211484992160.404383469369-26.8201046178681
57151.8128.84005005295316.8347743617181157.925175585328-22.9599499470465
58167.1168.2400193104399.6627377275261156.2972429620351.14001931043933
59173.8176.53997304042716.3907166208327154.6693103387412.73997304042658
60203.7237.8822281606515.3988661361994154.11890570315134.1822281606499
61199.8240.0046390778496.02685985459014153.56850106756140.2046390778491
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259928568ssqsbtoafks21cv/10swe1259928509.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259928568ssqsbtoafks21cv/10swe1259928509.ps (open in new window)


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


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


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