Home » date » 2009 » Dec » 04 »

ws9: decomposition 2

*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 10:18:47 -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/t1259947251r4r1c5q46it2rv8.htm/, Retrieved Fri, 04 Dec 2009 18:20:56 +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/t1259947251r4r1c5q46it2rv8.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 «
6,3 6,2 6,1 6,3 6,5 6,6 6,5 6,2 6,2 5,9 6,1 6,1 6,1 6,1 6,1 6,4 6,7 6,9 7 7 6,8 6,4 5,9 5,5 5,5 5,6 5,8 5,9 6,1 6,1 6 6 5,9 5,5 5,6 5,4 5,2 5,2 5,2 5,5 5,8 5,8 5,5 5,3 5,1 5,2 5,8 5,8 5,5 5 4,9 5,3 6,1 6,5 6,8 6,6 6,4 6,4 6,6
 
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
Seasonal591060
Trend1912
Low-pass1312


Seasonal Decomposition by Loess - Time Series Components
tObservedFittedSeasonalTrendRemainder
16.36.41929659287945-0.255846341394326.436549748514870.119296592879449
26.26.35101403301814-0.3546883210082906.403674287990150.151014033018143
36.16.18273155560554-0.3535303830709676.370798827465420.0827315556055419
46.36.35310340942122-0.0966542592447476.343550849823530.0531034094212206
56.56.42347534568560.2602217821327666.31630287218163-0.0765246543143938
66.66.510325266340450.3957450070423116.29392972661723-0.0896747336595451
76.56.357175186995290.3712682319518696.27155658105284-0.142824813004711
86.25.917836813166020.2305622994829096.25160088735107-0.282163186833978
96.26.078498576751290.08985622959941536.2316451936493-0.121501423248713
105.95.68266882991023-0.1163535545079236.23368472459769-0.217331170089767
116.15.96683908306914-0.002563338615221646.23572425554608-0.133160916930862
126.16.0969088332685-0.1680170912137196.27110825794522-0.00309116673150012
136.16.14935408104997-0.255846341394326.306492260344350.049354081049966
146.16.19879327742428-0.3546883210082906.355895043584010.0987932774242806
156.16.1482325562473-0.3535303830709676.405297826823670.0482325562473012
166.46.46436335129901-0.0966542592447476.432290907945740.0643633512990096
176.76.680494228799420.2602217821327666.45928398906781-0.0195057712005768
186.96.96658902601490.3957450070423116.437665966942790.0665890260149036
1977.212683823230370.3712682319518696.416047944817760.212683823230368
2077.40071094362670.2305622994829096.36872675689040.400710943626696
216.87.188738201437560.08985622959941536.321405568963030.388738201437557
226.46.65043024492786-0.1163535545079236.265923309580070.250430244927856
235.95.59212228841812-0.002563338615221646.2104410501971-0.307877711581884
245.55.02841051230253-0.1680170912137196.13960657891119-0.471589487697474
255.55.18707423376904-0.255846341394326.06877210762528-0.312925766230960
265.65.55847975418752-0.3546883210082905.99620856682077-0.0415202458124755
275.86.02988535705471-0.3535303830709675.923645026016250.229885357054715
285.96.02158725082406-0.0966542592447475.875067008420690.121587250824059
296.16.113289227042110.2602217821327665.826488990825130.013289227042109
306.16.008185061227260.3957450070423115.79606993173043-0.091814938772738
3165.86308089541240.3712682319518695.76565087263573-0.136919104587598
3266.038902637653680.2305622994829095.730535062863410.0389026376536767
335.96.014724517309490.08985622959941535.69541925309110.114724517309487
345.55.4542330873921-0.1163535545079235.66212046711582-0.0457669126078999
355.65.57374165747467-0.002563338615221645.62882168114055-0.0262583425253267
365.45.37184388136764-0.1680170912137195.59617320984608-0.0281561186323573
375.25.09232160284271-0.255846341394325.56352473855161-0.107678397157286
385.25.23473269633196-0.3546883210082905.519955624676330.0347326963319636
395.25.27714387226992-0.3535303830709675.476386510801050.0771438722699189
405.55.64833728925332-0.0966542592447475.448316969991430.148337289253316
415.85.919530788685420.2602217821327665.420247429181820.119530788685418
425.85.781694200109040.3957450070423115.42256079284865-0.0183057998909639
435.55.203857611532640.3712682319518695.42487415651549-0.296142388467361
445.34.940871657462540.2305622994829095.42856604305455-0.359128342537456
455.14.677885840806980.08985622959941535.4322579295936-0.422114159193018
465.25.07301769044055-0.1163535545079235.44333586406737-0.126982309559447
475.86.14814954007408-0.002563338615221645.454413798541140.348149540074083
485.86.25760633040148-0.1680170912137195.510410760812240.457606330401481
495.55.68943861831098-0.255846341394325.566407723083340.189438618310983
5054.69324113937547-0.3546883210082905.66144718163282-0.306758860624529
514.94.39704374288866-0.3535303830709675.7564866401823-0.502956257111336
525.34.84248018063599-0.0966542592447475.85417407860875-0.457519819364007
536.15.987916700832030.2602217821327665.95186151703521-0.112083299167971
546.56.554460281109230.3957450070423116.049794711848460.0544602811092334
556.87.081003861386420.3712682319518696.14772790666170.281003861386424
566.66.719185245498890.2305622994829096.25025245501820.119185245498887
576.46.357366767025890.08985622959941536.3527770033747-0.042633232974115
586.46.45675306917599-0.1163535545079236.459600485331930.0567530691759908
596.66.63613937132606-0.002563338615221646.566423967289170.0361393713260556
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947251r4r1c5q46it2rv8/12nsq1259947125.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947251r4r1c5q46it2rv8/12nsq1259947125.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947251r4r1c5q46it2rv8/24x5p1259947125.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/04/t1259947251r4r1c5q46it2rv8/24x5p1259947125.ps (open in new window)


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


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