Home » date » 2009 » Jun » 03 »

opgave 10 oefening 2 exponential smoothing - Kathleen Geets

*Unverified author*
R Software Module: rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Wed, 03 Jun 2009 07:04:21 -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/Jun/03/t1244034418e8bf8m596q9p0ah.htm/, Retrieved Wed, 03 Jun 2009 15:07:03 +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/Jun/03/t1244034418e8bf8m596q9p0ah.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 «
112 118 129 99 116 168 118 129 205 147 150 267 126 129 124 97 102 127 222 214 118 141 154 226 89 77 82 97 127 121 117 117 106 112 134 169 75 108 115 85 101 108 109 124 105 95 135 164 88 85 112 87 91 87 87 142 95 108 139 159 61 82 124 93 108 75 87 103 90 108 123 129 57 65 67 71 76 67 110 118 99 85 107 141 58 65 70 86 93 74 87 73 101 100 96 157 63 115 70 66 67 83 79 77 102 116 100 135 71 60 89 74 73 91 86 74 87 87 109 137 43 69 73 77 69 76 78 70 83 65 110 132 54 55 66 65 60 65 96 55 71 63 74 106 34 47 56 53 53 55 67 52 46 51 58 91 33 40 46 45 41 55 57 54 46 52 48 77 30 35 42 48 44 45 1 1 46 51 63 84 30 39 45 52 28 40 62
 
