Home » date » 2008 » May » 27 »

opgave10(oefening2)

R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Tue, 27 May 2008 11:07:54 -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/t1211908131dfni1imvxw6txbw.htm/, Retrieved Tue, 27 May 2008 19:08:51 +0200
 
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 time6 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.209409698147397
beta0.108381287029044
gamma0.300287584116774


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13113.2109.7759280644253.42407193557545
14113.9111.2832256949972.61677430500343
15112109.9726649292982.02733507070204
16113.9112.400221428091.49977857191004
17113.1112.2652287993860.834771200614057
18111.7111.3689099618900.331090038109721
19110.7110.787274521677-0.0872745216767044
20113.5113.958962582679-0.458962582679035
21114114.461425076549-0.461425076549176
22112.7113.178410302636-0.478410302635695
23112.2112.877345775629-0.677345775628766
24115.8116.524038337809-0.724038337808935
25118.4121.764793423966-3.36479342396572
26118.8121.673020616404-2.87302061640438
27123.9118.7645081897715.13549181022938
28118121.777885565704-3.77788556570430
29120.2120.1350474428620.0649525571383265
30118.7118.6642680234420.0357319765576989
31119.8117.6569390223472.14306097765316
32124.8121.2425021182453.55749788175487
33121.3122.544992746328-1.24499274632808
34120.2120.912761006353-0.71276100635258
35118.3120.397980217044-2.09798021704368
36129.6123.8514466439175.74855335608321
37130.2130.1870024698820.0129975301183265
38127.19131.061621092611-3.87162109261138
39133.1129.8680561585503.23194384145026
40129.12130.362799559793-1.24279955979347
41123.28130.244471314226-6.96447131422588
42123.36127.113206928932-3.75320692893187
43124.13125.623117572303-1.49311757230296
44126.96128.733258718716-1.77325871871643
45127.14127.398746033049-0.258746033049405
46123.7125.720577032665-2.02057703266482
47123.67124.228710615527-0.558710615527261
48130.19129.7559326753170.434067324682786
49134.01133.2695759014680.740424098532287
50124.96132.938970192895-7.9789701928952
51129.96132.072407311814-2.11240731181402
52128.32129.764534108095-1.44453410809507
53132.38127.6215551020424.75844489795772
54126.25127.341780942959-1.09178094295946
55128.91126.6544110684592.255588931541
56131.42130.3309250276201.08907497238025
57129.44129.799105801815-0.359105801815161
58126.86127.498202352423-0.638202352422951
59126.71126.5179630876750.192036912324724
60131.63132.463297611215-0.833297611214817
61132.78135.719117079147-2.93911707914731
62126.61132.290671591549-5.6806715915494
63132.84133.170367078481-0.330367078480549
64123.14131.254569897908-8.11456989790811
65128.13128.916188809941-0.786188809941109
66125.49125.729692385253-0.239692385253207
67126.48125.6527981448930.827201855107106
68130.86128.3144500993912.54554990060947
69127.32127.401647275270-0.0816472752695745
70126.56124.7874476827931.77255231720679
71126.64124.2310098147992.40899018520055
72129.26130.064637612067-0.804637612066955
73126.47132.521887934877-6.05188793487736
74135.38127.5454685447507.83453145524955
75135.5132.4968433748303.00315662517031
76132.22129.4623225335422.75767746645801
77122.62131.469291974559-8.84929197455872
78125.16126.821957640582-1.66195764058216
79128.5126.7911980463671.7088019536328
80133.86130.1808918162463.67910818375356
81128.87128.992825158372-0.122825158372166
82125.07126.913764603838-1.84376460383797
83125.25125.791821816828-0.54182181682782
84132.16130.2386483920601.92135160793961
85130.24132.060014233799-1.82001423379899


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
86131.375554384317128.674459266286134.076649502349
87133.497534448056130.443377559773136.551691336338
88129.673844622614126.288270108523133.059419136705
89128.160094092738124.408137655013131.912050530463
90127.093142655933122.954097234358131.232188077509
91128.284521302000123.692535223561132.876507380438
92131.826550842537126.690006781396136.963094903677
93128.910182569821123.400144902906134.420220236735
94126.396098367387120.500339684379132.291857050395
95125.958437923751119.592311489528132.324564357975
96131.121477066829124.01415631411138.228797819549
97131.60993913128940.0240179663676223.19586029621
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211908131dfni1imvxw6txbw/1u3rr1211908064.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211908131dfni1imvxw6txbw/1u3rr1211908064.ps (open in new window)


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211908131dfni1imvxw6txbw/3eepl1211908064.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/27/t1211908131dfni1imvxw6txbw/3eepl1211908064.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ;
 
Parameters (R input):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ;
 
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