Home » date » 2009 » May » 29 »

Opgave 9, oefening 2, stap 1, Sara Vandenberghe

*Unverified author*
R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 29 May 2009 05:34:11 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/May/29/t124359689690qjsisq99nee6d.htm/, Retrieved Fri, 29 May 2009 13:35:01 +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/2009/May/29/t124359689690qjsisq99nee6d.htm/},
    year = {2009},
}
@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 = {2009},
    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 «
1,54 1,55 1,53 1,55 1,55 1,53 1,54 1,54 1,54 1,53 1,53 1,53 1,54 1,53 1,53 1,54 1,55 1,53 1,53 1,53 1,53 1,52 1,54 1,53 1,52 1,54 1,53 1,54 1,54 1,53 1,54 1,54 1,52 1,52 1,57 1,6 1,59 1,6 1,6 1,62 1,61 1,61 1,62 1,61 1,62 1,61 1,62 1,61 1,61 1,58 1,57 1,57 1,66 1,66 1,67 1,68 1,66 1,66 1,64 1,61 1,58 1,57 1,54 1,61 1,65 1,6 1,57 1,56 1,55 1,54 1,51 1,5 1,5 1,49 1,47 1,47 1,49 1,49 1,49 1,51 1,49 1,48 1,46 1,46 1,45 1,45 1,44 1,47 1,47 1,45 1,43 1,44 1,38 1,4 1,37 1,41
 
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
11.54NANA-0.0098412698412697NA
21.55NANA-0.0128769841269841NA
31.53NANA-0.0227579365079365NA
41.55NANA-0.00103174603174598NA
51.55NANA0.0221230158730158NA
61.53NANA0.00950396825396824NA
71.541.546468253968251.538333333333330.0081349206349206-0.00646825396825368
81.541.548194444444441.53750.0106944444444444-0.00819444444444395
91.541.539920634920631.536666666666670.003253968253968227.93650793651235e-05
101.531.533373015873021.53625-0.0028769841269842-0.00337301587301564
111.531.535337301587301.53583333333333-0.000496031746031797-0.00533730158730172
121.531.532003968253971.53583333333333-0.00382936507936505-0.00200396825396831
131.541.525575396825401.53541666666667-0.00984126984126970.0144246031746031
141.531.521706349206351.53458333333333-0.01287698412698410.00829365079365108
151.531.510992063492061.53375-0.02275793650793650.0190079365079365
161.541.531884920634921.53291666666667-0.001031746031745980.00811507936507949
171.551.555039682539681.532916666666670.0221230158730158-0.00503968253968234
181.531.54283730158731.533333333333330.00950396825396824-0.0128373015873013
191.531.540634920634921.53250.0081349206349206-0.0106349206349203
201.531.542777777777781.532083333333330.0106944444444444-0.0127777777777773
211.531.535753968253971.53250.00325396825396822-0.00575396825396801
221.521.529623015873021.5325-0.0028769841269842-0.0096230158730155
231.541.53158730158731.53208333333333-0.0004960317460317970.00841269841269887
241.531.52783730158731.53166666666667-0.003829365079365050.00216269841269878
251.521.522242063492061.53208333333333-0.0098412698412697-0.00224206349206324
261.541.520039682539681.53291666666667-0.01287698412698410.0199603174603178
271.531.510158730158731.53291666666667-0.02275793650793650.01984126984127
281.541.531468253968251.5325-0.001031746031745980.008531746031746
291.541.555873015873021.533750.0221230158730158-0.0158730158730158
301.531.547420634920631.537916666666670.00950396825396824-0.0174206349206347
311.541.551884920634921.543750.0081349206349206-0.0118849206349205
321.541.559861111111111.549166666666670.0106944444444444-0.0198611111111111
331.521.557837301587301.554583333333330.00325396825396822-0.0378373015873017
341.521.557956349206351.56083333333333-0.0028769841269842-0.0379563492063493
351.571.566587301587301.56708333333333-0.0004960317460317970.00341269841269831
361.61.569503968253971.57333333333333-0.003829365079365050.0304960317460317
371.591.570158730158731.58-0.00984126984126970.0198412698412698
381.61.573373015873021.58625-0.01287698412698410.0266269841269842
391.61.570575396825401.59333333333333-0.02275793650793650.0294246031746033
401.621.600218253968251.60125-0.001031746031745980.0197817460317460
411.611.629206349206351.607083333333330.0221230158730158-0.0192063492063492
421.611.619087301587301.609583333333330.00950396825396824-0.00908730158730142
431.621.618968253968251.610833333333330.00813492063492060.00103174603174616
441.611.621527777777781.610833333333330.0106944444444444-0.0115277777777776
451.621.612003968253971.608750.003253968253968220.0079960317460317
461.611.602539682539681.60541666666667-0.00287698412698420.00746031746031761
471.621.604920634920631.60541666666667-0.0004960317460317970.0150793650793655
481.611.605753968253971.60958333333333-0.003829365079365050.004246031746032
491.611.603908730158731.61375-0.00984126984126970.00609126984127029
501.581.605873015873021.61875-0.0128769841269841-0.0258730158730156
511.571.600575396825401.62333333333333-0.0227579365079365-0.0305753968253966
521.571.626051587301591.62708333333333-0.00103174603174598-0.0560515873015872
531.661.652123015873021.630.02212301587301580.00787698412698412
541.661.64033730158731.630833333333330.009503968253968240.0196626984126986
551.671.637718253968251.629583333333330.00813492063492060.0322817460317462
561.681.638611111111111.627916666666670.01069444444444440.0413888888888889
571.661.629503968253971.626250.003253968253968220.0304960317460319
581.661.623789682539681.62666666666667-0.00287698412698420.0362103174603177
591.641.627420634920631.62791666666667-0.0004960317460317970.0125793650793653
601.611.621170634920631.625-0.00382936507936505-0.0111706349206344
611.581.608492063492061.61833333333333-0.0098412698412697-0.0284920634920629
621.571.596289682539681.60916666666667-0.0128769841269841-0.0262896825396823
631.541.576825396825401.59958333333333-0.0227579365079365-0.0368253968253967
641.611.588968253968251.59-0.001031746031745980.0210317460317464
651.651.601706349206351.579583333333330.02212301587301580.0482936507936507
661.61.57908730158731.569583333333330.009503968253968240.0209126984126986
671.571.569801587301591.561666666666670.00813492063492060.000198412698412476
681.561.565694444444441.5550.0106944444444444-0.00569444444444445
691.551.552003968253971.548750.00325396825396822-0.00200396825396809
701.541.537123015873021.54-0.00287698412698420.00287698412698423
711.511.527003968253971.5275-0.000496031746031797-0.017003968253968
721.51.512420634920641.51625-0.00382936507936505-0.0124206349206351
731.51.498492063492061.50833333333333-0.00984126984126970.00150793650793646
741.491.490039682539681.50291666666667-0.0128769841269841-3.96825396824507e-05
751.471.475575396825401.49833333333333-0.0227579365079365-0.00557539682539709
761.471.492301587301591.49333333333333-0.00103174603174598-0.0223015873015875
771.491.510873015873021.488750.0221230158730158-0.0208730158730159
781.491.494503968253971.4850.00950396825396824-0.00450396825396826
791.491.489384920634921.481250.00813492063492060.000615079365079207
801.511.488194444444441.47750.01069444444444440.0218055555555556
811.491.477837301587301.474583333333330.003253968253968220.0121626984126981
821.481.470456349206351.47333333333333-0.00287698412698420.0095436507936506
831.461.472003968253971.4725-0.000496031746031797-0.0120039682539683
841.461.466170634920641.47-0.00382936507936505-0.00617063492063519
851.451.455992063492061.46583333333333-0.0098412698412697-0.0059920634920636
861.451.447539682539681.46041666666667-0.01287698412698410.00246031746031750
871.441.430158730158731.45291666666667-0.02275793650793650.00984126984126998
881.471.443968253968251.445-0.001031746031745980.0260317460317461
891.471.460039682539681.437916666666670.02212301587301580.00996031746031756
901.451.44158730158731.432083333333330.009503968253968240.00841269841269865
911.43NANA0.0081349206349206NA
921.44NANA0.0106944444444444NA
931.38NANA0.00325396825396822NA
941.4NANA-0.0028769841269842NA
951.37NANA-0.000496031746031797NA
961.41NANA-0.00382936507936505NA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/13g4e1243596849.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/13g4e1243596849.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/2tji01243596849.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/2tji01243596849.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/3kc511243596849.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/3kc511243596849.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/4miv21243596849.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/May/29/t124359689690qjsisq99nee6d/4miv21243596849.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