Home » date » 2009 » Dec » 04 »

Workshop 9-7

*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 15:04:42 -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/t1259964363li0n02oynt2rhpw.htm/, Retrieved Fri, 04 Dec 2009 23:06:08 +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/t1259964363li0n02oynt2rhpw.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:
WS 9-7
 
Dataseries X:
» Textbox « » Textfile « » CSV «
5.7 6.1 6 5.9 5.8 5.7 5.6 5.4 5.4 5.5 5.6 5.7 5.9 6.1 6 5.8 5.8 5.7 5.5 5.3 5.2 5.2 5 5.1 5.1 5.2 4.9 4.8 4.5 4.5 4.4 4.4 4.2 4.1 3.9 3.8 3.9 4.2 4.1 3.8 3.6 3.7 3.5 3.4 3.1 3.1 3.1 3.2 3.3 3.5 3.6 3.5 3.3 3.2 3.1 3.2 3 3 3.1 3.4
 
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
Seasonal601061
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
15.75.643900681917520.08203129729222845.67406802079025-0.0560993180824836
26.16.160267239460380.3616798982952575.678052862244360.06026723946038
366.016633836213760.3013284600877725.682037703698470.0166338362137592
45.95.94081117546130.1723684802820475.686820344256650.0408111754613039
55.85.864988501638720.04340851354644935.691602984814830.0649885016387222
65.75.670974123019820.03205770246107555.6969681745191-0.0290258769801781
75.65.57695982282192-0.07929318704530215.70233336422338-0.0230401771780766
85.45.22199642533729-0.1286424889216075.70664606358432-0.178003574662709
95.45.34703306706318-0.2579918300084385.71095876294525-0.0529669329368154
105.55.50839982213336-0.2206319637582785.712232141624920.00839982213335677
115.65.70976665562454-0.2232721759291345.713505520304590.109766655624544
125.75.77116395064941-0.08304266683734445.711878716187930.0711639506494128
135.96.00771679063650.08203129729222845.710251912071270.107716790636498
146.16.139938899933260.3616798982952575.698381201771490.0399388999332562
1566.012161048440530.3013284600877725.68651049147170.0121610484405288
165.85.772558457369760.1723684802820475.6550730623482-0.0274415426302435
175.85.932955853228860.04340851354644935.62363563322470.132955853228857
185.75.796831379904830.03205770246107555.571110917634090.096831379904831
195.55.56070698500181-0.07929318704530215.51858620204350.060706985001806
205.35.28412094494497-0.1286424889216075.44452154397664-0.0158790550550316
215.25.28753494409866-0.2579918300084385.370456885909780.0875349440986595
225.25.3432424477535-0.2206319637582785.277389516004780.143242447753495
2355.03895002982935-0.2232721759291345.184322146099790.0389500298293477
245.15.19848205694164-0.08304266683734445.084560609895710.098482056941637
255.15.133169629016140.08203129729222844.984799073691630.0331696290161432
265.25.145880711658690.3616798982952574.89243939004605-0.0541192883413109
274.94.698591833511750.3013284600877724.80007970640048-0.201408166488251
284.84.716344487758820.1723684802820474.71128703195913-0.0836555122411777
294.54.334097128935770.04340851354644934.62249435751778-0.165902871064230
304.54.43434345235180.03205770246107554.53359884518713-0.0656565476482012
314.44.43458985418883-0.07929318704530214.444703332856470.0345898541888303
324.44.56724152065656-0.1286424889216074.361400968265050.167241520656559
334.24.37989322633482-0.2579918300084384.278098603673620.179893226334816
344.14.22208647767382-0.2206319637582784.198545486084460.122086477673821
353.93.90427980743384-0.2232721759291344.118992368495290.00427980743384104
363.83.64483051807001-0.08304266683734444.03821214876733-0.155169481929986
373.93.76053677366840.08203129729222843.95743192903937-0.139463226331596
384.24.162458230148570.3616798982952573.87586187155617-0.0375417698514293
394.14.104379725839250.3013284600877723.794291814072980.00437972583925106
403.83.705748383090000.1723684802820473.72188313662795-0.094251616909995
413.63.507117027270630.04340851354644933.64947445918292-0.0928829727293672
423.73.777139023323220.03205770246107553.590803274215710.0771390233232174
433.53.54716109779681-0.07929318704530213.53213208924850.0471610977968053
443.43.44492759474385-0.1286424889216073.483714894177750.0449275947438523
453.13.02269413090143-0.2579918300084383.43529769910701-0.077305869098573
463.13.02356633163113-0.2206319637582783.39706563212714-0.0764336683688667
473.13.06443861078185-0.2232721759291343.35883356514728-0.0355613892181452
483.23.15409680902966-0.08304266683734443.32894585780769-0.0459031909703409
493.33.218910552239680.08203129729222843.29905815046809-0.0810894477603203
503.53.357968955603460.3616798982952573.28035114610129-0.142031044396545
513.63.637027398177740.3013284600877723.261644141734480.0370273981777443
523.53.563780658755960.1723684802820473.263850860961990.0637806587559648
533.33.290533906264060.04340851354644933.26605758018949-0.0094660937359401
543.23.095555856964740.03205770246107553.27238644057418-0.104444143035258
553.13.00057788608643-0.07929318704530213.27871530095887-0.099422113913572
563.23.24257900534302-0.1286424889216073.286063483578590.0425790053430211
5732.96458016381014-0.2579918300084383.29341166619830-0.0354198361898592
5832.91872153488000-0.2206319637582783.30191042887827-0.0812784651199956
593.13.11286298437088-0.2232721759291343.310409191558250.0128629843708832
603.43.56296854014578-0.08304266683734443.320074126691570.162968540145777
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964363li0n02oynt2rhpw/159z81259964280.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259964363li0n02oynt2rhpw/159z81259964280.ps (open in new window)


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


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


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