Home » date » 2010 » Dec » 07 »

Workshop 5: Time series analysis

*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: Tue, 07 Dec 2010 12:18:30 +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/Dec/07/t1291724518bs741b5cdqco2dd.htm/, Retrieved Tue, 07 Dec 2010 13:22:15 +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/Dec/07/t1291724518bs741b5cdqco2dd.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:
Classical Decomposition
 
Dataseries X:
» Textbox « » Textfile « » CSV «
-5 -1 -2 -5 -4 -6 -2 -2 -2 -2 2 1 -8 -1 1 -1 2 2 1 -1 -2 -2 -1 -8 -4 -6 -3 -3 -7 -9 -11 -13 -11 -9 -17 -22 -25 -20 -24 -24 -22 -19 -18 -17 -11 -11 -12 -10 -15 -15 -15 -13 -8 -13 -9 -7 -4 -4 -2 0
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1-5NANA-3.85850694444445NA
2-1NANA-1.23350694444444NA
3-2NANA-0.910590277777779NA
4-5NANA-0.868923611111111NA
5-4NANA0.693576388888888NA
6-6NANA-0.254340277777777NA
7-2-1.95225694444444-2.458333333333330.50607638888889-0.0477430555555562
8-2-2.57725694444444-2.583333333333330.006076388888889660.577256944444443
9-2-0.421006944444444-2.458333333333332.03732638888889-1.57899305555556
10-20.589409722222223-2.166666666666672.75607638888889-2.58940972222222
1120.131076388888888-1.751.881076388888891.86892361111111
121-1.92100694444444-1.16666666666667-0.7543402777777782.92100694444444
13-8-4.56684027777778-0.708333333333333-3.85850694444445-3.43315972222222
14-1-1.77517361111111-0.541666666666667-1.233506944444440.77517361111111
151-1.41059027777778-0.5-0.9105902777777792.41059027777778
16-1-1.36892361111111-0.5-0.8689236111111110.368923611111111
1720.0685763888888883-0.6250.6935763888888881.93142361111111
182-1.37934027777778-1.125-0.2543402777777773.37934027777778
191-0.827256944444444-1.333333333333330.506076388888891.82725694444444
20-1-1.36892361111111-1.3750.006076388888889660.36892361111111
21-20.287326388888890-1.752.03732638888889-2.28732638888889
22-20.756076388888889-22.75607638888889-2.75607638888889
23-1-0.577256944444445-2.458333333333331.88107638888889-0.422743055555555
24-8-4.04600694444444-3.29166666666667-0.754340277777778-3.95399305555556
25-4-8.10850694444445-4.25-3.858506944444454.10850694444445
26-6-6.48350694444444-5.25-1.233506944444440.483506944444443
27-3-7.03559027777778-6.125-0.9105902777777794.03559027777778
28-3-7.66059027777778-6.79166666666667-0.8689236111111114.66059027777778
29-7-7.05642361111111-7.750.6935763888888880.0564236111111116
30-9-9.25434027777778-9-0.2543402777777770.254340277777777
31-11-9.95225694444444-10.45833333333330.50607638888889-1.04774305555556
32-13-11.9105902777778-11.91666666666670.00607638888888966-1.08940972222222
33-11-11.3376736111111-13.3752.037326388888890.337673611111111
34-9-12.3689236111111-15.1252.756076388888893.36892361111111
35-17-14.7439236111111-16.6251.88107638888889-2.25607638888889
36-22-18.4210069444444-17.6666666666667-0.754340277777778-3.57899305555555
37-25-22.2335069444444-18.375-3.85850694444445-2.76649305555556
38-20-20.0668402777778-18.8333333333333-1.233506944444440.0668402777777786
39-24-19.9105902777778-19-0.910590277777779-4.08940972222222
40-24-19.9522569444444-19.0833333333333-0.868923611111111-4.04774305555556
41-22-18.2647569444444-18.95833333333330.693576388888888-3.73524305555556
42-19-18.5043402777778-18.25-0.254340277777777-0.495659722222221
43-18-16.8272569444444-17.33333333333330.50607638888889-1.17274305555555
44-17-16.7022569444444-16.70833333333330.00607638888888966-0.297743055555554
45-11-14.0876736111111-16.1252.037326388888893.08767361111111
46-11-12.5355902777778-15.29166666666672.756076388888891.53559027777778
47-12-12.3689236111111-14.251.881076388888890.368923611111111
48-10-14.1710069444444-13.4166666666667-0.7543402777777784.17100694444444
49-15-16.6501736111111-12.7916666666667-3.858506944444451.65017361111111
50-15-13.2335069444444-12-1.23350694444444-1.76649305555556
51-15-12.2022569444444-11.2916666666667-0.910590277777779-2.79774305555556
52-13-11.5772569444444-10.7083333333333-0.868923611111111-1.42274305555556
53-8-9.30642361111111-100.6935763888888881.30642361111111
54-13-9.42100694444444-9.16666666666667-0.254340277777777-3.57899305555556
55-9NANA0.50607638888889NA
56-7NANA0.00607638888888966NA
57-4NANA2.03732638888889NA
58-4NANA2.75607638888889NA
59-2NANA1.88107638888889NA
600NANA-0.754340277777778NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/1xmci1291724306.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/1xmci1291724306.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/2pdbk1291724306.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/2pdbk1291724306.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/3pdbk1291724306.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/3pdbk1291724306.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/404a51291724306.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/07/t1291724518bs741b5cdqco2dd/404a51291724306.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])
if (par1 == 'additive') a<-table.element(a,m$trend[i]+m$seasonal[i]) else 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