Home » date » 2010 » May » 24 »

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: Mon, 24 May 2010 18:46:57 +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/May/24/t1274726955nll7s7gjbumbscn.htm/, Retrieved Mon, 24 May 2010 20:49:20 +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/2010/May/24/t1274726955nll7s7gjbumbscn.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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
164 96 73 49 39 59 169 169 210 278 298 245 200 188 90 79 78 91 167 169 289 247 275 203 223 104 107 85 75 99 135 211 335 488 326 346 261 224 141 148 145 223 272 445 560 612 467 404 518 404 300 210 196 186 247 343 464 680 711 610 513 292 273 322 189 257 324 404 677 858 895 664 628 308 324 248 272
 
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
1164NANA62.1069444444445NA
296NANA-41.7430555555556NA
373NANA-107.793055555556NA
449NANA-129.918055555556NA
539NANA-171.926388888889NA
659NANA-145.793055555556NA
716960.5319444444445155.583333333333-95.0513888888889108.468055555556
8169146.698611111111160.916666666667-14.218055555555522.3013888888889
9210298.890277777778165.458333333333133.431944444444-88.8902777777778
10278409.490277777778167.416666666667242.073611111111-131.490277777778
11298367.140277777778170.291666666667196.848611111111-69.1402777777778
12245245.231944444444173.2571.9819444444444-0.231944444444451
13200236.606944444444174.562.1069444444445-36.6069444444445
14188132.673611111111174.416666666667-41.743055555555655.326388888889
159069.9152777777778177.708333333333-107.79305555555620.0847222222222
167949.7902777777778179.708333333333-129.91805555555629.2097222222222
17785.53194444444446177.458333333333-171.92638888888972.4680555555555
189128.9569444444444174.75-145.79305555555662.0430555555556
1916778.9069444444445173.958333333333-95.051388888888988.0930555555555
20169157.198611111111171.416666666667-14.218055555555511.8013888888889
21289302.056944444444168.625133.431944444444-13.0569444444445
22247411.656944444444169.583333333333242.073611111111-164.656944444444
23275366.556944444444169.708333333333196.848611111111-91.5569444444444
24203241.898611111111169.91666666666771.9819444444444-38.8986111111111
25223231.023611111111168.91666666666762.1069444444445-8.0236111111111
26104127.590277777778169.333333333333-41.7430555555556-23.5902777777777
2710765.2069444444445173-107.79305555555641.7930555555556
288555.0402777777778184.958333333333-129.91805555555629.9597222222222
297525.1986111111111197.125-171.92638888888949.8013888888889
309959.4152777777778205.208333333333-145.79305555555639.5847222222222
31135117.698611111111212.75-95.051388888888917.3013888888889
32211205.115277777778219.333333333333-14.21805555555555.8847222222222
33335359.181944444444225.75133.431944444444-24.1819444444445
34488471.865277777778229.791666666667242.07361111111116.1347222222223
35326432.181944444444235.333333333333196.848611111111-106.181944444444
36346315.398611111111243.41666666666771.981944444444430.6013888888889
37261316.398611111111254.29166666666762.1069444444445-55.3986111111111
38224228.006944444444269.75-41.7430555555556-4.0069444444444
39141181.081944444444288.875-107.793055555556-40.0819444444444
40148173.498611111111303.416666666667-129.918055555556-25.4986111111111
41145142.531944444444314.458333333333-171.9263888888892.46805555555557
42223176.956944444444322.75-145.79305555555646.0430555555556
43272240.823611111111335.875-95.051388888888931.1763888888889
44445339.865277777778354.083333333333-14.2180555555555105.134722222222
45560501.640277777778368.208333333333133.43194444444458.3597222222223
46612619.490277777778377.416666666667242.073611111111-7.49027777777775
47467578.973611111111382.125196.848611111111-111.973611111111
48404454.690277777778382.70833333333371.9819444444444-50.6902777777778
49518442.231944444444380.12562.106944444444575.7680555555556
50404333.090277777778374.833333333333-41.743055555555670.9097222222222
51300258.790277777778366.583333333333-107.79305555555641.2097222222223
52210235.498611111111365.416666666667-129.918055555556-25.4986111111111
53196206.490277777778378.416666666667-171.926388888889-10.4902777777779
54186251.373611111111397.166666666667-145.793055555556-65.3736111111111
55247310.490277777778405.541666666667-95.0513888888889-63.4902777777777
56343386.448611111111400.666666666667-14.2180555555555-43.448611111111
57464528.306944444444394.875133.431944444444-64.3069444444444
58680640.490277777778398.416666666667242.07361111111139.5097222222223
59711599.640277777778402.791666666667196.848611111111111.359722222222
60610477.440277777778405.45833333333371.9819444444444132.559722222222
61513473.731944444444411.62562.106944444444539.2680555555555
62292375.631944444444417.375-41.7430555555556-83.6319444444445
63273320.998611111111428.791666666667-107.793055555556-47.9986111111111
64322315.165277777778445.083333333333-129.9180555555566.8347222222223
65189288.240277777778460.166666666667-171.926388888889-99.2402777777777
66257324.290277777778470.083333333333-145.793055555556-67.2902777777777
67324382.073611111111477.125-95.0513888888889-58.0736111111111
68404468.365277777778482.583333333333-14.2180555555555-64.3652777777778
69677618.806944444445485.375133.43194444444458.1930555555555
70858726.490277777778484.416666666667242.073611111111131.509722222222
71895681.640277777778484.791666666667196.848611111111213.359722222222
72664NANA71.9819444444444NA
73628NANANANA
74308NANANANA
75324NANANANA
76248NANANANA
77272NANANANA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/1s6hh1274726815.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/1s6hh1274726815.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/2s6hh1274726815.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/2s6hh1274726815.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/3lyyk1274726815.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/3lyyk1274726815.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/4lyyk1274726815.png (open in new window)
http://www.freestatistics.org/blog/date/2010/May/24/t1274726955nll7s7gjbumbscn/4lyyk1274726815.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