Home » date » 2010 » Dec » 06 »

opgave 9 oef 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, 06 Dec 2010 18:40:58 +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/06/t1291660786jh7vzdb7exo4ltf.htm/, Retrieved Mon, 06 Dec 2010 19:39:51 +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/06/t1291660786jh7vzdb7exo4ltf.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 «
102,8 106,3 103,7 106,9 104,3 105,4 96,2 95,7 95,9 93,6 94,7 94,5 96,6 96,7 98,9 102 105,2 106,4 99,3 96,4 93,1 95,6 93,3 96,7 105,6 105,2 107 104,9 104,5 105,2 99,7 100,2 98,5 98,4 97,1 98,4 100,6 111,3 119 117,8 108,8 109,3 103,5 103,7 110 105,5 110,4 106,7 110,2 105,2 108 108,1 107,2 106 99,4 100,2 100,3 100,8 99,5 100,2 103 111 120,5 109,5 106,6 105,5 103,9 104,9 104,8 99,6 97 95,4 99,3 103,9 107,4 107,4 111 113,2 108,5 113,3 113,8 105,3 107,5 109,4 118,9 119 115 124,1 120,5 117,7 117,1 118,1 119,6 118,8 124,9 124 124,9 121,7 121,6 125,1 127,9 129 130,1 130,3 127,9 124,1 125,7 129,2 129,2 132,6 131,5 131 125,8 127,2 127,3 127,5 122 118,4 118,3 115,5
 
