Home » date » 2008 » May » 30 »

opgave10(oefening2)

R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Fri, 30 May 2008 03:00:10 -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/30/t1212138054mss0nl614ykkm0q.htm/, Retrieved Fri, 30 May 2008 09:00:59 +0000
 
User-defined keywords:
Inleiding tot kwantitatief onderzoek
 
Dataseries X:
» Textbox « » Textfile « » CSV «
107,5 107,5 113,3 107,8 104,5 105,1 104,2 106,6 103,8 107,7 106,4 110 113,2 113,9 112 113,9 113,1 111,7 110,7 113,5 114 112,7 112,2 115,8 118,4 118,8 123,9 118 120,2 118,7 119,8 124,8 121,3 120,2 118,3 129,6 130,2 127,19 133,1 129,12 123,28 123,36 124,13 126,96 127,14 123,7 123,67 130,19 134,01 124,96 129,96 128,32 132,38 126,25 128,91 131,42 129,44 126,86 126,71 131,63 132,78 126,61 132,84 123,14 128,13 125,49 126,48 130,86 127,32 126,56 126,64 129,26 126,47 135,38 135,5 132,22 122,62 125,16 128,5 133,86 128,87 125,07 125,25 132,16 130,24
 
Text written by user:
Kara Van den Acker
 
Output produced by software:


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


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.208973562504445
beta0.109887621724869
gamma0.279719189082164


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13113.2109.9004444444453.2995555555555
14113.9111.3807919942342.51920800576609
15112110.0017509744641.99824902553620
16113.9112.4388969742261.46110302577384
17113.1112.2806791909870.819320809013234
18111.7111.3738271199350.326172880064505
19110.7110.796410275419-0.0964102754186626
20113.5113.965970795695-0.465970795694773
21114114.468435900229-0.468435900228599
22112.7113.192962218133-0.492962218133187
23112.2112.901042992979-0.701042992979126
24115.8116.528708577351-0.728708577350915
25118.4121.388936070923-2.98893607092288
26118.8121.409624807102-2.60962480710229
27123.9118.7528801849955.14711981500547
28118121.710871602031-3.71087160203068
29120.2120.1927429681450.00725703185524651
30118.7118.851325841396-0.151325841396485
31119.8117.9139076333131.88609236668715
32124.8121.2947995197313.50520048026935
33121.3122.596593046716-1.29659304671632
34120.2121.093616172693-0.893616172692958
35118.3120.613715933197-2.31371593319659
36129.6123.8030074055715.79699259442884
37130.2129.5814310388130.618568961187009
38127.19130.577369667350-3.38736966735038
39133.1129.5939836279673.50601637203326
40129.12130.330964737036-1.21096473703628
41123.28130.297252996741-7.0172529967407
42123.36127.430811708914-4.07081170891371
43124.13126.013130544339-1.88313054433884
44126.96128.766048005480-1.80604800547955
45127.14127.574936543771-0.434936543771229
46123.7126.04045031653-2.34045031652990
47123.67124.610019127134-0.940019127134306
48130.19129.5785779889090.611422011091292
49134.01132.7060526647441.3039473352558
50124.96132.553084430357-7.59308443035728
51129.96131.713746041498-1.75374604149775
52128.32129.684752523245-1.36475252324536
53132.38127.7075224963904.67247750361025
54126.25127.577658615698-1.32765861569837
55128.91126.9220621307031.98793786929713
56131.42130.2946602684411.12533973155871
57129.44129.880499966701-0.440499966701083
58126.86127.784088617249-0.924088617249467
59126.71126.852892655279-0.142892655279169
60131.63132.243001110282-0.613001110281886
61132.78135.151409544114-2.37140954411387
62126.61132.060959281453-5.45095928145291
63132.84132.8096767049960.0303232950044219
64123.14131.128911419740-7.98891141973972
65128.13128.840456227516-0.71045622751592
66125.49125.871687732967-0.381687732967038
67126.48125.7827314061890.697268593811103
68130.86128.3004432407012.55955675929891
69127.32127.478157694923-0.158157694922977
70126.56124.9788579015301.58114209847038
71126.64124.4466804617532.19331953824712
72129.26129.977264682529-0.717264682529446
73126.47132.228703652032-5.75870365203167
74135.38127.4251101528027.95488984719839
75135.5132.1720688734983.32793112650157
76132.22129.4657190110512.75428098894949
77122.62131.339159575819-8.71915957581882
78125.16126.892003326774-1.73200332677361
79128.5126.8510686533861.64893134661386
80133.86130.0930325010313.76696749896905
81128.87129.062774510051-0.192774510051493
82125.07127.081338898747-2.01133889874713
83125.25125.991636727422-0.741636727421522
84132.16130.2552394948921.90476050510765
85130.24131.989686221112-1.74968622111246


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
86131.200844084039125.230256164462137.171432003615
87133.221613565442127.092535767388139.350691363496
88129.576421638786123.261217991057135.891625286515
89128.155904512373121.626423390558134.685385634188
90127.097348687425120.325334901273133.869362473577
91128.226724946338121.184173253020135.269276639655
92131.615172763445124.274613461765138.955732065124
93128.857480769471121.192195615821136.522765923121
94126.454287599707118.438460289278134.470114910136
95126.052373491941117.661182869943134.443564113939
96131.060075601273122.26974167811139.850409524436
97131.547696476016122.335489629103140.759903322928
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t1212138054mss0nl614ykkm0q/1wgua1212138000.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t1212138054mss0nl614ykkm0q/1wgua1212138000.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t1212138054mss0nl614ykkm0q/2lt8u1212138000.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t1212138054mss0nl614ykkm0q/2lt8u1212138000.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t1212138054mss0nl614ykkm0q/375yo1212138000.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t1212138054mss0nl614ykkm0q/375yo1212138000.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = additive ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; par3 = additive ;
 
