# ::Free Statistics and Forecasting Software::

v1.2.1

### :: Decomposition by Loess - Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

This free online software (calculator) computes the Seasonal Decomposition by Loess as proposed by Cleveland et al.
The article that describes the underlying methodology is available online at the Journal of Official Statistics
(a copy of the pdf is also available here).

Enter (or paste) your data delimited by hard returns.

 Send output to: Browser Blue - Charts White Browser Black/White CSV Data[reset data] 112 118 132 129 121 135 148 148 136 119 104 118 115 126 141 135 125 149 170 170 158 133 114 140 145 150 178 163 172 178 199 199 184 162 146 166 171 180 193 181 183 218 230 242 209 191 172 194 196 196 236 235 229 243 264 272 237 211 180 201 204 188 235 227 234 264 302 293 259 229 203 229 242 233 267 269 270 315 364 347 312 274 237 278 284 277 317 313 318 374 413 405 355 306 271 306 315 301 356 348 355 422 465 467 404 347 305 336 340 318 362 348 363 435 491 505 404 359 310 337 360 342 406 396 420 472 548 559 463 407 362 405 417 391 419 461 472 535 622 606 508 461 390 432 Seasonal period 12123456789101112 Seasonal window (?) Seasonal degree (?) 01 Trend window (?) Trend degree (?) 10 Low-pass window (?) Low-pass degree (?) 10 Robust loess fitting FALSETRUE Chart options Width: Height: Title:

 Source code of R 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")
 Top | Output | Charts | References

 Cite this software as: Wessa P., (2021), Decomposition by Loess (v1.0.3) in Free Statistics Software (v1.2.1), Office for Research Development and Education, URL http://www.wessa.net/rwasp_decomposeloess.wasp/ The R code is based on : R. B. Cleveland, W. S. Cleveland, J.E. McRae, and I. Terpenning (1990) STL: A Seasonal-Trend Decomposition Procedure Based on Loess, Journal of Official Statistics, 6, 3–73. (pdf)
 Top | Output | Charts | References
 To cite Wessa.net in publications use:Wessa, P. (2024), Free Statistics Software, Office for Research Development and Education, version 1.2.1, URL https://www.wessa.net/ © All rights reserved. Academic license for non-commercial use only. The free use of the scientific content, services, and applications in this website is granted for non commercial use only. In any case, the source (url) should always be clearly displayed. Under no circumstances are you allowed to reproduce, copy or redistribute the design, layout, or any content of this website (for commercial use) including any materials contained herein without the express written permission. 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. We make no warranties or representations as to the accuracy or completeness of such information (or software), and it assumes 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. Software Version : 1.2.1Algorithms & Software : Patrick Wessa, PhDServer : www.wessa.net