Home » date » 2009 » Dec » 04 »

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: Fri, 04 Dec 2009 05:21:13 -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/t1259929407vbcwd9cn63kd9b8.htm/, Retrieved Fri, 04 Dec 2009 13:23:33 +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/t1259929407vbcwd9cn63kd9b8.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 «
19 18 19 19 22 23 20 14 14 14 15 11 17 16 20 24 23 20 21 19 23 23 23 23 27 26 17 24 26 24 27 27 26 24 23 23 24 17 21 19 22 22 18 16 14 12 14 16 8 3 0 5 1 1 3 6 7 8 14 14 13
 
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
11916.57947260217531.0323505410437520.388176856781-2.42052739782475
21817.9886985481575-1.916931455475919.9282329073184-0.0113014518424599
31920.7625041635123-2.2307931213680619.46828895785571.76250416351234
41918.30540671812810.66072414392428719.0338691379476-0.69459328187191
52224.04830902390631.3522416580542118.59944931803952.04830902390627
62327.19948387431610.57379066427799418.22672546140594.19948387431609
72021.75065698285840.3953414123692617.85400160477231.75065698285842
81411.3164171196300-0.85731982715909117.5409027075291-2.68358288036999
91411.0821777540783-0.30998156436415317.2278038102858-2.91782224592169
101411.6123226040687-0.69440698628702417.0820843822183-2.38767739593131
111511.94246820057361.121166845275616.9363649541508-3.05753179942642
12113.966848075550070.87382351646294317.159328407987-7.03315192444993
131715.58535759713311.0323505410437517.3822918618232-1.41464240286691
141616.0153217418746-1.916931455475917.90160971360130.0153217418745726
152023.8098655559886-2.2307931213680618.42092756537953.80986555598856
162428.16954314595810.66072414392428719.16973271011764.16954314595814
172324.72922048709021.3522416580542119.91853785485561.72922048709015
182018.77972882913880.57379066427799420.6464805065832-1.22027117086124
192120.23023542931990.3953414123692621.3744231583109-0.769764570680117
201917.0404348651263-0.85731982715909121.8168849620327-1.95956513487366
212324.0506347986095-0.30998156436415322.25934676575461.05063479860952
222324.1978226689064-0.69440698628702422.49658431738061.19782266890643
232322.14501128571791.121166845275622.7338218690065-0.854988714282147
242322.07728045748330.87382351646294323.0488960260537-0.922719542516653
252729.60367927585541.0323505410437523.36397018310092.60367927585537
262630.1815384693696-1.916931455475923.73539298610634.18153846936957
271712.1239773322563-2.2307931213680624.1068157891118-4.87602266774373
282423.04605497162130.66072414392428724.2932208844544-0.953945028378676
292626.16813236214881.3522416580542124.4796259797970.168132362148807
302422.99844780878030.57379066427799424.4277615269417-1.00155219121974
312729.22876151354420.3953414123692624.37589707408652.22876151354423
322730.7010085390211-0.85731982715909124.15631128813793.70100853902114
332628.3732560621748-0.30998156436415323.93672550218942.37325606217477
342425.0632564123993-0.69440698628702423.63115057388771.06325641239929
352321.55325750913831.121166845275623.3255756455861-1.44674249086167
362322.32550986000140.87382351646294322.8006666235356-0.674490139998579
372424.69189185747101.0323505410437522.27575760148520.691891857471045
381714.3977260030349-1.916931455475921.5192054524410-2.60227399696515
392123.4681398179712-2.2307931213680620.76265330339692.46813981797116
401917.41854268368070.66072414392428719.9207331723951-1.58145731631935
412223.56894530055261.3522416580542119.07881304139321.56894530055258
422225.28770446182970.57379066427799418.13850487389233.28770446182975
431818.40646188123940.3953414123692617.19819670639130.406461881239441
441616.9138071487343-0.85731982715909115.94351267842480.913807148734259
451413.6211529139058-0.30998156436415314.6888286504584-0.378847086094213
461211.5475051095578-0.69440698628702413.1469018767293-0.452494890442246
471415.27385805172421.121166845275611.60497510300021.27385805172423
481621.04325658589750.87382351646294310.08291989763965.04325658589749
4986.406784766677281.032350541043758.56086469227896-1.59321523332272
5030.432365627144699-1.91693145547597.4845658283312-2.5676343728553
510-4.17747384301538-2.230793121368066.40826696438344-4.17747384301538
5253.073647916774770.6607241439242876.26562793930094-1.92635208322523
531-5.475230572272661.352241658054216.12298891421845-6.47523057227266
541-5.10161586486990.5737906642779946.52782520059191-6.1016158648699
553-1.328002899334630.395341412369266.93266148696538-4.32800289933463
5665.45729259748866-0.8573198271590917.40002722967043-0.542707402511338
5776.44258859198867-0.3099815643641537.86739297237548-0.55741140801133
5888.23080359847971-0.6944069862870248.463603387807310.230803598479714
591417.81901935148531.12116684527569.059813803239143.81901935148526
601417.33277826177390.8738235164629439.79339822176323.33277826177386
611314.4406668186691.0323505410437510.52698264028731.44066681866899
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929407vbcwd9cn63kd9b8/1js5m1259929271.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929407vbcwd9cn63kd9b8/1js5m1259929271.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929407vbcwd9cn63kd9b8/4rrqx1259929271.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259929407vbcwd9cn63kd9b8/4rrqx1259929271.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