R code (references can be found in the software module):
par1 <- as.numeric(par1)
if (par2 == 'Single') K <- 1
if (par2 == 'Double') K <- 2
if (par2 == 'Triple') K <- par1
nx <- length(x)
nxmK <- nx - K
x <- ts(x, frequency = par1)
if (par2 == 'Single') fit <- HoltWinters(x, gamma=0, beta=0)
if (par2 == 'Double') fit <- HoltWinters(x, gamma=0)
if (par2 == 'Triple') fit <- HoltWinters(x, seasonal=par3)
fit
myresid <- x - fit$fitted[,'xhat']
bitmap(file='test1.png')
op <- par(mfrow=c(2,1))
plot(fit,ylab='Observed (black) / Fitted (red)',main='Interpolation Fit of Exponential Smoothing')
plot(myresid,ylab='Residuals',main='Interpolation Prediction Errors')
par(op)
dev.off()
bitmap(file='test2.png')
p <- predict(fit, par1, prediction.interval=TRUE)
np <- length(p[,1])
plot(fit,p,ylab='Observed (black) / Fitted (red)',main='Extrapolation Fit of Exponential Smoothing')
dev.off()
bitmap(file='test3.png')
op <- par(mfrow = c(2,2))
acf(as.numeric(myresid),lag.max = nx/2,main='Residual ACF')
spectrum(myresid,main='Residals Periodogram')
cpgram(myresid,main='Residal Cumulative Periodogram')
qqnorm(myresid,main='Residual Normal QQ Plot')
qqline(myresid)
par(op)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Estimated Parameters of Exponential Smoothing',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'Value',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'alpha',header=TRUE)
a<-table.element(a,fit$alpha)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'beta',header=TRUE)
a<-table.element(a,fit$beta)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'gamma',header=TRUE)
a<-table.element(a,fit$gamma)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Interpolation Forecasts of Exponential Smoothing',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Observed',header=TRUE)
a<-table.element(a,'Fitted',header=TRUE)
a<-table.element(a,'Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:nxmK) {
a<-table.row.start(a)
a<-table.element(a,i+K,header=TRUE)
a<-table.element(a,x[i+K])
a<-table.element(a,fit$fitted[i,'xhat'])
a<-table.element(a,myresid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Extrapolation Forecasts of Exponential Smoothing',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'t',header=TRUE)
a<-table.element(a,'Forecast',header=TRUE)
a<-table.element(a,'95% Lower Bound',header=TRUE)
a<-table.element(a,'95% Upper Bound',header=TRUE)
a<-table.row.end(a)
for (i in 1:np) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,p[i,'fit'])
a<-table.element(a,p[i,'lwr'])
a<-table.element(a,p[i,'upr'])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.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