Output produced by software:


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


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.109310071929840
beta0.0423714166076927
gamma0.472651426343311


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
13126130.144329985792-4.14432998579227
14129126.4973364752022.50266352479839
15124122.3541030737971.64589692620297
169798.6545153114343-1.65451531143428
17102103.969145181214-1.96914518121376
18127130.955762730820-3.95576273082045
19222124.11695550376997.8830444962313
20214147.27851011010266.7214898898984
21118247.190435707455-129.190435707455
22141168.439700539795-27.4397005397954
23154170.457645185292-16.457645185292
24226306.402041255351-80.4020412553512
2589136.587960570770-47.5879605707703
2677130.795017573918-53.7950175739177
2782119.840986676980-37.8409866769804
289791.5256377958965.474362204104
2912796.733945109754330.2660548902457
30121125.284544776200-4.28454477620036
31117156.494041345659-39.494041345659
32117149.366479212369-32.3664792123691
33106149.786376099908-43.786376099908
34112125.960237358704-13.9602373587043
35134130.9536523322173.04634766778256
36169218.523586317661-49.5235863176611
377592.710859859669-17.710859859669
3810886.572608112697721.4273918873023
3911589.386695907434625.6133040925654
408586.488885504333-1.48888550433298
4110199.43785980222241.56214019777758
42108108.617948701567-0.617948701566576
43109122.534659682694-13.5346596826945
44124120.5392142910643.46078570893609
45105119.338657358978-14.3386573589780
4695111.535628022854-16.5356280228535
47135122.20913832707512.7908616729245
48164183.629086168514-19.6290861685139
498880.29186013592447.70813986407559
508592.9576922612251-7.95769226122508
5111293.821654053834818.1783459461652
528779.80391807584557.19608192415453
539194.076640908052-3.076640908052
5487101.224984207056-14.2249842070565
5587107.310872316043-20.3108723160434
56142110.91694926332531.083050736675
5795105.693510297452-10.6935102974518
5810897.66117330211210.3388266978881
59139122.68916083585216.3108391641485
60159169.274115650301-10.2741156503008
616181.1515729239403-20.1515729239403
628283.7547036208831-1.75470362088309
6312495.375168752656528.6248312473435
649378.852069517233914.1479304827661
6510889.260275726464118.7397242735359
667594.14773091836-19.14773091836
678797.0203589012782-10.0203589012782
68103123.080645145108-20.0806451451076
699095.9497204919883-5.94972049198826
7010897.148444122193610.8515558778064
71123123.424604610866-0.424604610866453
72129154.820279590623-25.8202795906231
735767.1183231968959-10.1183231968959
746577.7096229868696-12.7096229868696
756798.4845779076198-31.4845779076198
767172.451782263067-1.45178226306703
777680.6943199911947-4.69431999119467
786768.9183976927783-1.91839769277827
7911075.367433245684934.6325667543151
8011898.4356256208719.56437437913
819983.419837454244515.5801625457555
828593.2049268688733-8.20492686887327
83107110.378052456493-3.37805245649258
84141128.12953538643212.8704646135680
855857.60818655594350.39181344405651
866567.4930286704089-2.49302867040886
877080.366355043281-10.3663550432809
888669.755218745924216.2447812540758
899378.830059018225214.1699409817748
907470.35394367957573.64605632042425
918793.513167006661-6.51316700666105
9273105.723599750896-32.7235997508964
9310184.3440764876216.6559235123800
9410084.321972295227815.6780277047722
9596105.652081361223-9.65208136122297
96157128.73673498330428.2632650166963
976356.53476869079766.46523130920243
9811565.93384646781849.066153532182
997082.319287870801-12.3192878708009
1006683.15865050909-17.1586505090899
1016788.1707224094827-21.1707224094827
1028371.602045732132111.3979542678679
1037991.6658929831596-12.6658929831596
1047791.8747830897244-14.8747830897244
10510293.41469694534118.58530305465885
10611692.150818474451623.8491815255484
107100104.148636217526-4.14863621752573
108135145.197400604675-10.1974006046750
1097159.459430761929811.5405692380702
1106086.2717697122337-26.2717697122337
1118969.662002502106319.3379974978937
1127471.68178495891032.31821504108967
1137376.757687398338-3.75768739833806
1149175.805164164443715.1948358355563
1158686.1570604728685-0.157060472868451
1167486.8638230110096-12.8638230110096
1178798.8913423461226-11.8913423461226
11887101.623020259607-14.6230202596071
11910997.632749999445211.3672500005548
120137136.5922579883130.407742011687219
1214362.7763506832564-19.7763506832564
1226968.99801463644530.00198536355466672
1237373.9125795614875-0.912579561487505
1247766.94826884177910.051731158221
1256970.0298800105226-1.02988001052262
1267676.6213658097904-0.621365809790447
1277878.3829041718505-0.382904171850512
1287073.8553433508115-3.85534335081151
1298385.8842650801318-2.88426508013177
1306587.9837359146015-22.9837359146015
13111092.972470089304117.0275299106959
132132124.8544606359347.14553936406553
1335449.63954625465264.36045374534736
1345566.1450372810717-11.1450372810717
1356669.1418178231420-3.14181782314205
1366566.5706481831012-1.57064818310121
1376063.8228212725377-3.82282127253774
1386569.5399033418519-4.53990334185191
1399670.625485043575325.3745149564247
1405567.7738374466076-12.7738374466076
1417178.165138937122-7.16513893712205
1426371.4643714419119-8.4643714419119
1437492.9901554363611-18.9901554363611
144106113.618334282811-7.61833428281113
1453444.9526527142143-10.9526527142143
1464751.4009355245357-4.4009355245357
1475657.0296222918702-1.02962229187025
1485355.3102296008446-2.31022960084461
1495351.82031651454011.17968348545986
1505556.559898144611-1.55989814461095
1516767.6276825350254-0.627682535025372
1525249.70284506795282.29715493204721
1534661.166521607355-15.1665216073550
1545153.9298742678942-2.92987426789417
1555867.4384165077437-9.43841650774372
1569187.83019163961853.16980836038145
1573332.16551435776220.834485642237809
1584040.626355744086-0.626355744086027
1594646.5771942330355-0.57719423303547
1604544.54506325612960.454936743870405
1614142.9532110429528-1.95321104295283
1625545.33833599517419.66166400482589
1635755.88559996619171.11440003380825
1645442.027521690298111.9724783097019
1654646.3809366490888-0.380936649088767
1665245.93631445061226.06368554938776
1674856.4439993452249-8.44399934522492
1687779.3332731066916-2.33327310669156
1693028.73102025754681.26897974245322
1703535.7454419282666-0.745441928266573
1714241.02061542432790.97938457567215
1724839.78360362676898.21639637323113
1734438.33209708639495.6679029136051
1744545.960199225339-0.960199225338975
175151.2903227976446-50.2903227976446
176137.8417441670556-36.8417441670556
1774631.833801226737514.1661987732625
1785134.608812812480416.3911871875196
1796338.741563553727624.2584364462724
1808462.095385554625621.9046144453744
1813024.09972945337025.90027054662983
1823929.77276481992479.22723518007533
1834536.09656276732718.90343723267287
1845238.59429552913113.405704470869
1852837.0193499770225-9.0193499770225
1864039.7259706267460.274029373253995
1876224.136081904907337.8639180950927


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
18823.88992274314200.87310061744283446.9067448688411
18950.128835996364124.862307115082275.395364877646
19053.555231892944827.223318099096179.8871456867935
19160.824189369473532.689824388298888.9585543506482
19284.854667995630651.213170684509118.496165306752
19330.90530357959616.0116467050683455.7989604541238
19438.477802392322711.664828830432265.2907759542131
19544.528098469843515.595566727953673.4606302117334
19648.417204210580417.564332034153579.2700763870073
19735.29830842778687.2769678611168563.3196489944568
19843.959048494979212.411561778699575.5065352112588
19941.9343190305836-47.6216166954913131.490254756658
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244034418e8bf8m596q9p0ah/1xlb51244034253.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244034418e8bf8m596q9p0ah/1xlb51244034253.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244034418e8bf8m596q9p0ah/2fehv1244034253.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244034418e8bf8m596q9p0ah/2fehv1244034253.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244034418e8bf8m596q9p0ah/3whr21244034253.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2009/Jun/03/t1244034418e8bf8m596q9p0ah/3whr21244034253.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