Home » date » 2010 » Dec » 12 »

Opgave 9 oefening 2

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Sun, 12 Dec 2010 14:28:49 +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/12/t1292164052an28ncxc0md197g.htm/, Retrieved Sun, 12 Dec 2010 15:27:33 +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/12/t1292164052an28ncxc0md197g.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:
KDGP2W92
 
Dataseries X:
» Textbox « » Textfile « » CSV «
132.1 125 127.1 101.5 85.7 79.3 70.9 77.1 83.9 96.2 111.7 127.2 143.6 134.9 135.6 105.3 86.4 74.6 67.6 73.4 78.5 98.2 118.6 136.9 137.9 115.6 119.3 98.5 84.3 73.5 60.7 69.5 77.9 113.9 126.3 135.1 130.5 113.1 110 90.8 85.4 72.5 64.7 67.2 77.9 105.2 107.2 120.7 121.3 107.9 105.6 81.3 71.7 64.8 57.3 61.9 70.1 88.8 106.8 110.7 114.1 108 111.5 86.8 78.4 68 57.3 65.3 73.3 88.6 101.3 122.9 126.6 114.1 124.7 93.3 77.2 66.5 57.9 63.7 65.8 85 101 105.3 121 117.9 106 86.6 79.9 65.2 61.2 67.6 78.9 95.5 113.1 124.4 122 110.3 114 93.3 75.5 65.4 59.2 63.8 74.2 91.7 107 120.7 127.4 119.7 112.7 84.4 75.6 66.5 59.9 64.8 74.3 100.4 105.9 131.1
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1132.1NANA32.9709104938272NA
2125NANA21.6454475308642NA
3127.1NANA21.5135030864198NA
4101.5NANA-2.8059413580247NA
585.7NANA-14.5652006172839NA
679.3NANA-25.3786265432099NA
770.969.010725308642101.954166666667-32.94344135802471.88927469135803
877.175.8042438271605102.845833333333-27.04158950617281.2957561728395
983.984.5510030864197103.6125-19.0614969135802-0.651003086419749
1096.2105.498225308642104.1251.37322530864197-9.29822530864197
11111.7120.244984567901104.312515.9324845679012-8.54498456790121
12127.2132.506558641975104.14583333333328.360725308642-5.3065586419753
13143.6136.783410493827103.812532.97091049382726.81658950617283
14134.9125.166280864198103.52083333333321.64544753086429.73371913580246
15135.6124.655169753086103.14166666666721.513503086419810.9448302469136
16105.3100.194058641975103-2.80594135802475.10594135802469
1786.488.8056327160494103.370833333333-14.5652006172839-2.40563271604938
1874.678.6838734567901104.0625-25.3786265432099-4.08387345679012
1967.671.285725308642104.229166666667-32.9434413580247-3.68572530864196
2073.476.1459104938271103.1875-27.0415895061728-2.74591049382714
2178.582.6426697530864101.704166666667-19.0614969135802-4.14266975308641
2298.2102.114891975309100.7416666666671.37322530864197-3.91489197530865
23118.6116.303317901235100.37083333333315.93248456790122.29668209876544
24136.9128.598225308642100.237528.3607253086428.30177469135803
25137.9132.87507716049499.904166666666732.97091049382725.02492283950617
26115.6121.09961419753199.454166666666721.6454475308642-5.49961419753087
27119.3120.78016975308699.266666666666721.5135030864198-1.48016975308643
2898.597.089891975308699.8958333333333-2.80594135802471.41010802469135
2984.386.3056327160494100.870833333333-14.5652006172839-2.00563271604939
3073.575.7380401234568101.116666666667-25.3786265432099-2.23804012345678
3160.767.7898919753086100.733333333333-32.9434413580247-7.08989197530863
3269.573.2792438271605100.320833333333-27.0415895061728-3.77924382716049
3377.980.767669753086499.8291666666667-19.0614969135802-2.86766975308642
34113.9100.49405864197599.12083333333341.3732253086419713.4059413580247
35126.3114.77831790123598.845833333333315.932484567901211.5216820987654
36135.1127.21072530864298.8528.3607253086427.88927469135801
37130.5131.94591049382798.97532.9709104938272-1.44591049382717
38113.1120.69128086419899.045833333333321.6454475308642-7.59128086419754
39110120.4635030864298.9521.5135030864198-10.4635030864198
4090.895.781558641975398.5875-2.8059413580247-4.98155864197531
4185.482.863966049382797.4291666666667-14.56520061728392.53603395061729
4272.570.654706790123596.0333333333333-25.37862654320991.84529320987654
4364.762.106558641975395.05-32.94344135802472.59344135802469
4467.267.408410493827294.45-27.0415895061728-0.208410493827159
4577.974.988503086419794.05-19.06149691358022.91149691358025
46105.294.844058641975393.47083333333331.3732253086419710.3559413580247
47107.2108.43665123456892.504166666666715.9324845679012-1.23665123456789
48120.7119.97322530864291.612528.3607253086420.726774691358031
49121.3123.9542438271690.983333333333332.9709104938272-2.6542438271605
50107.9112.09961419753190.454166666666721.6454475308642-4.19961419753086
51105.6111.42183641975389.908333333333321.5135030864198-5.82183641975308
5281.386.094058641975388.9-2.8059413580247-4.79405864197531
5371.773.63479938271688.2-14.5652006172839-1.93479938271604
5464.862.388040123456887.7666666666667-25.37862654320992.41195987654321
5557.354.106558641975387.05-32.94344135802473.19344135802469
5661.959.712577160493886.7541666666667-27.04158950617282.18742283950618
5770.167.942669753086487.0041666666667-19.06149691358022.15733024691356
5888.888.852391975308687.47916666666671.37322530864197-0.0523919753086517
59106.8103.91998456790187.987515.93248456790122.88001543209877
60110.7116.76072530864288.428.360725308642-6.06072530864199
61114.1121.50424382716188.533333333333332.9709104938272-7.40424382716051
62108110.32044753086488.67521.6454475308642-2.3204475308642
63111.5110.4635030864288.9521.51350308641981.03649691358025
6486.886.269058641975389.075-2.80594135802470.530941358024691
6578.474.27229938271688.8375-14.56520061728394.12770061728396
666863.738040123456889.1166666666667-25.37862654320994.26195987654322
6757.357.202391975308690.1458333333333-32.94344135802470.097608024691354
6865.363.879243827160590.9208333333333-27.04158950617281.4207561728395
6973.372.663503086419891.725-19.06149691358020.636496913580245
7088.693.919058641975392.54583333333331.37322530864197-5.3190586419753
71101.3108.69915123456892.766666666666715.9324845679012-7.3991512345679
72122.9121.01489197530992.654166666666728.3607253086421.88510802469136
73126.6125.58757716049492.616666666666632.97091049382721.01242283950619
74114.1114.22044753086492.57521.6454475308642-0.120447530864183
75124.7113.70933641975392.195833333333321.513503086419810.9906635802469
7693.388.927391975308691.7333333333333-2.80594135802474.37260802469137
7777.277.005632716049491.5708333333333-14.56520061728390.194367283950626
7866.565.446373456790190.825-25.37862654320991.0536265432099
7957.956.914891975308789.8583333333333-32.94344135802470.985108024691328
8063.762.741743827160589.7833333333333-27.04158950617280.958256172839512
8165.870.101003086419889.1625-19.0614969135802-4.30100308641977
828589.477391975308688.10416666666671.37322530864197-4.47739197530865
83101103.86998456790187.937515.9324845679012-2.86998456790124
84105.3116.35655864197587.995833333333328.360725308642-11.0565586419753
85121121.05007716049488.079166666666732.9709104938272-0.0500771604938137
86117.9110.02461419753188.379166666666621.64544753086427.87538580246915
87106110.6010030864289.087521.5135030864198-4.60100308641974
8886.687.264891975308790.0708333333334-2.8059413580247-0.664891975308663
8979.976.44729938271691.0125-14.56520061728393.45270061728398
9065.266.933873456790192.3125-25.3786265432099-1.73387345679012
9161.260.206558641975393.15-32.94344135802470.993441358024683
9267.665.833410493827292.875-27.04158950617281.76658950617283
9378.973.830169753086492.8916666666667-19.06149691358025.06983024691358
9495.594.877391975308693.50416666666661.373225308641970.622608024691374
95113.1109.53248456790193.615.93248456790123.56751543209874
96124.4121.78572530864293.42528.3607253086422.61427469135805
97122126.32091049382793.3532.9709104938272-4.32091049382714
98110.3114.75378086419893.108333333333321.6454475308642-4.45378086419753
99114114.26766975308692.754166666666621.5135030864198-0.267669753086395
10093.389.594058641975392.4-2.80594135802473.70594135802469
10175.577.42229938271691.9875-14.5652006172839-1.92229938271606
10265.466.200540123456891.5791666666667-25.3786265432099-0.800540123456784
10359.258.706558641975391.65-32.94344135802470.493441358024697
10463.865.225077160493892.2666666666667-27.0415895061728-1.42507716049384
10574.273.542669753086492.6041666666667-19.06149691358020.657330246913588
10691.793.552391975308792.17916666666671.37322530864197-1.85239197530865
107107107.74498456790191.812515.9324845679012-0.744984567901241
108120.7120.22322530864291.862528.3607253086420.476774691358017
109127.4124.90841049382791.937532.97091049382722.49158950617284
110119.7113.65378086419892.008333333333321.64544753086426.04621913580246
111112.7113.56766975308692.054166666666721.5135030864198-0.867669753086432
11284.489.614891975308792.4208333333333-2.8059413580247-5.21489197530865
11375.678.17229938271692.7375-14.5652006172839-2.57229938271605
11466.567.746373456790193.125-25.3786265432099-1.24637345679012
11559.9NANA-32.9434413580247NA
11664.8NANA-27.0415895061728NA
11774.3NANA-19.0614969135802NA
118100.4NANA1.37322530864197NA
119105.9NANA15.9324845679012NA
120131.1NANA28.360725308642NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/1ybmo1292164124.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/1ybmo1292164124.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/2ybmo1292164124.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/2ybmo1292164124.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/3r23r1292164124.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/3r23r1292164124.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/4r23r1292164124.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292164052an28ncxc0md197g/4r23r1292164124.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