Home » date » 2010 » Nov » 28 »

Workshop 8, Classical Decomposition of Time Series by Moving

*The author of this computation has been verified*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 28 Nov 2010 20:55:54 +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/Nov/28/t1290977676ag026j8cllf4g5u.htm/, Retrieved Sun, 28 Nov 2010 21:54:40 +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/Nov/28/t1290977676ag026j8cllf4g5u.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 «
9.911 8.915 9.452 9.112 8.472 8.230 8.384 8.625 8.221 8.649 8.625 10.443 10.357 8.586 8.892 8.329 8.101 7.922 8.120 7.838 7.735 8.406 8.209 9.451 10.041 9.411 10.405 8.467 8.464 8.102 7.627 7.513 7.510 8.291 8.064 9.383 9.706 8.579 9.474 8.318 8.213 8.059 9.111 7.708 7.680 8.014 8.007 8.718 9.486 9.113 9.025 8.476 7.952 7.759 7.835 7.600 7.651 8.319 8.812 8.630
 
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'George Udny Yule' @ 72.249.76.132


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
19.911NANA1.32376302083333NA
28.915NANA0.364908854166667NA
39.452NANA0.9082734375NA
49.112NANA-0.133851562500000NA
58.472NANA-0.347361979166667NA
68.23NANA-0.552424479166668NA
78.3848.626450520833338.9385-0.312049479166667-0.242450520833332
88.6258.244190104166678.943375-0.6991848958333330.380809895833334
98.2218.075033854166678.90633333333333-0.8312994791666660.145966145833334
108.6498.58364843758.850375-0.26672656250.0653515625000001
118.6258.433856770833338.80229166666667-0.3684348958333330.191143229166668
1210.4439.688388020833338.7740.9143880208333330.754611979166665
1310.35710.07392968758.750166666666671.323763020833330.283070312500001
148.5869.071283854166678.7063750.364908854166667-0.485283854166665
158.8929.561606770833338.653333333333330.9082734375-0.669606770833334
168.3298.489106770833338.62295833333333-0.133851562500000-0.160106770833330
178.1018.248138020833338.5955-0.347361979166667-0.147138020833331
187.9227.984408854166678.53683333333333-0.552424479166668-0.0624088541666659
198.128.170283854166678.48233333333333-0.312049479166667-0.0502838541666666
207.8387.804356770833338.50354166666667-0.6991848958333330.0336432291666675
217.7357.769658854166678.60095833333333-0.831299479166666-0.0346588541666666
228.4068.40302343758.66975-0.26672656250.00297656250000067
238.2098.322190104166678.690625-0.368434895833333-0.113190104166666
249.4519.627638020833338.713250.914388020833333-0.176638020833332
2510.04110.02397135416678.700208333333331.323763020833330.0170286458333333
269.4119.031033854166678.6661250.3649088541666670.379966145833334
2710.4059.551481770833338.643208333333330.90827343750.853518229166665
288.4678.495190104166678.62904166666667-0.133851562500000-0.0281901041666668
298.4648.270846354166678.61820833333333-0.3473619791666670.193153645833334
308.1028.056908854166678.60933333333333-0.5524244791666680.0450911458333341
317.6278.28049218758.59254166666667-0.312049479166667-0.6534921875
327.5137.844731770833338.54391666666667-0.699184895833333-0.331731770833333
337.517.639158854166678.47045833333333-0.831299479166666-0.129158854166665
348.2918.158731770833338.42545833333333-0.26672656250.132268229166669
358.0648.040356770833338.40879166666666-0.3684348958333330.0236432291666695
369.3839.31092968758.396541666666660.9143880208333330.0720703125000011
379.7069.780346354166678.456583333333331.32376302083333-0.074346354166666
388.5798.891450520833338.526541666666660.364908854166667-0.31245052083333
399.4749.45002343758.541750.90827343750.0239765625000015
408.3188.403440104166678.53729166666667-0.133851562500000-0.0854401041666666
418.2138.176013020833338.523375-0.3473619791666670.0369869791666666
428.0597.94086718758.49329166666667-0.5524244791666680.118132812500001
439.1118.14436718758.45641666666667-0.3120494791666670.966632812500002
447.7087.770315104166678.4695-0.699184895833333-0.0623151041666645
457.687.64174218758.47304166666667-0.8312994791666660.0382578125000013
468.0148.194190104166678.46091666666667-0.2667265625-0.180190104166666
478.0078.088190104166678.456625-0.368434895833333-0.0811901041666658
488.7189.347638020833338.433250.914388020833333-0.629638020833332
499.4869.691346354166678.367583333333331.32376302083333-0.205346354166664
509.1138.674825520833338.309916666666670.3649088541666670.438174479166667
519.0259.212481770833338.304208333333330.9082734375-0.187481770833331
528.4768.181856770833338.31570833333333-0.1338515625000000.29414322916667
537.9528.014596354166668.36195833333333-0.347361979166667-0.062596354166665
547.7597.839408854166678.39183333333333-0.552424479166668-0.0804088541666665
557.835NANA-0.312049479166667NA
567.6NANA-0.699184895833333NA
577.651NANA-0.831299479166666NA
588.319NANA-0.2667265625NA
598.812NANA-0.368434895833333NA
608.63NANA0.914388020833333NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/1okkh1290977751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/1okkh1290977751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/2okkh1290977751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/2okkh1290977751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/3zt121290977751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/3zt121290977751.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/4sli51290977751.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/28/t1290977676ag026j8cllf4g5u/4sli51290977751.ps (open in new window)


 
Parameters (Session):
par1 = additive ; par2 = 12 ;
 
Parameters (R input):
par1 = additive ; par2 = 12 ;
 
R code (references can be found in the software module):
par2 <- as.numeric(par2)
x <- ts(x,freq=par2)
m <- decompose(x,type=par1)
m$figure
bitmap(file='test1.png')
plot(m)
dev.off()
mylagmax <- length(x)/2
bitmap(file='test2.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(x),lag.max = mylagmax,main='Observed')
acf(as.numeric(m$trend),na.action=na.pass,lag.max = mylagmax,main='Trend')
acf(as.numeric(m$seasonal),na.action=na.pass,lag.max = mylagmax,main='Seasonal')
acf(as.numeric(m$random),na.action=na.pass,lag.max = mylagmax,main='Random')
par(op)
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
spectrum(as.numeric(x),main='Observed')
spectrum(as.numeric(m$trend[!is.na(m$trend)]),main='Trend')
spectrum(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal')
spectrum(as.numeric(m$random[!is.na(m$random)]),main='Random')
par(op)
dev.off()
bitmap(file='test4.png')
op <- par(mfrow = c(2,2))
cpgram(as.numeric(x),main='Observed')
cpgram(as.numeric(m$trend[!is.na(m$trend)]),main='Trend')
cpgram(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal')
cpgram(as.numeric(m$random[!is.na(m$random)]),main='Random')
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Classical Decomposition by Moving Averages',6,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observations',header=TRUE)
a<-table.element(a,'Fit',header=TRUE)
a<-table.element(a,'Trend',header=TRUE)
a<-table.element(a,'Seasonal',header=TRUE)
a<-table.element(a,'Random',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(m$trend)) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,m$trend[i]+m$seasonal[i])
a<-table.element(a,m$trend[i])
a<-table.element(a,m$seasonal[i])
a<-table.element(a,m$random[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.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