Home » date » 2010 » Dec » 29 »

Classical 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, 29 Dec 2010 09:41:19 +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/29/t12936155498p97i9yvie9fam6.htm/, Retrieved Wed, 29 Dec 2010 10:39:10 +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/29/t12936155498p97i9yvie9fam6.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 «
1775 2197 2920 4240 5415 6136 6719 6234 7152 3646 2165 2803 1615 2350 3350 3536 5834 6767 5993 7276 5641 3477 2247 2466 1567 2237 2598 3729 5715 5776 5852 6878 5488 3583 2054 2282 1552 2261 2446 3519 5161 5085 5711 6057 5224 3363 1899 2115 1491 2061 2419 3430 4778 4862 6176 5664 5529 3418 1941 2402 1579 2146 2462 3695 4831 5134 6250 5760 6249 2917 1741 2359 1511 2059 2635 2867 4403 5720 4502 5749 5627 2846 1762 2429 1169 2154 2249 2687 4359 5382 4459 6398 4596 3024 1887 2070 1351 2218 2461 3028 4784 4975 4607 6249 4809 3157 1910 2228 1594 2467 2222 3607 4685 4962 5770 5480 5000 3228 1993 2288 1588 2105 2191 3591 4668 4885 5822 5599 5340 3082 2010 2301
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


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


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
117751614.5326391416-2239.828212071124175.29557292952-160.467360858399
221971752.75072689951-1555.358894610344196.60816771083-444.249273100486
329202835.24163255931-1213.162395051454217.92076249214-84.7583674406869
442404548.98802564649-301.5166797625294232.52865411604308.988025646489
554155361.097737220411221.765717039654247.13654573994-53.9022627795875
661366331.372631128081682.661526422554257.96584244937195.372631128081
767197286.920437281051882.284423560164268.79513915879567.92043728105
862345806.43315915362381.980533570464279.58630727594-427.566840846401
971528238.491836542631775.130688064284290.377475393091086.49183654263
1036463489.22084109285-485.3838202045724288.16297911173-156.779158907155
1121651809.76814819324-1765.71663102364285.94848283036-355.231851806763
1228032703.30366598598-1382.856311346974285.55264536099-99.69633401402
1316151184.67140417949-2239.828212071124285.15680789163-430.32859582051
1423501971.83977695999-1555.358894610344283.51911765036-378.160223040012
1533503631.28096764237-1213.162395051454281.88142740908281.280967642372
1635363099.26011646497-301.5166797625294274.25656329756-436.739883535031
1758346179.602583774311221.765717039654266.63169918604345.602583774315
1867677596.359740642781682.661526422554254.97873293466829.359740642783
1959935860.389809756551882.284423560164243.32576668329-132.610190243448
2072767956.700895631472381.980533570464213.31857079807680.700895631471
2156415323.557937022871775.130688064284183.31137491285-317.442062977128
2234773295.64890036129-485.3838202045724143.73491984329-181.351099638714
2322472155.55816624988-1765.71663102364104.15846477372-91.4418337501229
2424662244.62253039633-1382.856311346974070.23378095064-221.377469603668
2515671337.51911494355-2239.828212071124036.30909712757-229.480885056447
2622372005.68040662906-1555.358894610344023.67848798129-231.319593370943
2725982398.11451621645-1213.162395051454011.04787883501-199.885483783552
2837293747.86249745891-301.5166797625294011.6541823036118.8624974589147
2957156195.973797188131221.765717039654012.26048577222480.97379718813
3057765860.46003304431682.661526422554008.8784405331484.4600330443036
3158525816.219181145781882.284423560164005.49639529406-35.7808188542226
3268787383.951819611482381.980533570463990.06764681806505.95181961148
3354885226.230413593661775.130688064283974.63889834206-261.769586406335
3435833708.22609636835-485.3838202045723943.15772383622125.226096368349
3520541962.04008169321-1765.71663102363911.67654933038-91.959918306789
3622822075.3318719903-1382.856311346973871.52443935668-206.668128009704
3715521512.45588268815-2239.828212071123831.37232938297-39.5441173118525
3822612279.72734511966-1555.358894610343797.6315494906818.7273451196615
3924462341.27162545306-1213.162395051453763.89076959839-104.728374546939
4035193596.61726390844-301.5166797625293742.8994158540877.6172639084443
4151615378.326220850581221.765717039653721.90806210978217.326220850576
4250854778.501094246081682.661526422553708.83737933137-306.498905753918
4357115843.948879886891882.284423560163695.76669655295132.948879886887
4460576047.360826343512381.980533570463684.65864008603-9.63917365649013
4552244999.318728316611775.130688064283673.55058361911-224.681271683386
4633633549.36449429974-485.3838202045723662.01932590483186.364494299741
4718991913.22856283304-1765.71663102363650.4880681905514.2285628330442
4821151968.80599041324-1382.856311346973644.05032093374-146.194009586764
4914911584.21563839419-2239.828212071123637.6125736769293.2156383941947
5020612039.40140313153-1555.358894610343637.95749147881-21.5985968684677
5124192412.85998577076-1213.162395051453638.3024092807-6.14001422924457
5234303515.596492766-301.5166797625293645.9201869965385.5964927660007
5347784680.696318247991221.765717039653653.53796471236-97.303681752006
5448624376.246510679471682.661526422553665.09196289797-485.753489320527
5561766793.069615356251882.284423560163676.64596108359617.069615356251
5656645256.286179585532381.980533570463689.73328684401-407.713820414468
5755295580.04869933131775.130688064283702.8206126044351.0486993312957
5834183605.8102432432-485.3838202045723715.57357696138187.810243243195
5919411919.39008970527-1765.71663102363728.32654131832-21.6099102947283
6024022445.92903320979-1382.856311346973740.9272781371843.9290332097912
6115791644.30019711508-2239.828212071123753.5280149560465.3001971150775
6221462082.67021088386-1555.358894610343764.68868372648-63.3297891161401
6324622361.31304255453-1213.162395051453775.84935249693-100.686957445472
6436953914.06646553989-301.5166797625293777.45021422264219.066465539891
6548314661.1832070121221.765717039653779.05107594835-169.816792987997
6651344813.100118593071682.661526422553772.23835498438-320.899881406934
6762506852.289942419431882.284423560163765.42563402041602.289942419429
6857605382.527223286792381.980533570463755.49224314275-377.472776713207
6962496977.310459670641775.130688064283745.55885226509728.310459670638
7029172595.93219845847-485.3838202045723723.4516217461-321.067801541531
7117411546.37223979648-1765.71663102363701.34439122712-194.627760203522
7223592438.73020444559-1382.856311346973662.1261069013879.7302044455946
7315111638.92038949548-2239.828212071123622.90782257564127.920389495478
7420592092.21196637474-1555.358894610343581.1469282356133.2119663747371
7526352943.77636115588-1213.162395051453539.38603389557308.776361155882
7628672519.6139044989-301.5166797625293515.90277526363-347.386095501103
7744034091.814766328661221.765717039653492.41951663169-311.18523367134
7857206272.77546068421682.661526422553484.56301289324552.775460684208
7945023645.009067285061882.284423560163476.70650915479-856.990932714944
8057495644.44037905692381.980533570463471.57908737264-104.559620943096
8156276012.417646345231775.130688064283466.45166559049385.417646345233
8228462716.42034212083-485.3838202045723460.96347808375-129.579657879174
8317621834.2413404466-1765.71663102363455.47529057772.241340446596
8424292794.71601660711-1382.856311346973446.14029473986365.716016607113
8511691141.0229131684-2239.828212071123436.80529890272-27.9770868316018
8621542440.81369118716-1555.358894610343422.54520342319286.813691187156
8722492302.8772871078-1213.162395051453408.2851079436553.8772871077995
8826872284.51529347545-301.5166797625293391.00138628708-402.484706524547
8943594122.516618329861221.765717039653373.7176646305-236.483381670145
9053825711.482494784821682.661526422553369.85597879263329.482494784816
9144593669.721283485081882.284423560163365.99429295476-789.278716514923
9263987031.661810945762381.980533570463382.35765548378633.661810945761
9345964018.148293922931775.130688064283398.7210180128-577.851706077074
9430243109.67483609158-485.3838202045723423.7089841129985.6748360915835
9518872091.01968081042-1765.71663102363448.69695021318204.019680810417
9620702064.54675897307-1382.856311346973458.30955237391-5.45324102693166
9713511473.90605753649-2239.828212071123467.92215453463122.906057536486
9822182525.7561002443-1555.358894610343465.60279436604307.7561002443
9924612671.878960854-1213.162395051453463.28343419745210.878960854
10030282896.59528515395-301.5166797625293460.92139460857-131.404714846045
10147844887.674927940661221.765717039653458.5593550197103.674927940657
10249754803.779846463351682.661526422553463.5586271141-171.220153536653
10346073863.157677231341882.284423560163468.5578992085-743.842322768663
10462496630.962267675632381.980533570463485.05719875391381.96226767563
10548094341.31281363641775.130688064283501.55649829932-467.687186363597
10631573272.86100647881-485.3838202045723526.52281372576115.861006478813
10719102034.2275018714-1765.71663102363551.4891291522124.227501871399
10822282263.47227258245-1382.856311346973575.3840387645235.4722725824495
10915941828.54926369427-2239.828212071123599.27894837685234.549263694266
11024672884.71057865913-1555.358894610343604.64831595122417.710578659128
11122222047.14471152587-1213.162395051453610.01768352558-174.855288474125
11236073912.81687849847-301.5166797625293602.69980126406305.816878498465
11346854552.85236395781221.765717039653595.38191900255-132.147636042197
11449624653.531658902371682.661526422553587.80681467508-308.468341097633
11557706077.483866092231882.284423560163580.23171034761307.483866092231
11654805001.913744523512381.980533570463576.10572190603-478.086255476489
11750004652.889578471271775.130688064283571.97973346445-347.110421528726
11832283367.4336998363-485.3838202045723573.95012036827139.433699836299
11919932175.7961237515-1765.71663102363575.92050727209182.796123751501
12022882376.58285543243-1382.856311346973582.2734559145588.5828554324262
12115881827.20180751412-2239.828212071123588.626404557239.201807514119
12221052173.43056777745-1555.358894610343591.928326832968.4305677774482
12321911999.93214594266-1213.162395051453595.23024910879-191.067854057337
12435913889.72935516657-301.5166797625293593.78732459596298.729355166568
12546684521.889882877221221.765717039653592.34440008313-146.110117122779
12648854494.855370816751682.661526422553592.4831027607-390.144629183251
12758226169.093771001581882.284423560163592.62180543826347.093771001576
12855995224.028063433942381.980533570463591.9914029956-374.971936566059
12953405313.508311382791775.130688064283591.36100055294-26.4916886172141
13030823057.89673715811-485.3838202045723591.48708304646-24.1032628418907
13120102194.10346548361-1765.71663102363591.61316553999184.10346548361
13223012391.51692296626-1382.856311346973593.3393883807190.5169229662615
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/1rtal1293615674.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/1rtal1293615674.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/2rtal1293615674.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/2rtal1293615674.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/31kro1293615674.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/31kro1293615674.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/41kro1293615674.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/29/t12936155498p97i9yvie9fam6/41kro1293615674.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