Home » date » 2011 » May » 19 »

Opgave 10 Oefening 2

*Unverified author*
R Software Module: /rwasp_exponentialsmoothing.wasp (opens new window with default values)
Title produced by software: Exponential Smoothing
Date of computation: Thu, 19 May 2011 15:11:19 +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/May/19/t130581763593dshivmp7se06a.htm/, Retrieved Thu, 19 May 2011 17:07:16 +0200
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
KDGP2W102
 
Dataseries X:
» Textbox « » Textfile « » CSV «
8 8 8,2 8,5 8,7 8,7 8 8 8,3 8,5 8,7 8,6 8,3 7,9 7,9 8,1 8,3 8,1 7,4 7,3 7,7 8 8 7,7 6,9 6,6 6,9 7,5 7,9 7,7 6,5 6,1 6,4 6,8 7,1 7,3 7,2 7 7 7 7,3 7,5 7,2 7,7 8 7,9 8 8 7,9 7,9 8 8,1 8,1 8,2 8 8,3 8,5 8,6 8,7 8,7 8,5 8,4 8,5 8,7 8,7 8,6 7,9 8,1 8,2 8,5 8,6 8,5
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Estimated Parameters of Exponential Smoothing
ParameterValue
alpha1
beta0.947401841274698
gammaFALSE


Interpolation Forecasts of Exponential Smoothing
tObservedFittedResiduals
38.280.199999999999999
48.58.389480368254940.110519631745062
58.78.79418687086721-0.0941868708672136
68.78.90495405598371-0.204954055983713
788.71078020596802-0.710780205968025
887.337385730092310.66261426990769
98.37.965147709457750.334852290542255
108.58.58238738607253-0.0823873860725293
118.78.7043334248096-0.00433342480960519
128.68.90022793016596-0.300227930165958
138.38.51579143632464-0.215791436324636
147.98.01135023221937-0.111350232219365
157.97.505856817188370.394143182811627
168.17.879268794309980.220731205690021
178.38.288389945007490.0116100549925129
188.18.4993893324847-0.399389332484697
197.47.92100714350322-0.521007143503221
207.36.7274040164310.572595983569
217.77.169882505570770.530117494429233
2288.07211679588495-0.072116795884952
2388.30379321067672-0.303793210676716
247.78.01597896351484-0.315978963514843
256.97.41661991167681-0.51661991167681
266.66.127173256115030.472826743884971
276.96.275130183875570.624869816124431
287.57.167132998228840.332867001771162
297.98.08249180860643-0.182491808606425
307.78.30959873311515-0.609598733115148
316.57.53206377092313-1.03206377092313
326.15.354284654037650.745715345962352
336.45.660776745869180.739223254130822
346.86.66111821794580.138881782054206
357.17.19269507398346-0.0926950739834602
367.37.40487559021444-0.104875590214435
377.27.50551626294051-0.305516262940508
3877.11606959289131-0.116069592891306
3976.806105046870080.193894953129922
4076.989801482479240.0101985175207622
417.36.999463576756680.30053642324332
427.57.58419233750751-0.0841923375075133
437.27.70442836193167-0.504428361931675
447.76.926532003046430.773467996953574
4588.1593170075273-0.159317007527296
467.98.30837978124956-0.408379781249559
4787.821480024554370.178519975445631
4888.09061017799587-0.0906101779958739
497.98.00476592852436-0.104765928524355
507.97.805510494937530.0944895050624721
5187.895030026014850.104969973985151
528.18.094478772646940.00552122735306249
538.18.19970959360732-0.099709593607324
548.28.1052445410310.094755458969006
5588.29501603732906-0.295016037329058
568.37.815517300357940.484482699642057
578.58.57451710206457-0.0745171020645667
588.68.70391946236214-0.103919462362141
598.78.70546597237597-0.00546597237597268
608.78.80028750008262-0.100287500082619
618.58.70527493784751-0.205274937847509
628.48.310797083763230.0892029162367702
638.58.295308090853020.20469190914698
648.78.58923358247290.110766417527097
658.78.89417389038947-0.194173890389475
668.68.71021318910701-0.110213189107014
677.98.50579701081427-0.605797010814273
688.17.231863807330120.868136192669876
698.28.25433763474277-0.0543376347427706
708.58.302858059536960.197141940463043
718.68.78963069692411-0.189630696924112
728.58.709974225496-0.209974225496003


Extrapolation Forecasts of Exponential Smoothing
tForecast95% Lower Bound95% Upper Bound
738.411044257640867.684502594726189.13758592055554
748.322088515281726.731580463012979.91259656755047
758.233132772922585.5962506942124210.8700148516327
768.144177030563454.3041582345281811.9841958265987
778.05522128820432.8730310656385813.23741151077
787.966265545845171.3157927497382714.6167383419521
797.87730980348603-0.3576407700444916.1122603770166
807.7883540611269-2.1393622412728717.7160703635267
817.69939831876775-4.0228794623193319.4216760998548
827.61044257640861-6.0027398217109721.2236249745282
837.52148683404948-8.0742803715524523.1172540396514
847.43253109169034-10.233454400928425.0985165843091
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2011/May/19/t130581763593dshivmp7se06a/1e19g1305817875.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/19/t130581763593dshivmp7se06a/1e19g1305817875.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/19/t130581763593dshivmp7se06a/29vo51305817875.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/19/t130581763593dshivmp7se06a/29vo51305817875.ps (open in new window)


http://www.freestatistics.org/blog/date/2011/May/19/t130581763593dshivmp7se06a/3rs221305817875.png (open in new window)
http://www.freestatistics.org/blog/date/2011/May/19/t130581763593dshivmp7se06a/3rs221305817875.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