Home » date » 2011 » Jan » 17 »

Opgave 10

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Sun, 16 Jan 2011 23:28:57 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j.htm/, Retrieved Mon, 17 Jan 2011 00:26:44 +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/2011/Jan/17/t129522040124mqzywgaa8rq7j.htm/},
    year = {2011},
}
@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 = {2011},
    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:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
96,1 96,5 96,9 97,8 98,9 100,2 101,2 101 101,6 102,4 103,7 103,7 104,6 104,5 104,5 105,6 106,1 107,6 107,7 108,3 108,1 108,1 108 108,2 108,9 109,8 109,9 109,8 110,9 111,1 112,2 112,7 114,6 114,2 114,7 114,7 116 116,3 116,4 116,6 118,1 117,2 108,3 109,5 110,5 110,6 111,2 111,1 111 112,4 112,5 112,4 111,8 111,6 112,9 112,8 113,7 113,8 114 113,8 113,9 114,4 114,4 114,5 113,8 114,3 115 115,4 115,3 114,9 114,3 114,5 115,5 115,8 115,8 116 114,9 114,1 114,1 113,5 115 114,7 115,4 116,1 116,6 117,2 118,2 118 117,7 118,5 117,5 118 117,7 116,3 115 115,7 113,6 114,8 114,9 117,3 117,3 117,7 120 119,6 119,2 117,3 117,5 119 112,5 118,9 118,4 119,4 120,6 118,6 122 122,6 120,6 117,4 116,4 122,2 121 122,4 124,9 126,1 124,5 123,2 126,4 123,9 116 126,6 125,9 126,6 116,7 126,4 129 128,7 128,4 129,2 133,3 128,9 132,7 127,7 131,8 133,9
 
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' @ www.wessa.org


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha0.488347465828906
beta0.0122883696409223
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
396.996.90
497.897.30.499999999999986
598.997.9471742300010.952825769998881
6100.298.82120267913721.37879732086284
7101.299.91152741034151.28847258965851
8101100.9654744044640.0345255955364649
9101.6101.407266749620.192733250380044
10102.4101.9274759932060.47252400679352
11103.7102.5871559574611.11284404253858
12103.7103.5662127591070.133787240893
13104.6104.0679525092190.532047490780513
14104.5104.767374456997-0.267374456997018
15104.5105.074796209891-0.574796209890849
16105.6105.2286399801120.371360019888101
17106.1105.8467652767390.253234723260718
18107.6106.4087240442071.19127595579283
19107.7107.4359217104950.264078289505349
20108.3108.0119094784050.288090521595208
21108.1108.601352388546-0.50135238854638
22108.1108.802264241341-0.702264241341297
23108108.900847016348-0.900847016348393
24108.2108.897046418727-0.697046418727368
25108.9108.988588354992-0.0885883549916713
26109.8109.3767376265420.423262373457661
27109.9110.017387899251-0.117387899250801
28109.8110.393308537283-0.593308537282994
29110.9110.5332540967210.366745903278769
30111.1111.144240649294-0.0442406492942808
31112.2111.554257472550.645742527450125
32112.7112.3051009287780.394899071222127
33114.6112.9358154058631.66418459413738
34114.2114.1963690135290.00363098647093807
35114.7114.6460172645470.0539827354527631
36114.7115.120578614662-0.420578614661636
37116115.3608652422510.639134757748678
38116.3116.122495653720.177504346280202
39116.4116.659755226146-0.259755226145828
40116.6116.98192140487-0.38192140486963
41118.1117.2421361316780.857863868321644
42117.2118.112944890897-0.912944890897322
43108.3118.113505103113-9.81350510311326
44109.5113.708608504292-4.20860850429239
45110.5112.015593120627-1.51559312062675
46110.6111.628609909526-1.02860990952648
47111.2111.473271033395-0.273271033394565
48111.1111.685160085385-0.585160085384587
49111111.741227366953-0.741227366952657
50112.4111.7166314859580.683368514042044
51112.5112.3918342837480.108165716251676
52112.4112.786787354733-0.38678735473303
53111.8112.937710239136-1.13771023913608
54111.6112.715094443392-1.115094443392
55112.9112.496831338930.403168661070282
56112.8113.022427586779-0.222427586779091
57113.7113.2411807057070.458819294293107
58113.8113.7953723845220.00462761547819923
59114114.12778847828-0.127788478280394
60113.8114.394772650303-0.594772650303454
61113.9114.430137058128-0.53013705812792
62114.4114.493884744197-0.093884744196771
63114.4114.770111740433-0.370111740433018
64114.5114.909222944666-0.409222944665942
65113.8115.02677854692-1.22677854691968
66114.3114.737721051727-0.437721051726569
67115114.8313710232230.168628976776645
68115.4115.2221424360520.177857563947953
69115.3115.618487928244-0.318487928243982
70114.9115.770533112947-0.870533112946703
71114.3115.647764366538-1.34776436653837
72114.5115.283853020714-0.783853020713565
73115.5115.1906224541640.309377545835559
74115.8115.6331248372060.166875162793801
75115.8116.007037959495-0.207037959494542
76116116.197109122485-0.197109122484605
77114.9116.390846157172-1.49084615717156
78114.1115.943843430418-1.84384343041766
79114.1115.313390486147-1.21339048614706
80113.5114.983536090298-1.48353609029806
81115114.5128540818230.48714591817668
82114.7115.007472997958-0.307472997958371
83115.4115.112196636430.287803363570049
84116.1115.509349083830.590650916170347
85116.6116.0579408587810.542059141219426
86117.2116.5860558573220.613944142677866
87118.2117.152959989381.04704001062001
88118117.9376486720110.0623513279886794
89117.7118.241841301805-0.541841301805192
90118.5118.2477264054720.252273594528262
91117.5118.642929398711-1.14292939871055
92118118.349929833222-0.349929833222106
93117.7118.442089669053-0.742089669053144
94116.3118.338285967076-2.03828596707615
95115117.589256345531-2.58925634553084
96115.7116.555623623678-0.85562362367763
97113.6116.363471455839-2.76347145583928
98114.8115.223043057873-0.423043057872988
99114.9115.223018258082-0.3230182580822
100117.3115.2699018851052.03009811489532
101117.3116.478106536630.821893463370031
102117.7117.1012196862650.598780313735062
103120117.6189693718562.38103062814361
104119.6119.0213650328880.578634967111981
105119.2119.5470377255-0.347037725499931
106117.3119.618577933119-2.31857793311916
107117.5118.713407703901-1.21340770390071
108119118.340662902870.659337097130319
109112.5118.886424957645-6.38642495764455
110118.9115.9530820691782.94691793082249
111118.4117.5953379653380.804662034662314
112119.4118.1962573956331.20374260436749
113120.6118.9992904631591.6007095368406
114118.6120.005787174781-1.40578717478114
115122119.5356327156152.46436728438532
116122.6120.9702470326631.62975296733688
117120.6122.007059701097-1.40705970109735
118117.4121.552408841637-4.1524088416368
119116.4119.732155105314-3.33215510531437
120122.2118.292473959093.90752604090986
121121120.4117217950370.588278204962606
122122.4120.9135536159221.48644638407802
123124.9121.8629237470563.03707625294446
124126.1123.5877655219862.51223447801353
125124.5125.071378050633-0.571378050633271
126123.2125.045687378965-1.84568737896456
127126.4124.3866150169162.01338498308382
128123.9125.624193174877-1.72419317487663
129116125.026187637864-9.02618763786352
130126.6120.8081055099325.79189449006797
131125.9123.8611533627082.03884663729221
132126.6125.0936449142371.50635508576342
133116.7126.075135194094-9.37513519409357
134126.4121.6864171396674.71358286033323
135129124.2061750271784.79382497282245
136128.7126.7938866627051.906113337295
137128.4127.9828302140090.417169785991277
138129.2128.4471553887260.752844611273986
139133.3129.0799243298384.22007567016166
140128.9131.431231421509-2.53123142150932
141132.7130.4703648989182.22963510108173
142127.7131.847835505034-4.14783550503442
143131.8130.0859933655581.71400663444214
144133.9131.197052723812.70294727618992


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
145132.80727910917128.599004755087137.015553463254
146133.097528041934128.403122266893137.791933816975
147133.387776974698128.242776519163138.532777430232
148133.678025907461128.109219853087139.246831961835
149133.968274840225127.996638997015139.939910683435
150134.258523772988127.900945105182140.616102440795
151134.548772705752127.819137351337141.278408060167
152134.839021638516127.748939367211141.929103909821
153135.129270571279127.688578005351142.569963137208
154135.419519504043127.636641806457143.202397201629
155135.709768436807127.591986700982143.827550172632
156136.00001736957127.553671027083144.446363712058
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j/1llv61295220535.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j/1llv61295220535.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j/2568r1295220535.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j/2568r1295220535.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j/3uzyg1295220535.png (open in new window)
http://www.freestatistics.org/blog/date/2011/Jan/17/t129522040124mqzywgaa8rq7j/3uzyg1295220535.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Double ; par3 = additive ;
 
Parameters (R input):
par1 = 12 ; par2 = Double ; 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=F, beta=F)
if (par2 == 'Double') fit <- HoltWinters(x, gamma=F)
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