Home » date » 2009 » May » 28 »

Opgave 9 oefening 2 classical deomposition

*Unverified author*
R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Thu, 28 May 2009 06:16:16 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx.htm/, Retrieved Thu, 28 May 2009 14:17:18 +0200
 
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/May/28/t1243513034etmz5dwnt5xhmlx.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 «
5,29 5,29 5,29 5,31 5,33 5,34 5,34 5,37 5,41 5,41 5,38 5,44 5,44 5,46 5,46 5,45 5,46 5,46 5,48 5,47 5,48 5,51 5,55 5,58 5,59 5,6 5,6 5,67 5,71 5,7 5,73 5,72 5,75 5,75 5,77 5,83 5,85 5,87 5,86 5,87 5,93 5,97 5,98 5,99 5,99 6,03 6,06 6,07 6,08 6,08 6,1 6,13 6,14 6,14 6,16 6,2 6,19 6,32 6,32 6,33 6,32 6,33 6,38 6,42 6,46 6,47 6,42 6,48 6,47 6,49 6,48 6,51 6,51 6,52 6,57 6,59 6,62 6,63 6,61 6,64
 
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


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
15.29NANA0.00384027777777765NA
25.29NANA-0.00240972222222253NA
35.29NANA-0.0084930555555562NA
45.31NANA0.00167361111111100NA
55.33NANA0.015506944444444NA
65.34NANA0.00542361111111131NA
75.345.349840277777785.35625-0.00640972222222227-0.0098402777777773
85.375.363423611111115.36958333333333-0.006159722222221790.006576388888889
95.415.363506944444445.38375-0.02024305555555510.0464930555555556
105.415.401673611111115.396666666666670.005006944444444850.0083263888888876
115.385.409756944444445.407916666666670.00184027777777787-0.0297569444444443
125.445.428756944444445.418333333333330.01042361111111120.0112430555555560
135.445.433006944444455.429166666666670.003840277777777650.0069930555555553
145.465.436756944444445.43916666666667-0.002409722222222530.0232430555555556
155.465.437756944444445.44625-0.00849305555555620.0222430555555562
165.455.455006944444445.453333333333330.00167361111111100-0.00500694444444427
175.465.480090277777785.464583333333330.015506944444444-0.0200902777777774
185.465.482923611111115.47750.00542361111111131-0.0229236111111106
195.485.483173611111115.48958333333333-0.00640972222222227-0.00317361111111136
205.475.495506944444445.50166666666667-0.00615972222222179-0.0255069444444445
215.485.493090277777785.51333333333333-0.0202430555555551-0.0130902777777768
225.515.533340277777785.528333333333330.00500694444444485-0.0233402777777787
235.555.549756944444445.547916666666670.001840277777777870.000243055555555038
245.585.578756944444445.568333333333330.01042361111111120.00124305555555537
255.595.592590277777785.588750.00384027777777765-0.00259027777777820
265.65.607173611111115.60958333333333-0.00240972222222253-0.00717361111111181
275.65.622756944444445.63125-0.0084930555555562-0.0227569444444446
285.675.654173611111115.65250.001673611111111000.0158263888888879
295.715.687173611111115.671666666666670.0155069444444440.0228263888888893
305.75.696673611111115.691250.005423611111111310.00332638888888859
315.735.706090277777785.7125-0.006409722222222270.0239097222222222
325.725.728423611111115.73458333333333-0.00615972222222179-0.00842361111111156
335.755.736423611111115.75666666666667-0.02024305555555510.0135763888888896
345.755.780840277777785.775833333333330.00500694444444485-0.0308402777777781
355.775.795173611111115.793333333333330.00184027777777787-0.0251736111111116
365.835.824173611111115.813750.01042361111111120.00582638888888898
375.855.839256944444455.835416666666670.003840277777777650.0107430555555545
385.875.854673611111115.85708333333333-0.002409722222222530.0153263888888890
395.865.869840277777785.87833333333333-0.0084930555555562-0.0098402777777773
405.875.901673611111115.90.00167361111111100-0.0316736111111107
415.935.939256944444445.923750.015506944444444-0.00925694444444414
425.975.951256944444445.945833333333330.005423611111111310.0187430555555554
435.985.959006944444445.96541666666667-0.006409722222222270.0209930555555555
445.995.977590277777785.98375-0.006159722222221790.0124097222222233
455.995.982256944444446.0025-0.02024305555555510.00774305555555621
466.036.028340277777786.023333333333330.005006944444444850.00165972222222344
476.066.044756944444446.042916666666670.001840277777777870.0152430555555556
486.076.069173611111116.058750.01042361111111120.000826388888889973
496.086.077173611111116.073333333333330.003840277777777650.00282638888888886
506.086.087173611111116.08958333333333-0.00240972222222253-0.00717361111111003
516.16.098173611111116.10666666666667-0.00849305555555620.00182638888888853
526.136.128756944444446.127083333333330.001673611111111000.00124305555555537
536.146.165506944444446.150.015506944444444-0.0255069444444445
546.146.177090277777786.171666666666670.00542361111111131-0.0370902777777777
556.166.186090277777786.1925-0.00640972222222227-0.0260902777777767
566.26.206756944444446.21291666666667-0.00615972222222179-0.00675694444444375
576.196.214756944444446.235-0.0202430555555551-0.0247569444444435
586.326.263756944444446.258750.005006944444444850.056243055555556
596.326.286006944444446.284166666666670.001840277777777870.0339930555555563
606.336.321673611111116.311250.01042361111111120.00832638888888937
616.326.339673611111116.335833333333330.00384027777777765-0.0196736111111093
626.336.355923611111116.35833333333333-0.00240972222222253-0.0259236111111099
636.386.373173611111116.38166666666667-0.00849305555555620.0068263888888902
646.426.402090277777786.400416666666670.001673611111111000.0179097222222229
656.466.429673611111116.414166666666670.0155069444444440.0303263888888905
666.476.433756944444446.428333333333330.005423611111111310.0362430555555564
676.426.437340277777786.44375-0.00640972222222227-0.0173402777777776
686.486.453423611111116.45958333333333-0.006159722222221790.0265763888888895
696.476.455173611111116.47541666666667-0.02024305555555510.0148263888888893
706.496.495423611111116.490416666666670.00500694444444485-0.00542361111111145
716.486.506006944444446.504166666666670.00184027777777787-0.0260069444444442
726.516.527923611111116.51750.0104236111111112-0.0179236111111116
736.51NA6.53208333333333NANA
746.52NA6.54666666666667NANA
756.57NANANANA
766.59NANANANA
776.62NANANANA
786.63NANANANA
796.61NANANANA
806.64NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/1p9391243512973.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/1p9391243512973.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/2albf1243512973.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/2albf1243512973.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/3rchl1243512973.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/3rchl1243512973.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/4rqs31243512973.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/28/t1243513034etmz5dwnt5xhmlx/4rqs31243512973.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