Home » date » 2010 » Jan » 09 »

Opgave 9 oef 2 decomposition

*Unverified author*
R Software Module: /rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 08 Jan 2010 16:23:10 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt.htm/, Retrieved Sat, 09 Jan 2010 00:28:10 +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/Jan/09/t1262993284lkvcrcf1pgt4avt.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:
KDGP2W52
 
Dataseries X:
» Textbox « » Textfile « » CSV «
10 15 12 13 12 15 13 13 16 14 12 15 14 19 16 16 11 13 12 11 6 9 6 15 17 13 12 13 10 14 13 10 11 12 7 11 9 13 12 5 13 11 8 8 8 8 0 3 0 -1 -1 -4 1 -1 0 -1 6 0 -3 -3
 
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
110NANA0.466145833333334NA
215NANA1.74739583333333NA
312NANA0.747395833333334NA
413NANA-1.25260416666667NA
512NANA0.299479166666667NA
615NANA1.14322916666667NA
71313.705729166666713.50.205729166666666-0.705729166666666
81313.309895833333313.8333333333333-0.523437500000001-0.309895833333334
91613.695312514.1666666666667-0.4713541666666672.3046875
101414.799479166666714.45833333333330.341145833333334-0.799479166666668
111210.674479166666714.5416666666667-3.86718751.32552083333333
121515.580729166666714.41666666666671.1640625-0.580729166666668
131414.757812514.29166666666670.466145833333334-0.7578125
141915.914062514.16666666666671.747395833333333.0859375
151614.414062513.66666666666670.7473958333333341.58593750000000
161611.789062513.0416666666667-1.252604166666674.2109375
171112.882812512.58333333333330.299479166666667-1.8828125
181313.476562512.33333333333331.14322916666667-0.4765625
191212.664062512.45833333333330.205729166666666-0.664062500000002
201111.809895833333312.3333333333333-0.523437500000001-0.809895833333334
21611.445312511.9166666666667-0.471354166666667-5.4453125
22911.966145833333311.6250.341145833333334-2.96614583333333
2367.5911458333333311.4583333333333-3.8671875-1.59114583333333
241512.622395833333311.45833333333331.16406252.37760416666667
251712.007812511.54166666666670.4661458333333344.9921875
261313.289062511.54166666666671.74739583333333-0.2890625
271212.455729166666711.70833333333330.747395833333334-0.455729166666666
281310.789062512.0416666666667-1.252604166666672.2109375
291012.507812512.20833333333330.299479166666667-2.5078125
301413.226562512.08333333333331.143229166666670.7734375
311311.789062511.58333333333330.2057291666666661.2109375
321010.726562511.25-0.523437500000001-0.7265625
331110.778645833333311.25-0.4713541666666670.221354166666668
341211.257812510.91666666666670.3411458333333340.7421875
3576.8411458333333310.7083333333333-3.86718750.158854166666668
361111.872395833333310.70833333333331.1640625-0.872395833333334
37910.841145833333310.3750.466145833333334-1.84114583333333
381311.830729166666710.08333333333331.747395833333331.16927083333333
391210.62239583333339.8750.7473958333333341.37760416666667
4058.330729166666679.58333333333333-1.25260416666667-3.33072916666667
41139.424479166666669.1250.2994791666666673.57552083333334
42119.643229166666678.51.143229166666671.35677083333333
4387.997395833333337.791666666666670.2057291666666660.00260416666666785
4486.309895833333336.83333333333333-0.5234375000000011.69010416666667
4585.236979166666675.70833333333333-0.4713541666666672.76302083333333
4685.13281254.791666666666670.3411458333333342.8671875
4700.04947916666666563.91666666666667-3.8671875-0.0494791666666656
4834.080729166666672.916666666666671.1640625-1.08072916666667
4902.549479166666672.083333333333330.466145833333334-2.54947916666667
50-13.122395833333331.3751.74739583333333-4.12239583333333
51-11.66406250.9166666666666670.747395833333334-2.6640625
52-4-0.7526041666666670.5-1.25260416666667-3.24739583333333
5310.3411458333333340.04166666666666670.2994791666666670.658854166666666
54-10.809895833333334-0.3333333333333331.14322916666667-1.80989583333333
550NANA0.205729166666666NA
56-1NANA-0.523437500000001NA
576NANA-0.471354166666667NA
580NANA0.341145833333334NA
59-3NANA-3.8671875NA
60-3NANA1.1640625NA
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/1l6ds1262992988.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/1l6ds1262992988.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/2fufu1262992988.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/2fufu1262992988.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/31mw01262992988.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/31mw01262992988.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/4ym901262992988.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Jan/09/t1262993284lkvcrcf1pgt4avt/4ym901262992988.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