Home » date » 2010 » Dec » 18 »

Seasonal decomposition by Loess

*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: Sat, 18 Dec 2010 20:12:18 +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/18/t12927030004a2k5cosdefe2cn.htm/, Retrieved Sat, 18 Dec 2010 21:10:02 +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/18/t12927030004a2k5cosdefe2cn.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 «
27951 29781 32914 33488 35652 36488 35387 35676 34844 32447 31068 29010 29812 30951 32974 32936 34012 32946 31948 30599 27691 25073 23406 22248 22896 25317 26558 26471 27543 26198 24725 25005 23462 20780 19815 19761 21454 23899 24939 23580 24562 24696 23785 23812 21917 19713 19282 18788 21453 24482 27474 27264 27349 30632 29429 30084 26290 24379 23335 21346 21106 24514 28353 30805 31348 34556 33855 34787 32529 29998 29257 28155 30466 35704 39327 39351 42234 43630 43722 43121 37985 37135 34646 33026 35087 38846 42013 43908 42868 44423 44167 43636 44382 42142 43452 36912 42413 45344 44873 47510 49554 47369 45998 48140 48441 44928 40454 38661 37246 36843 36424 37594 38144 38737 34560 36080 33508 35462 33374 32110 35533 35532 37903 36763 40399 44164 44496 43110 43880 43930 44327
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
12795127494.6532216489-3271.3447773418331678.691555693-456.346778351122
22978128695.942305178-1022.0821802226931888.1398750447-1085.05769482198
33291432799.3235422317931.08826337194532097.5881943964-114.676457768328
43348833315.35443454121379.5985293244432281.0470361343-172.645565458781
53565236277.11391090432562.3802112234232464.5058778723625.113910904285
63648836951.19956540813400.3663935469932624.4340410449463.199565408147
73538735745.92156772612243.7162280564832784.3622042174358.921567726087
83567636108.65238996092316.1627825488232927.1848274903432.652389960916
93484436147.4755713929470.51697784402733070.00745076311303.47557139288
103244733211.0649194411-1384.9629549096133067.8980354685764.064919441116
113106831822.3809466073-2752.1695667812233065.7886201739754.380946607336
122901030079.7027943594-4873.2694300969332813.56663573751069.70279435943
132981230334.0001260407-3271.3447773418332561.3446513011522.000126040704
143095130808.3878376382-1022.0821802226932115.6943425844-142.612162361751
153297433346.8677027603931.08826337194531670.0440338678372.867702760297
163293633415.47023780511379.5985293244431076.9312328705479.470237805061
173401234977.80135690342562.3802112234230483.8184318732965.801356903346
183294632616.57121057563400.3663935469929875.0623958774-329.428789424419
193194832385.97741206192243.7162280564829266.3063598816437.977412061897
203059930175.29260526882316.1627825488228706.5446121824-423.707394731224
212769126764.7001576728470.51697784402728146.7828644832-926.299842327211
222507323910.1253916822-1384.9629549096127620.8375632274-1162.87460831779
232340622469.2773048096-2752.1695667812227094.8922619716-936.722695190387
242224822783.1813956968-4873.2694300969326586.0880344001535.181395696825
252289622986.0609705132-3271.3447773418326077.283806828690.0609705132338
262531726032.3730504758-1022.0821802226925623.7091297469715.373050475806
272655827014.7772839629931.08826337194525170.1344526652456.777283962878
282647126769.95044210611379.5985293244424792.4510285694298.95044210611
292754328108.85218430292562.3802112234224414.7676044737565.852184302857
302619824846.30423924443400.3663935469924149.3293672086-1351.69576075561
312472523322.3926422243.7162280564823883.8911299435-1402.60735799999
322500523963.64572148752316.1627825488223730.1914959636-1041.35427851245
332346222876.9911601722470.51697784402723576.4918619838-585.008839827784
342078019479.4245779142-1384.9629549096123465.5383769954-1300.57542208584
351981519027.5846747741-2752.1695667812223354.5848920071-787.415325225924
361976121145.0298408636-4873.2694300969323250.23958923331384.02984086359
372145423033.4504908823-3271.3447773418323145.89428645951579.45049088231
382389925791.0502594933-1022.0821802226923029.03192072941892.05025949333
392493926034.7421816288931.08826337194522912.16955499921095.74218162885
402358023018.64041567131379.5985293244422761.7610550043-561.359584328744
412456223950.26723376722562.3802112234222611.3525550094-611.732766232813
422469623480.63657517343400.3663935469922510.9970312796-1215.36342482656
432378522915.64226439382243.7162280564822410.6415075497-869.357735606227
442381222809.525862382316.1627825488222498.3113550712-1002.47413761999
452191720777.5018195634470.51697784402722585.9812025926-1139.49818043662
461971317920.5008549678-1384.9629549096122890.4620999418-1792.49914503223
471928218121.2265694901-2752.1695667812223194.9429972911-1160.77343050986
481878818803.1488447357-4873.2694300969323646.120585361215.148844735726
492145322080.0466039105-3271.3447773418324097.2981734313627.046603910512
502448225409.095947951-1022.0821802226924576.9862322717927.095947951013
512747428960.237445516931.08826337194525056.6742911121486.23744551601
522726427719.61804149671379.5985293244425428.7834291789455.61804149668
532734926334.72722153092562.3802112234225800.8925672457-1014.27277846913
543063231898.96527949833400.3663935469925964.66832695471266.96527949828
552942930485.83968527982243.7162280564826128.44408666381056.83968527976
563008431665.25899667212316.1627825488226186.5782207791581.25899667214
572629025864.7706672617470.51697784402726244.7123548943-425.229332738349
582437923752.8861924726-1384.9629549096126390.076762437-626.113807527421
592333522886.7283968015-2752.1695667812226535.4411699797-448.271603198515
602134620721.6154493907-4873.2694300969326843.6539807062-624.38455060928
612110618331.4779859092-3271.3447773418327151.8667914327-2774.52201409085
622451422443.5456741271-1022.0821802226927606.5365060956-2070.4543258729
632835327713.7055158695931.08826337194528061.2062207585-639.294484130456
643080531597.03767488761379.5985293244428633.3637957879792.037674887612
653134830928.09841795922562.3802112234229205.5213708174-419.901582040799
663455635849.07911614643400.3663935469929862.55449030661293.07911614643
673385534946.69616214772243.7162280564830519.58760979581091.69616214775
683478735980.08561527192316.1627825488231277.75160217931193.08561527188
693252932551.5674275932470.51697784402732035.915594562822.567427593156
702999828556.7230175878-1384.9629549096132824.2399373218-1441.27698241219
712925727653.6052867004-2752.1695667812233612.5642800808-1603.39471329956
722815526760.4542934808-4873.2694300969334422.8151366161-1394.54570651922
733046628970.2787841903-3271.3447773418335233.0659931515-1495.72121580967
743570436442.4389445552-1022.0821802226935987.6432356675738.43894455523
753932740980.6912584446931.08826337194536742.22047818341653.69125844463
763935139980.06572613941379.5985293244437342.3357445362629.065726139372
774223443963.16877788762562.3802112234237942.4510108891729.16877788763
784363045540.7230626823400.3663935469938318.9105437711910.72306268199
794372246504.91369529042243.7162280564838695.37007665312782.91369529043
804312145014.53372001022316.1627825488238911.3034974411893.53372001016
813798536372.246103927470.51697784402739127.236918229-1612.75389607299
823713536388.8340994395-1384.9629549096139266.1288554701-746.165900560467
833464632639.14877407-2752.1695667812239405.0207927112-2006.85122592997
843302631391.0212571088-4873.2694300969339534.2481729882-1634.97874289122
853508733781.8692240767-3271.3447773418339663.4755532651-1305.13077592329
863884638788.7403842079-1022.0821802226939925.3417960148-57.2596157921216
874201342907.7036978635931.08826337194540187.2080387645894.703697863544
884390845779.69107945531379.5985293244440656.71039122021871.69107945535
894286842047.40704510072562.3802112234241126.2127436759-820.59295489933
904442343812.35091293093400.3663935469941633.2826935221-610.649087069061
914416743949.93112857532243.7162280564842140.3526433682-217.068871424715
924363642373.56695277932316.1627825488242582.2702646719-1262.43304722074
934438245269.2951361804470.51697784402743024.1878859756887.295136180372
944214242246.2986938028-1384.9629549096143422.6642611068104.298693802783
954345245835.0289305432-2752.1695667812243821.1406362382383.02893054317
963691234542.8439622502-4873.2694300969344154.4254678467-2369.15603774976
974241343609.6344778865-3271.3447773418344487.71029945531196.6344778865
984534446966.1997224578-1022.0821802226944743.88245776491622.19972245782
994487343814.8571205536931.08826337194545000.0546160744-1058.14287944637
1004751048509.74774629821379.5985293244445130.6537243773999.747746298213
1014955451284.36695609632562.3802112234245261.25283268031730.36695609631
1024736946195.99127515783400.3663935469945141.6423312952-1173.00872484217
1034599844730.25194203342243.7162280564845022.0318299101-1267.74805796656
1044814049451.69345140872316.1627825488244512.14376604241311.69345140874
1054844152409.2273199812470.51697784402744002.25570217483968.22731998118
1064492848036.4114763526-1384.9629549096143204.5514785573108.41147635261
1074045441253.322311842-2752.1695667812242406.8472549392799.322311842021
1083866140772.9085772384-4873.2694300969341422.36085285862111.90857723836
1093724637325.4703265639-3271.3447773418340437.87445077879.4703265638673
1103684335343.5059891764-1022.0821802226939364.5761910463-1499.49401082357
1113642433625.6338053135931.08826337194538291.2779313146-2798.3661946865
1123759436407.46949880721379.5985293244437400.9319718684-1186.53050119281
1133814437215.03377635442562.3802112234236510.5860124222-928.9662236456
1143873737990.96396631333400.3663935469936082.6696401397-746.036033686738
1153456031221.53050408622243.7162280564835654.7532678573-3338.4694959138
1163608034243.97076229082316.1627825488235599.8664551604-1836.02923770918
1173350831000.5033796926470.51697784402735544.9796424634-2507.49662030742
1183546236589.6601974299-1384.9629549096135719.30275747971127.66019742993
1193337433606.5436942853-2752.1695667812235893.625872496232.543694285254
1203211032768.2007177203-4873.2694300969336325.0687123767658.200717720269
1213553337580.8332250845-3271.3447773418336756.51155225742047.83322508447
1223553234631.9432327838-1022.0821802226937454.1389474389-900.056767216192
1233790336723.1453940076931.08826337194538151.7663426204-1179.85460599235
1243676333157.47337451461379.5985293244438988.928096161-3605.52662548544
1254039938409.5299390752562.3802112234239826.0898497016-1989.47006092503
1264416444255.866515333400.3663935469940671.767091123191.866515329959
1274449645230.8394393992243.7162280564841517.4443325445734.839439399031
1284311041513.24880733392316.1627825488242390.5884101172-1596.75119266606
1294388044025.750534466470.51697784402743263.73248769145.750534465988
1304393045069.2156293439-1384.9629549096144175.74732556571139.21562934394
1314432746318.4074033399-2752.1695667812245087.76216344141991.40740333986
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/19cta1292703133.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/19cta1292703133.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/21lau1292703133.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/21lau1292703133.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/31lau1292703133.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/31lau1292703133.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/4uusf1292703133.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12927030004a2k5cosdefe2cn/4uusf1292703133.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