Home » date » 2008 » May » 25 »

Opgave 9 oef 2 Classical Deomposition- 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, 25 May 2008 10:47:46 -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/May/25/t1211734274qbek2u55wxpb3uy.htm/, Retrieved Sun, 25 May 2008 18:51:19 +0200
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
516.922 514.258 509.846 527.070 541.657 564.591 555.362 498.662 511.038 525.919 531.673 548.854 560.576 557.274 565.742 587.625 619.916 625.809 619.567 572.942 572.775 574.205 579.799 590.072 593.408 597.141 595.404 612.117 628.232 628.884 620.735 569.028 567.456 573.100 584.428 589.379 590.865 595.454 594.167 611.324 612.613 610.763 593.530 542.722 536.662 543.599 555.332 560.854 562.325 554.788 547.344 565.464 577.992 579.714 569.323 506.971 500.857 509.127 509.933 517.009 519.164 512.238 509.239 518.585 522.975 525.192 516.847 455.626 454.724 461.251 470.439 474.605 476.049 471.067 470.984 502.831 512.927 509.673 484.015 431.328 436.087 442.867 447.988 460.070 467.037 460.170 464.196 485.025 501.492 520.564 488.180 439.148 441.977 456.608 461.935 480.961 492.865
 
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'George Udny Yule' @ 72.249.76.132


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1516.922NANA-0.723846643518504NA
2514.258NANA-2.16495081018522NA
3509.846NANA-2.02386053240742NA
4527.07NANA18.2510491898148NA
5541.657NANA32.1937783564815NA
6564.591NANA34.2881464120371NA
7555.362553.524528356482530.63991666666722.88461168981481.83747164351837
8498.662504.22635474537534.251166666667-30.0248119212963-5.56435474537045
9511.038508.051201967593538.3725-30.32129803240742.98679803240748
10525.919520.252340856481543.224625-22.97228414351855.66665914351859
11531.673534.866146412037549.008541666667-14.1423952546296-3.19314641203698
12548.854549.575945023148554.820083333333-5.24413831018516-0.721945023148237
13560.576559.322195023148560.046041666667-0.7238466435185041.25380497685194
14557.274563.651299189815565.81625-2.16495081018522-6.37729918981483
15565.742569.459764467593571.483625-2.02386053240742-3.7177644675927
16587.625594.318965856482576.06791666666718.2510491898148-6.69396585648155
17619.916612.278861689815580.08508333333332.19377835648157.63713831018515
18625.809618.095896412037583.8077534.28814641203717.7131035879629
19619.567609.777778356481586.89316666666722.88461168981489.78922164351854
20572.942559.89747974537589.922291666667-30.024811921296313.0445202546297
21572.775562.498035300926592.819333333333-30.321298032407410.2769646990741
22574.205572.103465856481595.07575-22.97228414351852.10153414351862
23579.799582.30035474537596.44275-14.1423952546296-2.50135474537035
24590.072591.673236689815596.917375-5.24413831018516-1.60123668981487
25593.408596.370320023148597.094166666667-0.723846643518504-2.96232002314810
26597.141594.814799189815596.97975-2.164950810185222.32620081018524
27595.404594.571181134259596.595041666667-2.023860532407420.832818865740705
28612.117614.578424189815596.32737518.2510491898148-2.46142418981492
29628.232628.667986689815596.47420833333332.1937783564815-0.435986689814854
30628.884630.92635474537596.63820833333334.2881464120371-2.04235474537029
31620.735619.387986689815596.50337522.88461168981481.34701331018528
32569.028566.302313078704596.327125-30.02481192129632.72568692129641
33567.456565.883993634259596.205291666667-30.32129803240741.57200636574089
34573.1573.148424189815596.120708333333-22.9722841435185-0.048424189814682
35584.428581.29447974537595.436875-14.14239525462963.13352025462962
36589.379588.786903356482594.031041666667-5.244138310185160.592096643518516
37590.865591.418611689815592.142458333333-0.723846643518504-0.553611689814716
38595.454587.747882523148589.912833333333-2.164950810185227.70611747685177
39594.167585.509806134259587.533666666667-2.023860532407428.65719386574085
40611.324603.272424189815585.02137518.25104918981488.05157581018511
41612.613614.773611689815582.57983333333332.1937783564815-2.16061168981491
42610.763614.46710474537580.17895833333334.2881464120371-3.70410474537039
43593.53600.685861689815577.8012522.8846116898148-7.15586168981486
44542.722544.89285474537574.917666666667-30.0248119212963-2.17085474537032
45536.662540.950993634259571.272291666667-30.3212980324074-4.28899363425921
46543.599544.438215856481567.4105-22.9722841435185-0.83921585648136
47555.332549.91472974537564.057125-14.14239525462965.41727025462967
48560.854556.076736689815561.320875-5.244138310185164.77726331018516
49562.325558.294695023148559.018541666667-0.7238466435185044.03030497685188
50554.788554.355340856481556.520291666667-2.164950810185220.432659143518549
51547.344551.514931134259553.538791666667-2.02386053240742-4.17093113425926
52565.464568.861632523148550.61058333333318.2510491898148-3.39763252314810
53577.992579.476403356481547.28262532.1937783564815-1.48440335648149
54579.714577.852271412037543.56412534.28814641203711.86172858796306
55569.323562.823486689815539.93887522.88461168981486.49951331018508
56506.971506.342771412037536.367583333333-30.02481192129630.628228587962894
57500.857502.685660300926533.006958333333-30.3212980324074-1.82866030092600
58509.127506.493674189815529.465958333333-22.97228414351852.63332581018517
59509.933511.077896412037525.220291666667-14.1423952546296-1.14489641203716
60517.009515.412028356482520.656166666667-5.244138310185161.59697164351849
61519.164515.474070023148516.197916666667-0.7238466435185043.68992997685177
62512.238509.707090856481511.872041666667-2.164950810185222.53090914351861
63509.239505.786597800926507.810458333333-2.023860532407423.45240219907407
64518.585522.144465856481503.89341666666718.2510491898148-3.55946585648138
65522.975532.446778356481500.25332.1937783564815-9.47177835648142
66525.192531.12872974537496.84058333333334.2881464120371-5.93672974537037
67516.847516.161903356482493.27729166666722.88461168981480.685096643518534
68455.626459.740563078704489.765375-30.0248119212963-4.11456307870372
69454.724456.134660300926486.455958333333-30.3212980324074-1.41066030092600
70461.251461.233299189815484.205583333333-22.97228414351850.0177008101851470
71470.439468.98810474537483.1305-14.14239525462961.45089525462964
72474.605476.821070023148482.065208333333-5.24413831018516-2.21607002314806
73476.049479.326736689815480.050583333333-0.723846643518504-3.27773668981479
74471.067475.505215856481477.670166666667-2.16495081018522-4.43821585648135
75470.984473.857347800926475.881208333333-2.02386053240742-2.87334780092584
76502.831492.589715856481474.33866666666718.251049189814810.2412841435186
77512.927504.830986689815472.63720833333332.19377835648158.0960133101853
78509.673505.384271412037471.09612534.28814641203714.28872858796296
79484.015492.999611689815470.11522.8846116898148-8.98461168981481
80431.328439.260646412037469.285458333333-30.0248119212963-7.93264641203706
81436.087438.227285300926468.548583333333-30.3212980324074-2.14028530092594
82442.867444.551549189815467.523833333333-22.9722841435185-1.68454918981490
83447.988452.163063078704466.305458333333-14.1423952546296-4.17506307870366
84460.07461.038653356481466.282791666667-5.24413831018516-0.968653356481468
85467.037466.186278356481466.910125-0.7238466435185040.850721643518568
86460.17465.244549189815467.4095-2.16495081018522-5.07454918981460
87464.196465.956889467593467.98075-2.02386053240742-1.76088946759256
88485.025487.049757523148468.79870833333318.2510491898148-2.02475752314803
89501.492502.146153356481469.95237532.1937783564815-0.654153356481402
90520.564505.69210474537471.40395833333334.288146412037114.8718952546296
91488.18496.235195023148473.35058333333322.8846116898148-8.05519502314803
92439.148NANA-30.0248119212963NA
93441.977NANA-30.3212980324074NA
94456.608NANA-22.9722841435185NA
95461.935NANA-14.1423952546296NA
96480.961NANA-5.24413831018516NA
97492.865NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/1o3f81211734059.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/1o3f81211734059.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/2v10w1211734059.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/2v10w1211734059.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/3nuru1211734059.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/3nuru1211734059.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/4xajv1211734059.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/25/t1211734274qbek2u55wxpb3uy/4xajv1211734059.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