Home » date » 2009 » Dec » 04 »

review 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 03:31:35 -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/t1259922846qa4kl908q825sb7.htm/, Retrieved Fri, 04 Dec 2009 11:34:11 +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/t1259922846qa4kl908q825sb7.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 «
12.610 10.862 52.929 56.902 81.776 87.876 82.103 72.846 60.632 33.521 15.342 7.758 8.668 13.082 38.157 58.263 81.153 88.476 72.329 75.845 61.108 37.665 12.755 2.793 12.935 19.533 33.404 52.074 70.735 69.702 61.656 82.993 53.990 32.283 15.686 2.713 12.842 19.244 48.488 54.464 84.192 84.458 85.793 75.163 68.212 49.233 24.302 5.402 15.058 33.559 70.358 85.934 94.452 129.305 113.882 107.256 94.274 57.842 26.611 14.521
 
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
112.6114.0584286999257-37.365440190827348.52701149090161.44842869992573
210.8624.36898896743465-30.983513706752448.3385247393178-6.49301103256535
352.92959.7317578843913-2.0237958721251748.15003798773396.80275788439126
456.90255.125247007401510.705189167051547.973563825547-1.77675299259854
581.77684.246736283072931.50817405356747.79708966336012.47073628307286
687.87687.261826988208840.853703112584947.6364698992063-0.614173011791202
782.10384.843506208455831.886643656491847.47585013505242.74050620845576
872.84667.197932963175831.190103323824747.3039637129995-5.64806703682424
960.63258.483772347344215.648150361709247.1320772909466-2.1482276526558
1033.52130.5473503066624-10.398977377941546.8936270712792-2.97364969333763
1115.34218.1101315942980-34.081308445909846.65517685161172.76813159429803
127.75815.9346298368019-46.938933476192446.52030363939068.17662983680187
138.6688.31600976365794-37.365440190827346.3854304271694-0.351990236342061
1413.08210.8461546352834-30.983513706752446.301359071469-2.23584536471656
1538.15732.1205081563566-2.0237958721251746.2172877157685-6.03649184364338
1658.26359.691576522913310.705189167051546.12923431003521.42857652291329
1781.15384.756645042131231.50817405356746.04118090430183.60364504213117
1888.47690.006690077334240.853703112584946.09160681008081.53069007733423
1972.32966.629323627648331.886643656491846.1420327158598-5.69967637235167
2075.84574.28434150533131.190103323824746.2155551708443-1.56065849466903
2161.10860.278772012462115.648150361709246.2890776258287-0.82922798753792
2237.66539.8179275478828-10.398977377941545.91104983005872.15292754788280
2312.75514.0582864116210-34.081308445909845.53302203428881.30328641162102
242.7937.80808403188616-46.938933476192444.71684944430635.01508403188616
2512.93519.3347633365036-37.365440190827343.90067685432386.39976333650355
2619.53326.8212045742047-30.983513706752443.22830913254777.2882045742047
2733.40426.2758544613535-2.0237958721251742.5559414107717-7.12814553864649
2852.07451.322618033814210.705189167051542.1201927991343-0.751381966185811
2970.73568.277381758936131.50817405356741.6844441874969-2.45761824106393
3069.70256.860037972106940.853703112584941.6902589153082-12.8419620278931
3161.65649.729282700388731.886643656491841.6960736431195-11.9267172996113
3282.99392.530087521370231.190103323824742.2658091548059.53708752137024
3353.9949.496304971800315.648150361709242.8355446664906-4.49369502819974
3432.28331.0921842084374-10.398977377941543.8727931695042-1.19081579156263
3515.68620.5432667733920-34.081308445909844.91004167251784.85726677339196
362.7136.40367270169268-46.938933476192445.96126077449983.69067270169268
3712.84216.0369603143456-37.365440190827347.01247987648173.19496031434562
3819.24421.6992090315541-30.983513706752447.77230467519832.4552090315541
3948.48850.4676663982103-2.0237958721251748.53212947391491.97966639821026
4054.46449.031824123519510.705189167051549.190986709429-5.43217587648054
4184.19287.025982001489931.50817405356749.84984394494312.83398200148987
4284.45877.587187857525940.853703112584950.4751090298891-6.87081214247407
4385.79388.59898222867331.886643656491851.10037411483512.80598222867302
4475.16366.899431484892631.190103323824752.2364651912827-8.2635685151074
4568.21267.403293370560615.648150361709253.3725562677302-0.808706629439364
4649.23353.6027070269077-10.398977377941555.26227035103384.36970702690769
4724.30225.5333240115723-34.081308445909857.15198443433751.23132401157226
485.402-1.91091190368085-46.938933476192459.6538453798733-7.31291190368085
4915.0585.32573386541827-37.365440190827362.1557063254091-9.73226613458173
5033.55933.5116158043584-30.983513706752464.589897902394-0.0473841956415981
5170.35875.7157063927462-2.0237958721251767.0240894793795.35770639274622
5285.93493.200049021597110.705189167051567.96276181135147.26604902159713
5394.45288.494391803109231.50817405356768.9014341433238-5.95760819689077
54129.305148.18914015324940.853703112584969.56715673416618.8841401532490
55113.882125.644477018531.886643656491870.232879325008211.7624770184999
56107.256112.47809008080131.190103323824770.84380659537475.22209008080056
5794.274101.44511577255015.648150361709271.45473386574127.17111577254965
5857.84254.2025935876946-10.398977377941571.8803837902469-3.63940641230538
5926.61114.9972747311571-34.081308445909872.3060337147527-11.6137252688429
6014.5213.45342772496797-46.938933476192472.5275057512245-11.0675722750320
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259922846qa4kl908q825sb7/1c6u51259922693.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259922846qa4kl908q825sb7/1c6u51259922693.ps (open in new window)


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


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


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