Home » date » 2008 » May » 27 »

opgave 9 -2

R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Mon, 26 May 2008 23:50:22 -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/27/t1211867461gj2yogr61mh22s4.htm/, Retrieved Tue, 27 May 2008 07:51:05 +0200
 
User-defined keywords:
additieve???
 
Dataseries X:
» Textbox « » Textfile « » CSV «
0,5800 0,5800 0,5900 0,6000 0,6000 0,6100 0,6200 0,6100 0,6200 0,6200 0,6200 0,6300 0,6300 0,6300 0,6300 0,6300 0,6300 0,6300 0,6300 0,6400 0,6300 0,6300 0,6300 0,6300 0,6300 0,6400 0,6500 0,6500 0,6500 0,6500 0,6500 0,6600 0,6500 0,6600 0,6600 0,6600 0,6600 0,6800 0,6900 0,7000 0,7100 0,7100 0,7000 0,7000 0,7000 0,7000 0,7100 0,7000 0,7000 0,7000 0,6900 0,7000 0,6900 0,6900 0,6900 0,7000 0,7000 0,7100 0,7100 0,7100 0,7200 0,7300 0,7400 0,7400 0,7400 0,7400 0,7500 0,7500 0,7600 0,7600 0,7600 0,7600 0,7600 0,7700 0,7700 0,7800 0,7800 0,7800 0,7800 0,7800 0,7800 0,7800 0,8000 0,8000 0,8000 0,8100 0,8100 0,8100 0,8000 0,8100 0,8100 0,8100 0,8000 0,8200 0,8300 0,8300
 
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 time6 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
10.58NANA-0.0042939814814815NA
20.58NANA0.00174768518518517NA
30.59NANA0.00278935185185181NA
40.6NANA0.0055671296296296NA
50.6NANA0.00320601851851854NA
60.61NANA0.00077546296296296NA
70.620.6071643518518520.60875-0.001585648148148130.0128356481481481
80.610.6139004629629630.6129166666666670.000983796296296288-0.00390046296296309
90.620.6134837962962960.616666666666667-0.003182870370370360.00651620370370365
100.620.6172337962962960.619583333333333-0.002349537037037030.00276620370370362
110.620.6223032407407410.6220833333333330.000219907407407446-0.00230324074074073
120.630.6202893518518520.624166666666667-0.003877314814814790.00971064814814826
130.630.6211226851851850.625416666666667-0.00429398148148150.0088773148148149
140.630.6288310185185180.6270833333333330.001747685185185170.00116898148148159
150.630.6315393518518520.628750.00278935185185181-0.00153935185185172
160.630.6351504629629630.6295833333333330.0055671296296296-0.00515046296296284
170.630.6336226851851850.6304166666666670.00320601851851854-0.00362268518518516
180.630.6316087962962960.6308333333333330.00077546296296296-0.00160879629629618
190.630.6292476851851850.630833333333333-0.001585648148148130.000752314814814858
200.640.6322337962962960.631250.0009837962962962880.00776620370370373
210.630.629317129629630.6325-0.003182870370370360.000682870370370403
220.630.631817129629630.634166666666667-0.00234953703703703-0.00181712962962965
230.630.6360532407407410.6358333333333330.000219907407407446-0.00605324074074065
240.630.6336226851851850.6375-0.00387731481481479-0.00362268518518516
250.630.6348726851851850.639166666666667-0.0042939814814815-0.00487268518518513
260.640.6425810185185180.6408333333333330.00174768518518517-0.00258101851851844
270.650.6452893518518520.64250.002789351851851810.00471064814814826
280.650.6501504629629630.6445833333333330.0055671296296296-0.000150462962962949
290.650.6502893518518520.6470833333333330.00320601851851854-0.00028935185185186
300.650.6503587962962960.6495833333333330.00077546296296296-0.000358796296296315
310.650.6504976851851850.652083333333333-0.00158564814814813-0.000497685185185337
320.660.6559837962962960.6550.0009837962962962880.0040162037037037
330.650.6551504629629630.658333333333333-0.00318287037037036-0.00515046296296306
340.660.6597337962962960.662083333333333-0.002349537037037030.000266203703703671
350.660.6668865740740740.6666666666666670.000219907407407446-0.00688657407407411
360.660.6677893518518520.671666666666667-0.00387731481481479-0.00778935185185192
370.660.6719560185185180.67625-0.0042939814814815-0.0119560185185185
380.680.6817476851851850.680.00174768518518517-0.0017476851851852
390.690.6865393518518520.683750.002789351851851810.00346064814814806
400.70.693067129629630.68750.00556712962962960.00693287037037027
410.710.6944560185185190.691250.003206018518518540.0155439814814814
420.710.6957754629629630.6950.000775462962962960.0142245370370371
430.70.6967476851851850.698333333333333-0.001585648148148130.00325231481481481
440.70.701817129629630.7008333333333330.000983796296296288-0.00181712962962965
450.70.6984837962962960.701666666666667-0.003182870370370360.00151620370370364
460.70.699317129629630.701666666666667-0.002349537037037030.000682870370370181
470.710.7010532407407410.7008333333333330.0002199074074074460.00894675925925925
480.70.6952893518518520.699166666666667-0.003877314814814790.00471064814814814
490.70.6936226851851850.697916666666667-0.00429398148148150.00637731481481485
500.70.6992476851851850.69750.001747685185185170.000752314814814636
510.690.7002893518518520.69750.00278935185185181-0.0102893518518520
520.70.7034837962962960.6979166666666670.0055671296296296-0.00348379629629636
530.690.7015393518518520.6983333333333330.00320601851851854-0.0115393518518518
540.690.6995254629629630.698750.00077546296296296-0.00952546296296297
550.690.6984143518518520.7-0.00158564814814813-0.0084143518518519
560.70.703067129629630.7020833333333330.000983796296296288-0.00306712962962974
570.70.7022337962962960.705416666666667-0.00318287037037036-0.00223379629629628
580.710.706817129629630.709166666666667-0.002349537037037030.00318287037037035
590.710.7131365740740740.7129166666666670.000219907407407446-0.00313657407407408
600.710.7132060185185190.717083333333333-0.00387731481481479-0.00320601851851854
610.720.7173726851851850.721666666666667-0.00429398148148150.00262731481481482
620.730.7279976851851850.726250.001747685185185170.00200231481481472
630.740.7336226851851850.7308333333333330.002789351851851810.00637731481481474
640.740.7409837962962960.7354166666666670.0055671296296296-0.000983796296296191
650.740.7427893518518520.7395833333333330.00320601851851854-0.00278935185185170
660.740.7445254629629630.743750.00077546296296296-0.00452546296296286
670.750.7459143518518520.7475-0.001585648148148130.00408564814814816
680.750.751817129629630.7508333333333330.000983796296296288-0.00181712962962954
690.760.750567129629630.75375-0.003182870370370360.00943287037037033
700.760.754317129629630.756666666666667-0.002349537037037030.0056828703703703
710.760.7602199074074080.760.000219907407407446-0.000219907407407516
720.760.7594560185185190.763333333333333-0.003877314814814790.000543981481481381
730.760.7619560185185190.76625-0.0042939814814815-0.00195601851851857
740.770.7704976851851850.768750.00174768518518517-0.000497685185185226
750.770.7736226851851850.7708333333333330.00278935185185181-0.00362268518518505
760.780.778067129629630.77250.00556712962962960.00193287037037049
770.780.7782060185185190.7750.003206018518518540.00179398148148147
780.780.7791087962962960.7783333333333330.000775462962962960.000891203703703658
790.780.7800810185185190.781666666666667-0.00158564814814813-8.10185185184942e-05
800.780.7859837962962960.7850.000983796296296288-0.00598379629629631
810.780.7851504629629630.788333333333333-0.00318287037037036-0.00515046296296284
820.780.7889004629629630.79125-0.00234953703703703-0.00890046296296276
830.80.793553240740740.7933333333333330.0002199074074074460.00644675925925964
840.80.7915393518518520.795416666666666-0.003877314814814790.0084606481481484
850.80.7936226851851850.797916666666667-0.00429398148148150.00637731481481496
860.810.8021643518518520.8004166666666670.001747685185185170.0078356481481483
870.810.8052893518518520.80250.002789351851851810.00471064814814826
880.810.810567129629630.8050.0055671296296296-0.000567129629629459
890.80.8111226851851850.8079166666666670.00320601851851854-0.0111226851851851
900.810.811192129629630.8104166666666670.00077546296296296-0.00119212962962956
910.81NANA-0.00158564814814813NA
920.81NANA0.000983796296296288NA
930.8NANA-0.00318287037037036NA
940.82NANA-0.00234953703703703NA
950.83NANA0.000219907407407446NA
960.83NANA-0.00387731481481479NA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211867461gj2yogr61mh22s4/1x7u71211867415.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211867461gj2yogr61mh22s4/1x7u71211867415.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211867461gj2yogr61mh22s4/2t8g41211867415.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211867461gj2yogr61mh22s4/2t8g41211867415.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211867461gj2yogr61mh22s4/35msf1211867415.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211867461gj2yogr61mh22s4/35msf1211867415.ps (open in new window)


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