Home » date » 2010 » Dec » 08 »

workshop 8: minitutorial link 2

*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, 08 Dec 2010 18:31:15 +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/08/t1291833018wjsgh4z091fy1rd.htm/, Retrieved Wed, 08 Dec 2010 19:30:22 +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/08/t1291833018wjsgh4z091fy1rd.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 «
33 24 24 31 25 28 24 25 16 17 11 12 39 19 14 15 7 12 12 14 9 8 4 7 3 5 0 -2 6 11 9 17 21 21 41 57 65 68 73 71 71 70 69 65 57 57 57 55 65 65 64 60 43 47 40 31 27 24 23 17
 
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
Seasonal601061
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
13331.53715988506689.2082579901436925.2545821247896-1.46284011493324
22418.79675828363034.3150378881544424.8882038282153-5.20324171636974
32420.45635838131773.0218160870412924.5218255316410-3.54364161868232
43134.85106209742883.0749373788458124.07400052372543.85106209742879
52527.8457573179282-1.4719328337379723.62617551580972.84575731792822
62831.08607656471971.7778387302362123.13608470504413.08607656471967
72426.3263935895829-0.97238748386138322.64599389427852.32639358958290
82529.2073232952766-1.3545029080907222.14717961281414.20732329527663
91616.0882541772854-5.7366195086351121.64836533134970.0882541772854104
101719.4767033262173-6.1872675982630320.71056427204582.47670332621727
11116.46514633216691-4.2379095449087419.7727632127418-4.53485366783309
12126.9703336609976-1.4372731397550218.4669394787574-5.02966633900241
133951.63062626508339.2082579901436917.161115744773012.6306262650833
141917.49206684759174.3150378881544416.1928952642539-1.50793315240834
15149.753509129223953.0218160870412915.2246747837348-4.24649087077605
161512.43217038336393.0749373788458114.4928922377903-2.56782961663610
1771.71082314189215-1.4719328337379713.7611096918458-5.28917685810785
18129.456334993099461.7778387302362112.7658262766643-2.54366500690054
191213.2018446223786-0.97238748386138311.77054286148281.20184462237856
201418.8886907783142-1.3545029080907210.46581212977654.88869077831423
21914.5755381105650-5.736619508635119.161081398070155.57553811056495
22814.0986861320013-6.187267598263038.088581466261786.09868613200126
2345.22182801045534-4.237909544908747.01608153445341.22182801045534
2479.04573788297661-1.437273139755026.391535256778412.04573788297661
253-8.975246969247119.208257990143695.76698897910343-11.9752469692471
265-0.2822195960433534.315037888154445.96718170788891-5.28221959604335
270-9.189190523715673.021816087041296.16737443667439-9.18919052371567
28-2-15.07700828937313.074937378845818.00207091052731-13.0770082893731
2963.63516544935774-1.471932833737979.83676738438023-2.36483455064226
30116.374435447636041.7778387302362113.8477258221277-4.62556455236396
3191.11370322398612-0.97238748386138317.8586842598753-7.88629677601388
321711.9005482822906-1.3545029080907223.4539546258001-5.09945171770942
332118.6873945169101-5.7366195086351129.049224991725-2.31260548308991
342113.1546811636552-6.1872675982630335.0325864346078-7.84531883634481
354145.2219616674181-4.2379095449087441.01594787749074.22196166741808
365769.0390431609997-1.4372731397550246.398229978755312.0390431609997
376569.01122992983639.2082579901436951.780512080024.01122992983633
386875.83484811812624.3150378881544455.85011399371947.8348481181262
397383.058468005543.0218160870412959.919715907418710.05846800554
407176.77964881624993.0749373788458162.14541380490435.7796488162499
417179.1008211313481-1.4719328337379764.37111170238998.10082113134811
427073.43061616343871.7778387302362164.79154510632513.43061616343867
436973.760408973601-0.97238748386138365.21197851026044.76040897360099
446566.7416207942629-1.3545029080907264.61288211382791.74162079426287
455755.7228337912398-5.7366195086351164.0137857173953-1.27716620876019
465757.47728928958-6.1872675982630362.7099783086830.477289289580021
475756.831738644938-4.2379095449087461.4061708999707-0.168261355061979
485551.9708605803614-1.4372731397550259.4664125593936-3.02913941963858
496563.26508779103989.2082579901436957.5266542188165-1.73491220896015
506570.61434285465244.3150378881544455.07061925719325.61434285465241
516472.36359961738893.0218160870412952.61458429556988.36359961738888
526067.47873296049663.0749373788458149.44632966065767.47873296049661
534341.1938578079927-1.4719328337379746.2780750257453-1.80614219200735
544749.20876339519451.7778387302362143.01339787456932.20876339519453
554041.2236667604682-0.97238748386138339.74872072339321.22366676046819
563126.9772570235086-1.3545029080907236.3772458845821-4.0227429764914
572726.7308484628640-5.7366195086351133.0057710457711-0.269151537135954
582424.6508693742688-6.1872675982630329.53639822399420.650869374268805
592324.1708841426914-4.2379095449087426.06702540221741.17088414269136
601712.9000768115948-1.4372731397550222.5371963281602-4.09992318840519
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/1clyf1291833070.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/1clyf1291833070.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/2clyf1291833070.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/2clyf1291833070.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/35ufi1291833070.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/35ufi1291833070.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/45ufi1291833070.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/08/t1291833018wjsgh4z091fy1rd/45ufi1291833070.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