Output produced by software:


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


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1102.8NANA0.279359567901239NA
2106.3NANA2.02148919753087NA
3103.7NANA4.23121141975309NA
4106.9NANA4.10667438271605NA
5104.3NANA2.5048225308642NA
6105.4NANA2.52056327160494NA
796.298.012229938271699.7416666666667-1.72943672839506-1.8122299382716
895.797.676581790123499.0833333333333-1.40675154320988-1.97658179012343
995.996.948341049382798.4833333333333-1.53499228395062-1.0483410493827
1093.693.837229938271698.0791666666667-4.24193672839506-0.237229938271597
1194.794.392785493827197.9125-3.519714506172840.307214506172869
1294.594.760378086419797.9916666666666-3.23128858024691-0.260378086419735
1396.698.441859567901298.16250.279359567901239-1.84185956790124
1496.7100.34232253086498.32083333333332.02148919753087-3.64232253086418
1598.9102.46454475308698.23333333333334.23121141975309-3.56454475308642
16102102.30667438271698.24.10667438271605-0.306674382716054
17105.2100.72982253086498.2252.50482253086424.4701774691358
18106.4100.77889660493898.25833333333332.520563271604945.62110339506172
1999.396.99556327160598.725-1.729436728395062.30443672839506
2096.498.047415123456899.4541666666667-1.40675154320988-1.64741512345677
2193.198.6108410493827100.145833333333-1.53499228395062-5.51084104938272
2295.696.3622299382716100.604166666667-4.24193672839506-0.762229938271616
2393.397.1761188271605100.695833333333-3.51971450617284-3.87611882716048
2496.797.3853780864198100.616666666667-3.23128858024691-0.68537808641976
25105.6100.862692901235100.5833333333330.2793595679012394.73730709876543
26105.2102.779822530864100.7583333333332.021489197530872.42017746913579
27107105.372878086420101.1416666666674.231211419753091.62712191358024
28104.9105.590007716049101.4833333333334.10667438271605-0.690007716049379
29104.5104.263155864198101.7583333333332.50482253086420.236844135802471
30105.2104.508063271605101.98752.520563271604940.691936728395063
3199.7100.120563271605101.85-1.72943672839506-0.420563271604934
32100.2100.489081790123101.895833333333-1.40675154320988-0.289081790123461
3398.5101.115007716049102.65-1.53499228395062-2.61500771604938
3498.499.445563271605103.6875-4.24193672839506-1.04556327160493
3597.1100.884452160494104.404166666667-3.51971450617284-3.78445216049383
3698.4101.522878086420104.754166666667-3.23128858024691-3.12287808641975
37100.6105.362692901235105.0833333333330.279359567901239-4.76269290123456
38111.3107.408989197531105.38752.021489197530873.89101080246914
39119110.243711419753106.01254.231211419753098.7562885802469
40117.8110.894174382716106.78754.106674382716056.90582561728397
41108.8110.142322530864107.63752.5048225308642-1.34232253086419
42109.3111.058063271605108.53752.52056327160494-1.75806327160494
43103.5107.553896604938109.283333333333-1.72943672839506-4.05389660493825
44103.7108.022415123457109.429166666667-1.40675154320988-4.32241512345678
45110107.181674382716108.716666666667-1.534992283950622.81832561728397
46105.5103.612229938272107.854166666667-4.241936728395061.88777006172840
47110.4103.863618827160107.383333333333-3.519714506172846.53638117283951
48106.7103.947878086420107.179166666667-3.231288580246912.75212191358024
49110.2107.150192901235106.8708333333330.2793595679012393.04980709876543
50105.2108.575655864198106.5541666666672.02148919753087-3.37565586419754
51108110.235378086420106.0041666666674.23121141975309-2.23537808641976
52108.1109.510841049383105.4041666666674.10667438271605-1.41084104938273
53107.2107.258989197531104.7541666666672.5048225308642-0.0589891975308632
54106106.549729938272104.0291666666672.52056327160494-0.549729938271611
5599.4101.728896604938103.458333333333-1.72943672839506-2.32889660493827
56100.2101.99324845679103.4-1.40675154320988-1.79324845679010
57100.3102.627507716049104.1625-1.53499228395062-2.32750771604938
58100.8100.499729938272104.741666666667-4.241936728395060.300270061728412
5999.5101.255285493827104.775-3.51971450617284-1.75528549382713
60100.2101.497878086420104.729166666667-3.23128858024691-1.29787808641974
61103105.175192901235104.8958333333330.279359567901239-2.17519290123455
62111107.300655864198105.2791666666672.021489197530873.69934413580246
63120.5109.893711419753105.66254.2312114197530910.6062885802469
64109.5109.906674382716105.84.10667438271605-0.406674382716048
65106.6108.150655864198105.6458333333332.5048225308642-1.55065586419752
66105.5107.862229938272105.3416666666672.52056327160494-2.36222993827160
67103.9103.258063271605104.9875-1.729436728395060.641936728395052
68104.9103.130748456790104.5375-1.406751543209881.76925154320988
69104.8102.160841049383103.695833333333-1.534992283950622.63915895061727
7099.698.820563271605103.0625-4.241936728395060.779436728395055
719799.6386188271605103.158333333333-3.51971450617284-2.63861882716047
7295.4100.431211419753103.6625-3.23128858024691-5.03121141975306
7399.3104.454359567901104.1750.279359567901239-5.15435956790124
74103.9106.738155864198104.7166666666672.02148919753087-2.83815586419753
75107.4109.672878086420105.4416666666674.23121141975309-2.27287808641975
76107.4110.160841049383106.0541666666674.10667438271605-2.76084104938272
77111109.233989197531106.7291666666672.50482253086421.76601080246914
78113.2110.270563271605107.752.520563271604942.92943672839506
79108.5107.420563271605109.15-1.729436728395061.07943672839507
80113.3109.189081790123110.595833333333-1.406751543209884.11091820987653
81113.8110.006674382716111.541666666667-1.534992283950623.79332561728394
82105.3108.312229938272112.554166666667-4.24193672839506-3.0122299382716
83107.5110.126118827160113.645833333333-3.51971450617284-2.62611882716050
84109.4110.997878086420114.229166666667-3.23128858024691-1.59787808641974
85118.9115.054359567901114.7750.2793595679012393.84564043209879
86119117.354822530864115.3333333333332.021489197530871.64517746913583
87115120.006211419753115.7754.23121141975309-5.00621141975306
88124.1120.685841049383116.5791666666674.106674382716053.41415895061729
89120.5120.371489197531117.8666666666672.50482253086420.128510802469137
90117.7121.720563271605119.22.52056327160494-4.02056327160494
91117.1118.328896604938120.058333333333-1.72943672839506-1.22889660493829
92118.1119.014081790123120.420833333333-1.40675154320988-0.914081790123461
93119.6119.273341049383120.808333333333-1.534992283950620.326658950617272
94118.8116.883063271605121.125-4.241936728395061.91693672839506
95124.9117.955285493827121.475-3.519714506172846.94471450617287
96124119.022878086420122.254166666667-3.231288580246914.97712191358025
97124.9123.546026234568123.2666666666670.2793595679012391.35397376543212
98121.7126.338155864198124.3166666666672.02148919753087-4.63815586419751
99121.6129.402044753086125.1708333333334.23121141975309-7.80204475308643
100125.1129.844174382716125.73754.10667438271605-4.74417438271605
101127.9128.496489197531125.9916666666672.5048225308642-0.596489197530857
102129128.762229938272126.2416666666672.520563271604940.237770061728412
103130.1124.908063271605126.6375-1.729436728395065.19193672839506
104130.3125.864081790123127.270833333333-1.406751543209884.43591820987658
105127.9126.602507716049128.1375-1.534992283950621.29749228395065
106124.1124.553896604938128.795833333333-4.24193672839506-0.453896604938251
107125.7125.434452160494128.954166666667-3.519714506172840.265547839506155
108129.2125.560378086420128.791666666667-3.231288580246913.63962191358024
109129.2128.879359567901128.60.2793595679012390.32064043209877
110132.6130.388155864198128.3666666666672.021489197530872.21184413580249
111131.5132.235378086420128.0041666666674.23121141975309-0.735378086419757
112131131.627507716049127.5208333333334.10667438271605-0.62750771604938
113125.8129.479822530864126.9752.5048225308642-3.6798225308642
114127.2128.616396604938126.0958333333332.52056327160494-1.41639660493827
115127.3NANA-1.72943672839506NA
116127.5NANA-1.40675154320988NA
117122NANA-1.53499228395062NA
118118.4NANA-4.24193672839506NA
119118.3NANA-3.51971450617284NA
120115.5NANA-3.23128858024691NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/1gm0b1291660854.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/1gm0b1291660854.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/2gm0b1291660854.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/2gm0b1291660854.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/39v0e1291660854.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/39v0e1291660854.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/414zz1291660854.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/06/t1291660786jh7vzdb7exo4ltf/414zz1291660854.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