Home » date » 2009 » Dec » 04 »

workshop 9,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 12:07:56 -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/t1259953742lthcgi307xllj9q.htm/, Retrieved Fri, 04 Dec 2009 20:09:07 +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/t1259953742lthcgi307xllj9q.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 «
611 594 595 591 589 584 573 567 569 621 629 628 612 595 597 593 590 580 574 573 573 620 626 620 588 566 557 561 549 532 526 511 499 555 565 542 527 510 514 517 508 493 490 469 478 528 534 518 506 502 516 528 533 536 537 524 536 587 597 581 564
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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
1611618.7988545997946.34954019660031596.8516052036067.79885459979391
2594597.142902481602-5.78724544116946596.6443429595683.14290248160160
3595596.287994831045-2.72507554657562596.437080715531.28799483104547
4591585.6450966181000.0181555196385236596.336747862262-5.3549033819005
5589585.402202510984-3.63861751997770596.236415008994-3.59779748901622
6584583.632852524011-11.8218345203432596.188981996332-0.367147475988759
7573566.063495818409-16.2050448020788596.14154898367-6.93650418159086
8567564.829938725721-26.9494037087926596.119464983072-2.17006127427931
9569566.196385241187-24.2937662236608596.097380982474-2.80361475881330
10621618.57550538019727.0654728788189596.359021740984-2.42449461980289
11629626.15462639014135.2247111103648596.620662499494-2.84537360985871
12628636.48211326069922.7631054159264596.7547813233748.4821132606994
13612620.7615596561456.34954019660031596.8889001472558.76155965614521
14595598.840092449808-5.78724544116946596.9471529913613.84009244980837
15597599.719669711108-2.72507554657562597.0054058354682.71966971110783
16593589.242962647880.0181555196385236596.738881832481-3.75703735211971
17590587.166259690483-3.63861751997770596.472357829495-2.833740309517
18580576.309440055822-11.8218345203432595.512394464521-3.69055994417806
19574569.652613702531-16.2050448020788594.552431099548-4.3473862974688
20573580.361926197871-26.9494037087926592.5874775109227.36192619787073
21573579.671242301365-24.2937662236608590.6225239222966.6712423013646
22620625.26165253595627.0654728788189587.6728745852255.26165253595639
23626632.05206364148235.2247111103648584.7232252481536.05206364148205
24620636.60815893310322.7631054159264580.62873565097116.6081589331030
25588593.1162137496126.34954019660031576.5342460537885.1162137496118
26566566.520173619094-5.78724544116946571.2670718220760.520173619093839
27557550.725177956212-2.72507554657562565.999897590364-6.27482204378794
28561561.7977419844100.0181555196385236560.1841024959520.797741984409527
29549547.270310118437-3.63861751997770554.36830740154-1.72968988156276
30532526.963321785848-11.8218345203432548.858512734495-5.03667821415229
31526524.856326734629-16.2050448020788543.34871806745-1.14367326537138
32511510.163573308536-26.9494037087926538.785830400257-0.836426691464453
33499488.070823490597-24.2937662236608534.222942733064-10.9291765094031
34555552.35803001657427.0654728788189530.576497104607-2.64196998342629
35565567.84523741348435.2247111103648526.9300514761512.84523741348448
36542537.41689859309722.7631054159264523.819995990977-4.58310140690298
37527526.9405192975976.34954019660031520.709940505803-0.0594807024028796
38510507.811112871392-5.78724544116946517.976132569778-2.18888712860826
39514515.482750912823-2.72507554657562515.2423246337531.48275091282267
40517521.1325808823880.0181555196385236512.8492635979734.13258088238831
41508509.182414957784-3.63861751997770510.4562025621931.18241495778432
42493489.384291015867-11.8218345203432508.437543504476-3.61570898413294
43490489.78616035532-16.2050448020788506.418884446759-0.213839644680036
44469459.479724674212-26.9494037087926505.46967903458-9.52027532578785
45478475.773292601259-24.2937662236608504.520473622402-2.22670739874127
46528523.50337711227227.0654728788189505.431150008909-4.49662288772777
47534526.4334624942235.2247111103648506.341826395416-7.56653750578039
48518503.78931607352622.7631054159264509.447578510548-14.2106839264744
49506493.0971291777196.34954019660031512.55333062568-12.9028708222805
50502492.527707616618-5.78724544116946517.259537824552-9.47229238338218
51516512.759330523152-2.72507554657562521.965745023423-3.24066947684753
52528528.7004102413680.0181555196385236527.2814342389940.700410241367649
53533537.041494065413-3.63861751997770532.5971234545654.04149406541319
54536546.383112196987-11.8218345203432537.43872232335710.3831121969866
55537547.92472360993-16.2050448020788542.28032119214810.9247236099304
56524527.838979510421-26.9494037087926547.1104241983723.8389795104207
57536544.353239019065-24.2937662236608551.9405272045958.35323901906531
58587590.25879682266027.0654728788189556.6757302985223.25879682265952
59597597.36435549718835.2247111103648561.4109333924480.364355497187717
60581573.29388285184622.7631054159264565.943011732228-7.70611714815402
61564551.1753697313926.34954019660031570.475090072008-12.8246302686080
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259953742lthcgi307xllj9q/1wo3a1259953674.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259953742lthcgi307xllj9q/1wo3a1259953674.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259953742lthcgi307xllj9q/4a2p01259953674.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259953742lthcgi307xllj9q/4a2p01259953674.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = periodic ; par3 = 1 ; par5 = 1 ; par7 = 1 ; par8 = FALSE ;
 
Parameters (R input):
par1 = 12 ; par2 = periodic ; par3 = 1 ; 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