Home » date » 2009 » Dec » 02 »

WS09 - 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: Wed, 02 Dec 2009 13:35:37 -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/02/t1259786267cofwv4ldrqqjm09.htm/, Retrieved Wed, 02 Dec 2009 21:37:53 +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/02/t1259786267cofwv4ldrqqjm09.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 «
423.4 404.1 500 472.6 496.1 562 434.8 538.2 577.6 518.1 625.2 561.2 523.3 536.1 607.3 637.3 606.9 652.9 617.2 670.4 729.9 677.2 710 844.3 748.2 653.9 742.6 854.2 808.4 1819 1936.5 1966.1 2083.1 1620.1 1527.6 1795 1685.1 1851.8 2164.4 1981.8 1726.5 2144.6 1758.2 1672.9 1837.3 1596.1 1446 1898.4 1964.1 1755.9 2255.3 1881.2 2117.9 1656.5 1544.1 2098.9 2133.3 1963.5 1801.2 2365.4 1936.5 1667.6 1983.5 2058.6 2448.3 1858.1 1625.4 2130.6 2515.7 2230.2 2086.9 2235 2100.2 2288.6 2490 2573.7 2543.8 2004.7 2390 2338.4 2724.5 2292.5 2386 2477.9 2337 2605.1 2560.8 2839.3 2407.2 2085.2 2735.6 2798.7 3053.2 2405 2471.9 2727.3 2790.7 2385.4 3206.6 2705.6 3518.4 1954.9 2584.3 2535.8 2685.9 2866 2236.6 2934.9 2668.6 2371.2 3165.9 2887.2 3112.2 2671.2 2432.6 2812.3 3095.7 2862.9 2607.3 2862.5
 
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
Seasonal12010121
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
1423.4463.322686523912-66.0208557168566449.49816919294539.9226865239119
2404.1501.154507793702-153.035594154971460.08108636126997.0545077937021
3500387.976487009375141.359509461032470.664003529593-112.023512990625
4472.6418.66423296755345.2854523382474481.2503146942-53.9357670324474
5496.1383.242109779647117.121264361546491.836625858807-112.857890220353
6562757.259334313481-135.468075298591502.20874098511195.259334313481
7434.8442.456596092553-85.4374522039657512.5808561114137.65659609255317
8538.2504.52873672773748.6483392588324523.222924013431-33.6712632722632
9577.6401.570865195521219.764142889030533.864991915449-176.029134804479
10518.1532.324534471057-41.2407767260136545.11624225495714.2245344710568
11625.2869.108052318109-175.075544912573556.367492594465243.908052318109
12561.2471.12889669586384.0995508852252567.171552418912-90.0711033041373
13523.3534.645243473497-66.0208557168566577.9756122433611.3452434734971
14536.1636.327906995482-153.035594154971588.907687159489100.227906995482
15607.3473.40072846335141.359509461032599.839762075618-133.899271536651
16637.3617.61704545621345.2854523382474611.69750220554-19.6829545437873
17606.9473.123493302993117.121264361546623.555242335461-133.776506697007
18652.9802.504014186664-135.468075298591638.764061111927149.604014186664
19617.2665.864572315574-85.4374522039657653.97287988839248.6645723155735
20670.4620.5998362088448.6483392588324671.551824532328-49.80016379116
21729.9550.905087934707219.764142889030689.130769176263-178.994912065293
22677.2682.944263410715-41.2407767260136712.6965133152995.74426341071489
23710858.813287458239-175.075544912573736.262257454335148.813287458239
24844.3805.87301335357384.0995508852252798.627435761202-38.4269866464274
25748.2701.428241648787-66.0208557168566860.99261406807-46.7717583512131
26653.9500.984325645147-153.035594154971959.851268509824-152.915674354853
27742.6285.13056758739141.3595094610321058.70992295158-457.46943241261
28854.2502.6596206708545.28545233824741160.45492699090-351.540379329149
29808.4237.478804608228117.1212643615461262.19993103023-570.921195391772
3018192416.61379615754-135.4680752985911356.85427914105597.613796157541
311936.52506.92882495209-85.43745220396571451.50862725187570.428824952093
321966.12334.7521170385948.64833925883241548.79954370258368.652117038587
332083.12300.34539695768219.7641428890301646.09046015329217.245396957681
341620.11562.15069101655-41.24077672601361719.29008570946-57.9493089834493
351527.61437.78583364694-175.0755449125731792.48971126564-89.814166353063
3617951686.3884574902384.09955088522521819.51199162455-108.611542509774
371685.11589.68658373340-66.02085571685661846.53427198346-95.4134162666041
381851.82013.50547877509-153.0355941549711843.13011537988161.705478775091
392164.42347.71453176267141.3595094610321839.7259587763183.314531762670
401981.82084.9317461803045.28545233824741833.38280148145103.131746180305
411726.51508.83909145186117.1212643615461827.03964418660-217.660908548142
422144.62601.91323288714-135.4680752985911822.75484241145457.313232887144
431758.21783.36741156767-85.43745220396571818.4700406363025.1674115676683
441672.91478.9131580197448.64833925883241818.23850272143-193.986841980260
451837.31636.82889230441219.7641428890301818.00696480656-200.471107695588
461596.11412.49916462104-41.24077672601361820.94161210498-183.600835378965
4714461243.19928550918-175.0755449125731823.87625940340-202.800714490824
481898.41884.3503292364784.09955088522521828.35011987830-14.0496707635284
491964.12161.39687536365-66.02085571685661832.82398035321197.296875363648
501755.91817.15299409908-153.0355941549711847.6826000559061.2529940990755
512255.32506.69927078039141.3595094610321862.54121975858251.399270780386
521881.21832.0532891765645.28545233824741885.06125848520-49.1467108234444
532117.92211.09743842664117.1212643615461907.5812972118193.1974384266423
541656.51525.07041290989-135.4680752985911923.39766238870-131.429587090105
551544.11234.42342463839-85.43745220396571939.21402756558-309.676575361614
562098.92206.3226734115648.64833925883241942.82898732961107.422673411555
572133.32100.39191001733219.7641428890301946.44394709364-32.9080899826738
581963.52012.36898478299-41.24077672601361955.8717919430348.8689847829858
591801.21812.17590812016-175.0755449125731965.2996367924110.9759081201619
602365.42668.1594183521584.09955088522521978.54103076262302.759418352154
611936.51947.23843098403-66.02085571685661991.7824247328310.7384309840265
621667.61483.95517168938-153.0355941549712004.28042246559-183.644828310617
631983.51808.86207034062141.3595094610322016.77842019835-174.637929659377
642058.62041.0697982106945.28545233824742030.84474945106-17.5302017893114
652448.32734.56765693467117.1212643615462044.91107870378286.267656934672
661858.11786.74668809703-135.4680752985912064.92138720156-71.3533119029689
671625.41251.30575650463-85.43745220396572084.93169569934-374.094243495371
682130.62097.2801792551648.64833925883242115.27148148601-33.3198207448409
692515.72666.02458983829219.7641428890302145.61126727268150.324589838291
702230.22321.55954626065-41.24077672601362180.0812304653691.3595462606495
712086.92134.32435125453-175.0755449125732214.5511936580547.424351254525
7222352141.0730379142584.09955088522522244.82741120053-93.926962085754
732100.21991.31722697385-66.02085571685662275.10362874301-108.882773026152
742288.62430.65341074924-153.0355941549712299.58218340574142.053410749235
7524902514.57975247051141.3595094610322324.0607380684624.5797524705058
762573.72760.9259226310945.28545233824742341.18862503067187.225922631086
772543.82612.16222364559117.1212643615462358.3165119928768.3622236455849
782004.71769.28175920011-135.4680752985912375.58631609849-235.418240799894
7923902472.58133199986-85.43745220396572392.856120204182.5813319998642
802338.42219.050814721148.64833925883242409.10084602007-119.349185278898
812724.52803.89028527494219.7641428890302425.3455718360379.3902852749397
822292.52187.8337624522-41.24077672601362438.40701427381-104.666237547799
8323862495.60708820098-175.0755449125732451.46845671160109.607088200979
842477.92405.1245017289984.09955088522522466.57594738579-72.7754982710103
8523372258.33741765688-66.02085571685662481.68343805998-78.6625823431186
862605.12860.50015633824-153.0355941549712502.73543781673255.400156338237
872560.82456.45305296548141.3595094610322523.78743757349-104.346947034524
882839.33089.818931137745.28545233824742543.49561652405250.518931137703
892407.22134.07494016385117.1212643615462563.20379547461-273.125059836153
902085.21726.18288051748-135.4680752985912579.68519478112-359.017119482525
912735.62960.47085811634-85.43745220396572596.16659408762224.870858116341
922798.72932.8379864828148.64833925883242615.91367425836134.137986482811
933053.23250.97510268188219.7641428890302635.66075442909197.775102681882
9424052187.75331212636-41.24077672601362663.48746459965-217.24668787364
952471.92427.56137014235-175.0755449125732691.31417477022-44.3386298576456
962727.32664.9290557837584.09955088522522705.57139333103-62.3709442162512
972790.72927.59224382502-66.02085571685662719.82861189183136.892243825023
982385.42210.56236611158-153.0355941549712713.27322804339-174.83763388842
993206.63565.12264634402141.3595094610322706.71784419495358.522646344019
1002705.62665.3606659035345.28545233824742700.55388175822-40.2393340964713
1013518.44225.28881631696117.1212643615462694.3899193215706.888816316956
1021954.91355.56107817446-135.4680752985912689.70699712413-599.338921825538
1032584.32569.01337727721-85.43745220396572685.02407492676-15.2866227227937
1042535.82343.4953624496948.64833925883242679.45629829148-192.304637550308
1052685.92478.14733545478219.7641428890302673.88852165619-207.752664545222
10628663093.60256400708-41.24077672601362679.63821271894227.602564007076
1072236.61962.88764113089-175.0755449125732685.38790378168-273.71235886911
1082934.93082.8871614817284.09955088522522702.81328763306147.987161481719
1092668.62682.98218423243-66.02085571685662720.2386714844314.3821842324282
1102371.22155.71000192470-153.0355941549712739.72559223027-215.489998075303
1113165.93431.22797756285141.3595094610322759.21251297612265.327977562848
1122887.22960.1603598298445.28545233824742768.9541878319172.9603598298381
1133112.23328.58287295075117.1212643615462778.69586268771216.382872950746
1142671.22690.54770980086-135.4680752985912787.3203654977319.3477098008630
1152432.62154.69258389622-85.43745220396572795.94486830775-277.907416103782
1162812.32773.3570638005848.64833925883242802.59459694059-38.9429361994189
1173095.73162.39153153754219.7641428890302809.2443255734366.6915315375445
1182862.92952.40032950512-41.24077672601362814.640447220989.500329505116
1192607.32569.63897604420-175.0755449125732820.03656886837-37.6610239557963
1202862.52816.1487894537684.09955088522522824.75165966101-46.3512105462355
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/18hlt1259786135.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/18hlt1259786135.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/26nr11259786135.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/26nr11259786135.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/3conr1259786135.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/3conr1259786135.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/4hdi81259786135.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/02/t1259786267cofwv4ldrqqjm09/4hdi81259786135.ps (open in new window)


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