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:13:39 +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/t1292703091zvcijsu50l0est3.htm/, Retrieved Sat, 18 Dec 2010 21:11:36 +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/t1292703091zvcijsu50l0est3.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'George Udny Yule' @ 72.249.76.132


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
12795127494.6532216489-3271.3447773418331678.6915556929-456.346778351108
22978128695.942305178-1022.0821802227031888.1398750447-1085.05769482198
33291432799.3235422317931.08826337194332097.5881943964-114.676457768350
43348833315.35443454121379.5985293244432281.0470361343-172.645565458781
53565236277.11391090432562.3802112234132464.5058778723625.1139109043
63648836951.19956540823400.3663935469832624.4340410449463.199565408166
73538735745.92156772612243.7162280564732784.3622042174358.921567726109
83567636108.65238996092316.1627825488132927.1848274903432.652389960931
93484436147.4755713929470.51697784401533070.00745076311303.47557139288
103244733211.0649194411-1384.9629549095933067.8980354685764.064919441109
113106831822.3809466073-2752.1695667811833065.7886201739754.380946607322
122901030079.7027943594-4873.2694300969332813.56663573751069.70279435944
132981230334.0001260407-3271.3447773418332561.3446513011522.000126040712
143095130808.3878376383-1022.0821802227032115.6943425844-142.612162361736
153297433346.8677027603931.08826337194331670.0440338677372.867702760312
163293633415.47023780511379.5985293244431076.9312328705479.470237805079
173401234977.80135690342562.3802112234130483.8184318732965.80135690336
183294632616.57121057563400.3663935469829875.0623958774-329.428789424401
193194832385.97741206192243.7162280564729266.3063598816437.977412061919
203059930175.29260526882316.1627825488128706.5446121824-423.707394731206
212769126764.7001576728470.51697784401528146.7828644832-926.299842327186
222507323910.1253916822-1384.9629549095927620.8375632274-1162.87460831779
232340622469.2773048096-2752.1695667811827094.8922619716-936.72269519042
242224822783.1813956968-4873.2694300969326586.0880344001535.181395696833
252289622986.0609705132-3271.3447773418326077.283806828690.0609705132374
262531726032.3730504758-1022.0821802227025623.7091297469715.37305047582
272655827014.7772839629931.08826337194325170.1344526652456.7772839629
282647126769.95044210611379.5985293244424792.4510285694298.950442106125
292754328108.85218430292562.3802112234124414.7676044737565.852184302868
302619824846.30423924443400.3663935469824149.3293672086-1351.6957607556
312472523322.3926422243.7162280564723883.8911299435-1402.60735799998
322500523963.64572148762316.1627825488123730.1914959636-1041.35427851244
332346222876.9911601722470.51697784401523576.4918619837-585.008839827762
342078019479.4245779142-1384.9629549095923465.5383769954-1300.57542208585
351981519027.5846747740-2752.1695667811823354.5848920071-787.415325225953
361976121145.0298408636-4873.2694300969323250.23958923331384.0298408636
372145423033.4504908823-3271.3447773418323145.89428645951579.45049088231
382389925791.0502594933-1022.0821802227023029.03192072941892.05025949334
392493926034.7421816289931.08826337194322912.16955499921095.74218162886
402358023018.64041567131379.5985293244422761.7610550043-561.35958432873
412456223950.26723376722562.3802112234122611.3525550094-611.732766232799
422469623480.63657517343400.3663935469822510.9970312796-1215.36342482655
432378522915.64226439382243.7162280564722410.6415075497-869.35773560622
442381222809.525862382316.1627825488122498.3113550712-1002.47413761998
452191720777.5018195634470.51697784401522585.9812025926-1139.49818043660
461971317920.5008549678-1384.9629549095922890.4620999418-1792.49914503224
471928218121.2265694901-2752.1695667811823194.9429972911-1160.77343050990
481878818803.1488447357-4873.2694300969323646.120585361215.1488447357333
492145322080.0466039105-3271.3447773418324097.2981734313627.04660391052
502448225409.095947951-1022.0821802227024576.9862322717927.095947951017
512747428960.237445516931.08826337194325056.67429111201486.23744551601
522726427719.61804149671379.5985293244425428.7834291789455.618041496684
532734926334.72722153092562.3802112234125800.8925672457-1014.27277846912
543063231898.96527949833400.3663935469825964.66832695471266.96527949828
552942930485.83968527982243.7162280564726128.44408666381056.83968527977
563008431665.25899667212316.1627825488126186.57822077901581.25899667215
572629025864.7706672617470.51697784401526244.7123548943-425.229332738330
582437923752.8861924726-1384.9629549095926390.076762437-626.113807527425
592333522886.7283968015-2752.1695667811826535.4411699797-448.271603198544
602134620721.6154493907-4873.2694300969326843.6539807062-624.384550609269
612110618331.4779859092-3271.3447773418327151.8667914327-2774.52201409084
622451422443.5456741271-1022.0821802227027606.5365060956-2070.4543258729
632835327713.7055158695931.08826337194328061.2062207585-639.29448413046
643080531597.03767488761379.5985293244428633.3637957880792.037674887612
653134830928.09841795922562.3802112234129205.5213708174-419.901582040799
663455635849.07911614643400.3663935469829862.55449030661293.07911614643
673385534946.69616214782243.7162280564730519.58760979581091.69616214775
683478735980.08561527192316.1627825488131277.75160217931193.08561527188
693252932551.5674275932470.51697784401532035.915594562822.567427593156
702999828556.7230175878-1384.9629549095932824.2399373218-1441.27698241221
712925727653.6052867004-2752.1695667811833612.5642800808-1603.39471329961
722815526760.4542934808-4873.2694300969334422.8151366161-1394.54570651922
733046628970.2787841903-3271.3447773418335233.0659931515-1495.72121580967
743570436442.4389445552-1022.0821802227035987.6432356675738.43894455523
753932740980.6912584446931.08826337194336742.22047818341653.69125844463
763935139980.06572613941379.5985293244437342.3357445362629.065726139379
774223443963.16877788762562.3802112234137942.45101088891729.16877788764
784363045540.7230626823400.3663935469838318.9105437711910.72306268200
794372246504.91369529042243.7162280564738695.37007665312782.91369529044
804312145014.53372001022316.1627825488138911.3034974411893.53372001017
813798536372.246103927470.51697784401539127.2369182289-1612.75389607297
823713536388.8340994395-1384.9629549095939266.1288554701-746.165900560467
833464632639.14877407-2752.1695667811839405.0207927112-2006.85122592999
843302631391.0212571088-4873.2694300969339534.2481729881-1634.97874289121
853508733781.8692240767-3271.3447773418339663.4755532651-1305.13077592328
863884638788.7403842079-1022.0821802227039925.3417960148-57.2596157921143
874201342907.7036978636931.08826337194340187.2080387645894.703697863551
884390845779.69107945531379.5985293244440656.71039122021871.69107945535
894286842047.40704510072562.3802112234141126.2127436759-820.59295489933
904442343812.35091293103400.3663935469841633.2826935221-610.649087069047
914416743949.93112857532243.7162280564742140.3526433682-217.068871424693
924363642373.56695277932316.1627825488142582.2702646719-1262.43304722072
934438245269.2951361804470.51697784401543024.1878859756887.295136180386
944214242246.2986938028-1384.9629549095943422.6642611068104.298693802768
954345245835.0289305431-2752.1695667811843821.1406362382383.02893054314
963691234542.8439622502-4873.2694300969344154.4254678467-2369.15603774976
974241343609.6344778865-3271.3447773418344487.71029945531196.63447788650
984534446966.1997224578-1022.0821802227044743.88245776491622.19972245782
994487343814.8571205536931.08826337194345000.0546160744-1058.14287944636
1004751048509.74774629821379.5985293244445130.6537243773999.747746298228
1014955451284.36695609632562.3802112234145261.25283268031730.36695609633
1024736946195.99127515793400.3663935469845141.6423312952-1173.00872484215
1034599844730.25194203352243.7162280564745022.0318299101-1267.74805796654
1044814049451.69345140882316.1627825488144512.14376604241311.69345140876
1054844152409.2273199812470.51697784401544002.25570217483968.2273199812
1064492848036.4114763526-1384.9629549095943204.5514785573108.41147635262
1074045441253.322311842-2752.1695667811842406.8472549392799.322311842036
1083866140772.9085772384-4873.2694300969341422.36085285852111.9085772384
1093724637325.4703265639-3271.3447773418340437.874450777979.470326563911
1103684335343.5059891765-1022.0821802227039364.5761910462-1499.49401082352
1113642433625.6338053135931.08826337194338291.2779313145-2798.36619468646
1123759436407.46949880721379.5985293244437400.9319718683-1186.53050119278
1133814437215.03377635442562.3802112234136510.5860124222-928.96622364557
1143873737990.96396631333400.3663935469836082.6696401397-746.036033686716
1153456031221.53050408622243.7162280564735654.7532678573-3338.46949591379
1163608034243.97076229082316.1627825488135599.8664551604-1836.02923770916
1173350831000.5033796926470.51697784401535544.9796424634-2507.49662030741
1183546236589.6601974299-1384.9629549095935719.30275747971127.66019742992
1193337433606.5436942852-2752.1695667811835893.625872496232.543694285225
1203211032768.2007177203-4873.2694300969336325.0687123767658.200717720261
1213553337580.8332250844-3271.3447773418336756.51155225742047.83322508445
1223553234631.9432327838-1022.0821802227037454.1389474389-900.0567672162
1233790336723.1453940077931.08826337194338151.7663426204-1179.85460599235
1243676333157.47337451451379.5985293244438988.928096161-3605.52662548547
1254039938409.52993907492562.3802112234139826.0898497017-1989.47006092509
1264416444255.86651532993400.3663935469840671.767091123191.866515329908
1274449645230.8394393992243.7162280564741517.4443325445734.83943939898
1284311041513.24880733392316.1627825488142390.5884101173-1596.75119266614
1294388044025.7505344659470.51697784401543263.7324876901145.750534465871
1304393045069.2156293441-1384.9629549095944175.74732556551139.21562934406
1314432746318.4074033402-2752.1695667811845087.76216344101991.40740334023
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292703091zvcijsu50l0est3/1feke1292703215.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292703091zvcijsu50l0est3/1feke1292703215.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292703091zvcijsu50l0est3/2feke1292703215.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292703091zvcijsu50l0est3/2feke1292703215.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t1292703091zvcijsu50l0est3/3q51g1292703215.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t1292703091zvcijsu50l0est3/3q51g1292703215.ps (open in new window)


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