Home » date » 2008 » Jun » 01 »

Opgave 9 oef 2 Classical Deomposition-verbetering- Shari Van Elsen

R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 01 Jun 2008 04:13:32 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d.htm/, Retrieved Sun, 01 Jun 2008 10:14:53 +0000
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
492.865 480.961 461.935 456.608 441.977 439.148 488.180 520.564 501.492 485.025 464.196 460.170 467.037 460.070 447.988 442.867 436.087 431.328 484.015 509.673 512.927 502.831 470.984 471.067 476.049 474.605 470.439 461.251 454.724 455.626 516.847 525.192 522.975 518.585 509.239 512.238 519.164 517.009 509.933 509.127 500.857 506.971 569.323 579.714 577.992 565.464 547.344 554.788 562.325 560.854 555.332 543.599 536.662 542.722 593.530 610.763 612.613 611.324 594.167 595.454 590.865 589.379 584.428 573.100 567.456 569.028 620.735 628.884 628.232 612.117 595.404 597.141 593.408 590.072 579.799 574.205 572.775 572.942 619.567 625.809 619.916 587.625 565.742 557.274 560.576 548.854 531.673 525.919 511.038 498.662 555.362 564.591 541.657 527.070 509.846 514.258 516.922
 
Text written by user:
 
Output produced by software:


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


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1492.865NANA-0.785428819444444NA
2480.961NANA-5.23853993055552NA
3461.935NANA-14.136796875NA
4456.608NANA-22.9666857638889NA
5441.977NANA-30.3156996527778NA
6439.148NANA-30.0192135416667NA
7488.18496.240793402778473.35058333333322.8902100694445-8.06079340277768
8520.564505.697703125471.40395833333334.293744791666714.8662968750001
9501.492502.151751736111469.95237532.1993767361111-0.659751736111048
10485.025487.055355902778468.79870833333318.2566475694444-2.03035590277773
11464.196465.962487847222467.98075-2.01826215277783-1.76648784722215
12460.17465.250147569444467.4095-2.15935243055559-5.08014756944442
13467.037466.124696180555466.910125-0.7854288194444440.912303819444503
14460.07461.044251736111466.282791666667-5.23853993055552-0.974251736111
15447.988452.168661458333466.305458333333-14.136796875-4.18066145833325
16442.867444.557147569444467.523833333333-22.9666857638889-1.69014756944443
17436.087438.232883680555468.548583333333-30.3156996527778-2.14588368055547
18431.328439.266244791667469.285458333333-30.0192135416667-7.9382447916666
19484.015493.005210069444470.11522.8902100694445-8.9902100694444
20509.673505.389869791667471.09612534.29374479166674.28313020833338
21512.927504.836585069444472.63720833333332.19937673611118.0904149305556
22502.831492.595314236111474.33866666666718.256647569444410.2356857638889
23470.984473.862946180556475.881208333333-2.01826215277783-2.8789461805556
24471.067475.510814236111477.670166666667-2.15935243055559-4.44381423611105
25476.049479.265154513889480.050583333333-0.785428819444444-3.21615451388885
26474.605476.826668402778482.065208333333-5.23853993055552-2.22166840277777
27470.439468.993703125483.1305-14.1367968751.44529687500005
28461.251461.238897569444484.205583333333-22.96668576388890.0121024305555579
29454.724456.140258680556486.455958333333-30.3156996527778-1.41625868055553
30455.626459.746161458333489.765375-30.0192135416667-4.12016145833337
31516.847516.167501736111493.27729166666722.89021006944450.679498263888945
32525.192531.134328125496.84058333333334.2937447916667-5.94232812500002
33522.975532.452376736111500.25332.1993767361111-9.47737673611113
34518.585522.150064236111503.89341666666718.2566475694444-3.56506423611114
35509.239505.792196180556507.810458333333-2.018262152777833.44680381944443
36512.238509.712689236111511.872041666667-2.159352430555592.52531076388897
37519.164515.412487847222516.197916666667-0.7854288194444443.75151215277776
38517.009515.417626736111520.656166666667-5.238539930555521.59137326388873
39509.933511.083494791667525.220291666667-14.136796875-1.15049479166680
40509.127506.499272569445529.465958333333-22.96668576388892.62772743055541
41500.857502.691258680556533.006958333333-30.3156996527778-1.83425868055565
42506.971506.348369791667536.367583333333-30.01921354166670.622630208333248
43569.323562.829085069445539.93887522.89021006944456.49391493055543
44579.714577.857869791667543.56412534.29374479166671.85613020833330
45577.992579.482001736111547.28262532.1993767361111-1.49000173611125
46565.464568.867230902778550.61058333333318.2566475694444-3.40323090277764
47547.344551.520529513889553.538791666667-2.01826215277783-4.17652951388880
48554.788554.360939236111556.520291666667-2.159352430555590.427060763888903
49562.325558.233112847222559.018541666667-0.7854288194444444.09188715277776
50560.854556.082335069445561.320875-5.238539930555524.77166493055552
51555.332549.920328125564.057125-14.1367968755.41167187500002
52543.599544.443814236111567.4105-22.9666857638889-0.84481423611112
53536.662540.956592013889571.272291666667-30.3156996527778-4.29459201388886
54542.722544.898453125574.917666666667-30.0192135416667-2.17645312500008
55593.53600.691460069444577.8012522.8902100694445-7.1614600694445
56610.763614.472703125580.17895833333334.2937447916667-3.70970312499992
57612.613614.779210069444582.57983333333332.1993767361111-2.16621006944445
58611.324603.278022569444585.02137518.25664756944448.04597743055558
59594.167585.515404513889587.533666666667-2.018262152777838.65159548611132
60595.454587.753480902778589.912833333333-2.159352430555597.70051909722224
61590.865591.357029513889592.142458333333-0.785428819444444-0.492029513888838
62589.379588.792501736111594.031041666667-5.238539930555520.58649826388887
63584.428581.300078125595.436875-14.1367968753.12792187499997
64573.1573.154022569444596.120708333333-22.9666857638889-0.0540225694443279
65567.456565.889592013889596.205291666667-30.31569965277781.56640798611113
66569.028566.307911458333596.327125-30.01921354166672.72008854166677
67620.735619.393585069444596.50337522.89021006944451.34141493055563
68628.884630.931953125596.63820833333334.2937447916667-2.04795312499982
69628.232628.673585069444596.47420833333332.1993767361111-0.4415850694445
70612.117614.584022569445596.32737518.2566475694444-2.46702256944457
71595.404594.576779513889596.595041666667-2.018262152777830.827220486111173
72597.141594.820397569444596.97975-2.159352430555592.32060243055548
73593.408596.308737847222597.094166666667-0.785428819444444-2.90073784722233
74590.072591.678835069444596.917375-5.23853993055552-1.6068350694444
75579.799582.305953125596.44275-14.136796875-2.50695312500000
76574.205572.109064236111595.07575-22.96668576388892.09593576388909
77572.775562.503633680555592.819333333333-30.315699652777810.2713663194445
78572.942559.903078125589.922291666667-30.019213541666713.0389218750001
79619.567609.783376736111586.89316666666722.89021006944459.7836232638889
80625.809618.101494791667583.8077534.29374479166677.70750520833337
81619.916612.284460069444580.08508333333332.19937673611117.63153993055573
82587.625594.324564236111576.06791666666718.2566475694444-6.69956423611109
83565.742569.465362847222571.483625-2.01826215277783-3.72336284722223
84557.274563.656897569444565.81625-2.15935243055559-6.38289756944437
85560.576559.260612847222560.046041666667-0.7854288194444441.31538715277770
86548.854549.581543402778554.820083333333-5.23853993055552-0.727543402777883
87531.673534.871744791667549.008541666667-14.136796875-3.19874479166674
88525.919520.257939236111543.224625-22.96668576388895.66106076388894
89511.038508.056800347222538.3725-30.31569965277782.98119965277783
90498.662504.231953125534.251166666667-30.0192135416667-5.56995312499998
91555.362553.530126736111530.63991666666722.89021006944451.83187326388884
92564.591NANA34.2937447916667NA
93541.657NANA32.1993767361111NA
94527.07NANA18.2566475694444NA
95509.846NANA-2.01826215277783NA
96514.258NANA-2.15935243055559NA
97516.922NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/1907a1212315205.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/1907a1212315205.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/23ttz1212315205.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/23ttz1212315205.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/3dpaj1212315205.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/3dpaj1212315205.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/4z9mk1212315205.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jun/01/t1212315288wo10pwbemz26y7d/4z9mk1212315205.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